]> gitweb.factorcode.org Git - factor.git/commitdiff
opengl.gl.extensions: simpler definition of gl-calling-convention
authorBjörn Lindqvist <bjourne@gmail.com>
Fri, 16 Sep 2016 04:42:50 +0000 (06:42 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Fri, 16 Sep 2016 04:42:50 +0000 (06:42 +0200)
basis/opengl/gl/extensions/extensions-tests.factor [new file with mode: 0644]
basis/opengl/gl/extensions/extensions.factor
basis/opengl/gl/gtk/gtk.factor
basis/opengl/gl/macosx/macosx.factor
basis/opengl/gl/windows/windows.factor
basis/opengl/gl/x11/x11.factor

diff --git a/basis/opengl/gl/extensions/extensions-tests.factor b/basis/opengl/gl/extensions/extensions-tests.factor
new file mode 100644 (file)
index 0000000..4e87d9d
--- /dev/null
@@ -0,0 +1,7 @@
+USING: alien kernel opengl.gl.extensions system tools.test ;
+IN: opengl.gl.extensions.tests
+
+{ t } [
+    gl-function-calling-convention
+    os windows? [ stdcall ] [ cdecl ] if =
+] unit-test
index 7944ed1455a0237719053b141860d12d56cd6a3a..4fbf78bac2029551af35fc5627f50a1d6e69e3fc 100644 (file)
@@ -46,6 +46,9 @@ reset-gl-function-number-counter
     names return function-effect
     define-declared ;
 
+: gl-function-calling-convention ( -- symbol )
+    os windows? [ stdcall ] [ cdecl ] if ;
+
 SYNTAX: GL-FUNCTION:
     gl-function-calling-convention
     scan-function-name
index c5fbdeebb334a679fd04318321702970ce9b0be8..850f60edc405b848a9f2aff889cee0b294faa2d4 100644 (file)
@@ -9,5 +9,3 @@ IN: opengl.gl.gtk
 
 : gl-function-address ( name -- address )
     ascii string>alien gdk_gl_get_proc_address ; inline
-
-: gl-function-calling-convention ( -- str ) cdecl ; inline
index aeaa5da4eb759dfdb75e84b038abad88ca6bd104..56696c6bac68f966983b48aeafc9b01e634735dc 100644 (file)
@@ -3,4 +3,3 @@ IN: opengl.gl.macosx
 
 : gl-function-context ( -- context ) 0 ; inline
 : gl-function-address ( name -- address ) f dlsym ; inline
-: gl-function-calling-convention ( -- str ) cdecl ; inline
index ba3f1026522f795c6c6d55b4200bf1415b6a5f33..f27d20815d4cd34f3c0d2a5c807ed587c58631fe 100644 (file)
@@ -8,4 +8,3 @@ FUNCTION: void* wglGetProcAddress ( c-string name )
 
 : gl-function-context ( -- context ) wglGetCurrentContext ; inline
 : gl-function-address ( name -- address ) wglGetProcAddress ; inline
-: gl-function-calling-convention ( -- str ) stdcall ; inline
index 2d752757bbf7bfdb8876788b8e2ba78a58156566..f96cc9901a3f603ecd6353012b3a1a432372184c 100644 (file)
@@ -3,4 +3,3 @@ IN: opengl.gl.x11
 
 : gl-function-context ( -- context ) glXGetCurrentContext ; inline
 : gl-function-address ( name -- address ) glXGetProcAddressARB ; inline
-: gl-function-calling-convention ( -- str ) cdecl ; inline