Skip to content

Commit 076749e

Browse files
committed
add functions: glfwPlatformSupported, glfwGetPlatform, glfwGetError, glfwInitHint
Listed all with: (then selected from) perl -ne 'next if !/^GLFWAPI/; s/\(.*//; /(\w*)$/; print "$1\n"' \ /usr/local/opt/glfw/include/GLFW/glfw3.h >funcs for x in `cat funcs`; do echo -n "$x: "; grep -c $x GLFW.xs; done
1 parent ccf93fa commit 076749e

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Changes

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- minimum Perl 5.10 for better Exporter
22
- add constants up to GLFW 3.4
3+
- add functions: glfwPlatformSupported, glfwGetPlatform, glfwGetError, glfwInitHint
34

45
0.0401 2025-03-27
56
- add GLFW_TRANSPARENT_FRAMEBUFFER and glfwGetMonitorWorkarea (#1) - thanks @SeHarrys

GLFW.xs

+24
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,30 @@ glfwGetTimerFrequency();
16821682
uint64_t
16831683
glfwGetTimerValue();
16841684

1685+
#if (GLFW_VERSION_MAJOR*10000 + GLFW_VERSION_MINOR*100) >= 30400
1686+
1687+
int
1688+
glfwPlatformSupported(int platform);
1689+
1690+
int
1691+
glfwGetPlatform();
1692+
1693+
#endif
1694+
1695+
void
1696+
glfwGetError();
1697+
PREINIT:
1698+
int errcode;
1699+
char* description;
1700+
PPCODE:
1701+
errcode = glfwGetError(&description);
1702+
EXTEND(SP, 2);
1703+
PUSHs(sv_2mortal(newSViv(errcode)));
1704+
PUSHs(!description ? &PL_sv_undef : sv_2mortal(newSVpv(description, 0)));
1705+
1706+
void
1707+
glfwInitHint(int hint, int value);
1708+
16851709
#//-------------------------------------------------------------------
16861710
#// OpenGL not supported (use GLEW)
16871711
#//-------------------------------------------------------------------

lib/OpenGL/GLFW.pm

+4
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ use Exporter 'import';
352352

353353
my @const = (qw(NULL), sort keys %const_hash);
354354
my @functions = qw(
355+
glfwPlatformSupported
356+
glfwGetPlatform
357+
glfwGetError
358+
glfwInitHint
355359
glfwCreateCursor
356360
glfwCreateStandardCursor
357361
glfwCreateWindow

0 commit comments

Comments
 (0)