]> gitweb.factorcode.org Git - factor.git/commitdiff
add opengl.gl.gtk backend
authorAnton Gorenko <ex.rzrjck@gmail.com>
Mon, 24 May 2010 13:22:29 +0000 (19:22 +0600)
committerAnton Gorenko <ex.rzrjck@gmail.com>
Mon, 24 May 2010 13:22:29 +0000 (19:22 +0600)
basis/opengl/gl/extensions/extensions.factor
basis/opengl/gl/gtk/authors.txt [new file with mode: 0644]
basis/opengl/gl/gtk/gtk.factor [new file with mode: 0644]

index 530f3ada6cec54c7c82278af9d296f525d8f8562..327b552fa2ea043088fd4d3098065a68477bdcb8 100644 (file)
@@ -7,7 +7,7 @@ ERROR: unknown-gl-platform ;
 << {
     { [ os windows? ] [ "opengl.gl.windows" ] }
     { [ os macosx? ]  [ "opengl.gl.macosx" ] }
-    { [ os unix? ] [ "opengl.gl.unix" ] }
+    { [ os unix? ] [ "opengl.gl.gtk" ] }
     [ unknown-gl-platform ]
 } cond use-vocab >>
 
diff --git a/basis/opengl/gl/gtk/authors.txt b/basis/opengl/gl/gtk/authors.txt
new file mode 100644 (file)
index 0000000..4af9fbe
--- /dev/null
@@ -0,0 +1 @@
+Anton Gorenko
diff --git a/basis/opengl/gl/gtk/gtk.factor b/basis/opengl/gl/gtk/gtk.factor
new file mode 100644 (file)
index 0000000..fef8031
--- /dev/null
@@ -0,0 +1,14 @@
+! Copyright (C) 2010 Anton Gorenko.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien alien.strings io.encodings.ascii
+gdk.gl gdk.gl.ffi ;
+IN: opengl.gl.gtk
+
+: gl-function-context ( -- context )
+    gdk_gl_context_get_current ; inline
+
+: gl-function-address ( name -- address )
+    ascii string>alien gdk_gl_get_proc_address ; inline
+
+: gl-function-calling-convention ( -- str ) cdecl ; inline
+