[gnome-games/glchess-vala] Get OpenGL working directly using GLX
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/glchess-vala] Get OpenGL working directly using GLX
- Date: Sat, 11 Dec 2010 04:02:16 +0000 (UTC)
commit 3017e861b7b77d345a833f60e2169bf651299c19
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Dec 11 15:01:44 2010 +1100
Get OpenGL working directly using GLX
configure.in | 76 +++++++--
glchess/src/Makefile.am | 15 +-
glchess/src/chess-view-3d.vala | 83 +++++----
glchess/src/glchess.vala | 4 +-
glchess/src/glx.vapi | 202 ++++++++++++++++++++++
glchess/src/gtkglext-1.0.vapi | 373 ----------------------------------------
6 files changed, 321 insertions(+), 432 deletions(-)
---
diff --git a/configure.in b/configure.in
index 9221da0..cd71112 100644
--- a/configure.in
+++ b/configure.in
@@ -23,9 +23,9 @@ AM_MAINTAINER_MODE([enable])
# we support and which features to check for
# This is the canonical list of all game subdirectories.
-allgames="aisleriot glines gnect gnibbles gnobots2 gnomine gnotravex gnotski gtali iagno mahjongg quadrapassel"
+allgames="aisleriot glchess glines gnect gnibbles gnobots2 gnomine gnotravex gnotski gtali iagno mahjongg quadrapassel"
AC_SUBST([allgames])
-staginggames="swell-foop glchess gnome-sudoku lightsoff"
+staginggames="swell-foop gnome-sudoku lightsoff"
AC_SUBST([staginggames])
gamelist=""
@@ -137,11 +137,19 @@ for game in $gamelist; do
*) ;;
esac
case $game in
- glchess) allow_gnuchess=yes ;;
+ glchess) need_gdk_x11=yes ;;
+ *) ;;
+ esac
+ case $game in
+ glchess) need_opengl=yes ;;
*) ;;
esac
case $game in
- glchess) need_gtkglext=yes ;;
+ glchess) need_glx=yes ;;
+ *) ;;
+ esac
+ case $game in
+ glchess) allow_gnuchess=yes ;;
*) ;;
esac
case $game in
@@ -593,7 +601,7 @@ case "$with_gtk" in
LIBCANBERRA_GTK_REQUIRED=0
LIBCANBERRA_GTK_PKGS="libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED"
;;
- 3.0) GTK_REQUIRED=2.91.0
+ 3.0) GTK_REQUIRED=2.91.6
RSVG_REQUIRED=2.32.0
LIBCANBERRA_GTK_REQUIRED=0.26
LIBCANBERRA_GTK_PKGS="libcanberra-gtk3 >= $LIBCANBERRA_GTK_REQUIRED"
@@ -697,23 +705,59 @@ fi
AM_CONDITIONAL([HAVE_RSVG],[test "$have_rsvg" = "yes"])
-# Check for GTKGLExt
+# Check for GDK X11
+
+have_gdk_x11=no
+if test "$need_gdk_x11" = "yes"; then
+ have_gdk_x11=yes
+
+ # Errors out if GDK X11 is not found
+ PKG_CHECK_MODULES([GDK_X11],[
+ gdk-x11-$GTK_API_VERSION x11])
+
+ AC_SUBST([GDK_X11_CFLAGS])
+ AC_SUBST([GDK_X11_LIBS])
+
+ AC_DEFINE([HAVE_GDK_X11],[1],[Define if GDK X11 is available])
+fi
+
+AM_CONDITIONAL([HAVE_GDK_X11],[test "$have_gdk_x11" = "yes"])
+
+# Check for OpenGL
+
+have_opengl=no
+if test "$need_opengl" = "yes"; then
+ have_opengl=yes
+
+ # Errors out if OpenGL is not found
+ PKG_CHECK_MODULES([OPENGL],[
+ gl glu])
+
+ AC_SUBST([OPENGL_CFLAGS])
+ AC_SUBST([OPENGL_LIBS])
+
+ AC_DEFINE([HAVE_OPENGL],[1],[Define if OpenGL is available])
+fi
+
+AM_CONDITIONAL([HAVE_OPENGL],[test "$have_opengl" = "yes"])
+
+# Check for GLX
-have_gtkglext=no
-if test "$need_gtkglext" = "yes"; then
- have_gtkglext=yes
+have_glx=no
+if test "$need_glx" = "yes"; then
+ have_glx=yes
- # Errors out if gtkglext is not found
- PKG_CHECK_MODULES([GTKGLEXT],[
- gtklext-1.0])
+ # Errors out if GLX is not found
+ PKG_CHECK_MODULES([GLX],[
+ gl])
- AC_SUBST([GTKGLEXT_CFLAGS])
- AC_SUBST([GTKGLEXT_LIBS])
+ AC_SUBST([GLX_CFLAGS])
+ AC_SUBST([GLX_LIBS])
- AC_DEFINE([HAVE_GTKGLEXT],[1],[Define if GtkGLExt is available])
+ AC_DEFINE([HAVE_GLX],[1],[Define if GLX is available])
fi
-AM_CONDITIONAL([HAVE_GTKGLEXT],[test "$have_gtkglext" = "yes"])
+AM_CONDITIONAL([HAVE_GLX],[test "$have_glx" = "yes"])
# Check for Clutter
diff --git a/glchess/src/Makefile.am b/glchess/src/Makefile.am
index 4682774..6ed8d92 100644
--- a/glchess/src/Makefile.am
+++ b/glchess/src/Makefile.am
@@ -1,6 +1,7 @@
bin_PROGRAMS = glchess
glchess_SOURCES = \
+ 3ds.vala \
glchess.vala \
ai-profile.vala \
chess-engine.vala \
@@ -10,14 +11,15 @@ glchess_SOURCES = \
chess-pgn.vala \
chess-view.vala \
chess-view-2d.vala \
+ chess-view-3d.vala \
chess-view-options.vala
-# 3ds.vala
-# chess-view-3d.vala
-
glchess_CFLAGS = \
$(GMODULE_CFLAGS) \
$(GTK_CFLAGS) \
+ $(GDK_X11_CFLAGS) \
+ $(GLX_CFLAGS) \
+ $(OPENGL_CFLAGS) \
$(RSVG_CFLAGS) \
$(GTKGLEXT_CFLAGS) \
$(WARN_CFLAGS)
@@ -25,19 +27,22 @@ glchess_CFLAGS = \
glchess_LDADD = \
$(GMODULE_LIBS) \
$(GTK_LIBS) \
+ $(GDK_X11_LIBS) \
+ $(GLX_LIBS) \
+ $(OPENGL_LIBS) \
$(RSVG_LIBS) \
$(GTKGLEXT_LIBS)
glchess_VALAFLAGS = \
--pkg gtk+-3.0 \
+ --pkg gdk-x11-3.0 \
--pkg gmodule-2.0 \
+ --pkg glx \
--pkg librsvg-2.0 \
--pkg posix \
--vapidir . \
--pkg gl \
--pkg glu
-# --pkg gtkglext-1.0
-
DISTCLEANFILES = \
Makefile.in
diff --git a/glchess/src/chess-view-3d.vala b/glchess/src/chess-view-3d.vala
index 9235640..7b881d8 100644
--- a/glchess/src/chess-view-3d.vala
+++ b/glchess/src/chess-view-3d.vala
@@ -1,8 +1,13 @@
using GL;
using GLU;
+using GLX;
private class ChessView3D : ChessView
{
+ private GLX.Context context;
+ private void *display;
+ private Drawable drawable;
+
private int border = 6;
private int square_size;
private TDSModel pawn_model;
@@ -33,16 +38,17 @@ private class ChessView3D : ChessView
OFFSET = (BOARD_OUTER_WIDTH * 0.5f);
add_events (Gdk.EventMask.BUTTON_PRESS_MASK);
- var gl_config = new Gdk.GLConfig.by_mode (Gdk.GLConfigMode.RGB | Gdk.GLConfigMode.DEPTH | Gdk.GLConfigMode.DOUBLE | Gdk.GLConfigMode.ACCUM);
- Gtk.WidgetGL.set_gl_capability (this, gl_config, null, true, Gdk.GLRenderType.RGBA_TYPE);
+ realize.connect (realize_cb);
+
+ double_buffered = false;
try
{
- pawn_model = new TDSModel (File.new_for_path ("data/pawn.3ds"));
- knight_model = new TDSModel (File.new_for_path ("data/knight.3ds"));
- bishop_model = new TDSModel (File.new_for_path ("data/bishop.3ds"));
- rook_model = new TDSModel (File.new_for_path ("data/rook.3ds"));
- queen_model = new TDSModel (File.new_for_path ("data/queen.3ds"));
- king_model = new TDSModel (File.new_for_path ("data/king.3ds"));
+ pawn_model = new TDSModel (File.new_for_path ("data/pieces/3d/pawn.3ds"));
+ knight_model = new TDSModel (File.new_for_path ("data/pieces/3d/knight.3ds"));
+ bishop_model = new TDSModel (File.new_for_path ("data/pieces/3d/bishop.3ds"));
+ rook_model = new TDSModel (File.new_for_path ("data/pieces/3d/rook.3ds"));
+ queen_model = new TDSModel (File.new_for_path ("data/pieces/3d/queen.3ds"));
+ king_model = new TDSModel (File.new_for_path ("data/pieces/3d/king.3ds"));
}
catch (GLib.Error e)
{
@@ -95,19 +101,34 @@ private class ChessView3D : ChessView
board_quads = {0, 1, 5, 4, 0, 4, 7, 3, 3, 7, 6, 2, 2, 6, 5, 1,
4, 5, 9, 8, 4, 8, 11, 7, 7, 11, 10, 6, 6, 10, 9, 5};
}
+
+ public void realize_cb ()
+ {
+ int[] attributes = { GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_DOUBLEBUFFER,
+ GLX_DEPTH_SIZE, 1,
+ GLX_ACCUM_RED_SIZE, 1,
+ GLX_ACCUM_GREEN_SIZE, 1,
+ GLX_ACCUM_BLUE_SIZE, 1,
+ GLX_NONE };
+ drawable = Gdk.x11_window_get_xid (get_window ());
+ display = Gdk.x11_display_get_xdisplay (get_window ().get_display ());
+ var screen = Gdk.x11_screen_get_screen_number (get_screen ());
+ var visual = glXChooseVisual (display, screen, attributes);
+ context = glXCreateContext (display, visual, null, true);
+ }
public override bool configure_event (Gdk.EventConfigure event)
{
- int short_edge = int.min (allocation.width, allocation.height);
+ int short_edge = int.min (get_allocated_width (), get_allocated_height ());
square_size = (int) Math.floor ((short_edge - 2 * border) / 9.0);
- var drawable = Gtk.WidgetGL.get_gl_drawable (this);
- if (drawable.gl_begin (Gtk.WidgetGL.get_gl_context (this)))
- {
- glViewport (0, 0, (GLsizei) allocation.width, (GLsizei) allocation.height);
- drawable.gl_end ();
- }
+ if (glXMakeCurrent (display, drawable, context))
+ glViewport (0, 0, (GLsizei) get_allocated_width (), (GLsizei) get_allocated_height ());
return true;
}
@@ -117,8 +138,8 @@ private class ChessView3D : ChessView
{
var xwsize = right - left;
var ywsize = top - bottom;
- var dx = -(pixdx * xwsize / allocation.width + eyedx * near/focus);
- var dy = -(pixdy * ywsize / allocation.height + eyedy * near/focus);
+ var dx = -(pixdx * xwsize / get_allocated_width () + eyedx * near/focus);
+ var dy = -(pixdy * ywsize / get_allocated_height () + eyedy * near/focus);
glFrustum (left + dx, right + dx, bottom + dy, top + dy, near, far);
glTranslatef (-eyedx, -eyedy, 0.0f);
@@ -139,10 +160,9 @@ private class ChessView3D : ChessView
public override bool draw (Cairo.Context c)
{
- var drawable = Gtk.WidgetGL.get_gl_drawable (this);
GLfloat[] jitters = {0.0033922635f, 0.3317967229f, 0.2806016275f, -0.2495619123f, -0.273817106f, -0.086844639f};
- if (!drawable.gl_begin (Gtk.WidgetGL.get_gl_context (this)))
+ if (!glXMakeCurrent (display, drawable, context))
return true;
var n_passes = 1;
@@ -154,7 +174,7 @@ private class ChessView3D : ChessView
for (var i = 0; i < n_passes; i++)
{
- var bg = style.bg[state];
+ var bg = style.bg[get_state ()];
glClearColor (bg.red / 65535.0f, bg.green / 65535.0f, bg.blue / 65535.0f, 1.0f);
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -163,9 +183,9 @@ private class ChessView3D : ChessView
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
if (options.show_3d_smooth)
- accPerspective (60.0f, (float) allocation.width / allocation.height, 0.1f, 1000, jitters[i*2], jitters[i*2+1], 0, 0, 1);
+ accPerspective (60.0f, (float) get_allocated_width () / get_allocated_height (), 0.1f, 1000, jitters[i*2], jitters[i*2+1], 0, 0, 1);
else
- gluPerspective (60.0f, (float) allocation.width / allocation.height, 0.1f, 1000);
+ gluPerspective (60.0f, (float) get_allocated_width () / get_allocated_height (), 0.1f, 1000);
glMatrixMode(GL_MODELVIEW);
transform_camera ();
@@ -185,12 +205,7 @@ private class ChessView3D : ChessView
if (options.show_3d_smooth)
glAccum (GL_RETURN, 1);
- if (drawable.is_double_buffered ())
- drawable.swap_buffers ();
- else
- glFlush ();
-
- drawable.gl_end ();
+ glXSwapBuffers (display, drawable);
return true;
}
@@ -317,9 +332,7 @@ private class ChessView3D : ChessView
if (options.game == null || event.button != 1)
return false;
- var drawable = Gtk.WidgetGL.get_gl_drawable (this);
-
- if (!drawable.gl_begin (Gtk.WidgetGL.get_gl_context (this)))
+ if (!glXMakeCurrent (display, drawable, context))
return true;
/* Don't render to screen, just select */
@@ -332,9 +345,9 @@ private class ChessView3D : ChessView
/* Create pixel picking region near cursor location */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- GLint[] viewport = {0, 0, (GLint) allocation.width, (GLint) allocation.height};
- gluPickMatrix(event.x, ((float) allocation.height - event.y), 1.0, 1.0, viewport);
- gluPerspective(60.0, (float) allocation.width / (float) allocation.height, 0, 1);
+ GLint[] viewport = {0, 0, (GLint) get_allocated_width (), (GLint) get_allocated_height ()};
+ gluPickMatrix(event.x, ((float) get_allocated_height () - event.y), 1.0, 1.0, viewport);
+ gluPerspective(60.0, (float) get_allocated_width () / (float) get_allocated_height (), 0, 1);
/* Draw the squares that can be selected */
glMatrixMode(GL_MODELVIEW);
@@ -377,8 +390,6 @@ private class ChessView3D : ChessView
options.select_square (file, rank);
}
- drawable.gl_end ();
-
return true;
}
diff --git a/glchess/src/glchess.vala b/glchess/src/glchess.vala
index 163f528..8575905 100644
--- a/glchess/src/glchess.vala
+++ b/glchess/src/glchess.vala
@@ -104,9 +104,9 @@ public class Application
{
if (view != null)
view.destroy ();
- /*if (settings.get_boolean ("show-3d"))
+ if (settings.get_boolean ("show-3d"))
view = new ChessView3D ();
- else*/
+ else
view = new ChessView2D ();
view.set_size_request (300, 300);
view.options = view_options;
diff --git a/glchess/src/glx.vapi b/glchess/src/glx.vapi
new file mode 100644
index 0000000..8e09d60
--- /dev/null
+++ b/glchess/src/glx.vapi
@@ -0,0 +1,202 @@
+/* glx.vapi
+ *
+ * Copyright (C) 2008 Matias De la Puente
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Matias De la Puente <mfpuente ar gmail com>
+ */
+
+[CCode (lower_case_cprefix ="", cheader_filename="GL/glx.h")]
+namespace GLX
+{
+
+ public const int GLX_VERSION_1_1;
+ public const int GLX_VERSION_1_2;
+ public const int GLX_VERSION_1_3;
+ public const int GLX_VERSION_1_4;
+ public const int GLX_EXTENSION_NAME;
+ public const int GLX_USE_GL;
+ public const int GLX_BUFFER_SIZE;
+ public const int GLX_LEVEL;
+ public const int GLX_RGBA;
+ public const int GLX_DOUBLEBUFFER;
+ public const int GLX_STEREO;
+ public const int GLX_AUX_BUFFERS;
+ public const int GLX_RED_SIZE;
+ public const int GLX_GREEN_SIZE;
+ public const int GLX_BLUE_SIZE;
+ public const int GLX_ALPHA_SIZE;
+ public const int GLX_DEPTH_SIZE;
+ public const int GLX_STENCIL_SIZE;
+ public const int GLX_ACCUM_RED_SIZE;
+ public const int GLX_ACCUM_GREEN_SIZE;
+ public const int GLX_ACCUM_BLUE_SIZE;
+ public const int GLX_ACCUM_ALPHA_SIZE;
+ public const int GLX_BAD_SCREEN;
+ public const int GLX_BAD_ATTRIBUTE;
+ public const int GLX_NO_EXTENSION;
+ public const int GLX_BAD_VISUAL;
+ public const int GLX_BAD_CONTEXT;
+ public const int GLX_BAD_VALUE;
+ public const int GLX_BAD_ENUM;
+ public const int GLX_VENDOR;
+ public const int GLX_VERSION;
+ public const int GLX_EXTENSIONS;
+ public const int GLX_CONFIG_CAVEAT;
+ public const int GLX_DONT_CARE;
+ public const int GLX_X_VISUAL_TYPE;
+ public const int GLX_TRANSPARENT_TYPE;
+ public const int GLX_TRANSPARENT_INDEX_VALUE;
+ public const int GLX_TRANSPARENT_RED_VALUE;
+ public const int GLX_TRANSPARENT_GREEN_VALUE;
+ public const int GLX_TRANSPARENT_BLUE_VALUE;
+ public const int GLX_TRANSPARENT_ALPHA_VALUE;
+ public const int GLX_WINDOW_BIT;
+ public const int GLX_PIXMAP_BIT;
+ public const int GLX_PBUFFER_BIT;
+ public const int GLX_AUX_BUFFERS_BIT;
+ public const int GLX_FRONT_LEFT_BUFFER_BIT;
+ public const int GLX_FRONT_RIGHT_BUFFER_BIT;
+ public const int GLX_BACK_LEFT_BUFFER_BIT;
+ public const int GLX_BACK_RIGHT_BUFFER_BIT;
+ public const int GLX_DEPTH_BUFFER_BIT;
+ public const int GLX_STENCIL_BUFFER_BIT;
+ public const int GLX_ACCUM_BUFFER_BIT;
+ public const int GLX_NONE;
+ public const int GLX_SLOW_CONFIG;
+ public const int GLX_TRUE_COLOR;
+ public const int GLX_DIRECT_COLOR;
+ public const int GLX_PSEUDO_COLOR;
+ public const int GLX_STATIC_COLOR;
+ public const int GLX_GRAY_SCALE;
+ public const int GLX_STATIC_GRAY;
+ public const int GLX_TRANSPARENT_RGB;
+ public const int GLX_TRANSPARENT_INDEX;
+ public const int GLX_VISUAL_ID;
+ public const int GLX_SCREEN;
+ public const int GLX_NON_CONFORMANT_CONFIG;
+ public const int GLX_DRAWABLE_TYPE;
+ public const int GLX_RENDER_TYPE;
+ public const int GLX_X_RENDERABLE;
+ public const int GLX_FBCONFIG_ID;
+ public const int GLX_RGBA_TYPE;
+ public const int GLX_COLOR_INDEX_TYPE;
+ public const int GLX_MAX_PBUFFER_WIDTH;
+ public const int GLX_MAX_PBUFFER_HEIGHT;
+ public const int GLX_MAX_PBUFFER_PIXELS;
+ public const int GLX_PRESERVED_CONTENTS;
+ public const int GLX_LARGEST_PBUFFER;
+ public const int GLX_WIDTH;
+ public const int GLX_HEIGHT;
+ public const int GLX_EVENT_MASK;
+ public const int GLX_DAMAGED;
+ public const int GLX_SAVED;
+ public const int GLX_WINDOW;
+ public const int GLX_PBUFFER;
+ public const int GLX_PBUFFER_HEIGHT;
+ public const int GLX_PBUFFER_WIDTH;
+ public const int GLX_RGBA_BIT;
+ public const int GLX_COLOR_INDEX_BIT;
+ public const int GLX_PBUFFER_CLOBBER_MASK;
+ public const int GLX_SAMPLE_BUFFERS;
+ public const int GLX_SAMPLES;
+
+ [SimpleType]
+ public struct Context { }
+ [SimpleType]
+ [IntegerType (rank=9)]
+ public struct Pixmap { }
+ [SimpleType]
+ [IntegerType (rank=9)]
+ public struct Drawable { }
+ [SimpleType]
+ public struct FBConfig { }
+ [SimpleType]
+ [IntegerType (rank=9)]
+ public struct FBConfigID { }
+ [SimpleType]
+ [IntegerType (rank=9)]
+ public struct ContextID { }
+ [SimpleType]
+ [IntegerType (rank=9)]
+ public struct Window { }
+ [SimpleType]
+ [IntegerType (rank=9)]
+ public struct Pbuffer { }
+ [SimpleType]
+ [IntegerType (rank=9)]
+ public struct Font { }
+ [SimpleType]
+ [IntegerType (rank=9)]
+ public struct VisualID { }
+
+ [Compact]
+ [CCode (cname="XVisualInfo", free_function="XFree")]
+ public class XVisualInfo
+ {
+ public uint32 visualid;
+ public int screen;
+ public int depth;
+ public int @class;
+ public ulong red_mask;
+ public ulong green_mask;
+ public ulong blue_mask;
+ public int colormap_size;
+ public int bits_per_rgb;
+ }
+
+ public static XVisualInfo glXChooseVisual (void* dpy, int screen, [CCode (array_length = false)] int[] attribList);
+ public static Context glXCreateContext (void* dpy, XVisualInfo vis, Context? shareList, bool direct);
+ public static void glXDestroyContext (void* dpy, Context ctx);
+ public static bool glXMakeCurrent (void* dpy, Drawable drawable, Context ctx);
+ public static void glXCopyContext (void* dpy, Context src, Context dst, ulong mask);
+ public static void glXSwapBuffers (void* dpy, Drawable drawable);
+ public static Pixmap glXCreateGLXPixmap (void* dpy, XVisualInfo visual, Pixmap pixmap);
+ public static void glXDestroyGLXPixmap (void* dpy, Pixmap pixmap);
+ public static bool glXQueryExtension (void* dpy, out int errorb, out int event);
+ public static bool glXQueryVersion (void* dpy, out int maj, out int min);
+ public static bool glXIsDirect (void* dpy, Context ctx );
+ public static int glXGetConfig (void* dpy, XVisualInfo visual, int attrib, out int @value);
+ public static unowned string glXQueryExtensionsString (void* dpy, int screen);
+ public static unowned string glXQueryServerString (void* dpy, int screen, int name);
+ public static unowned string glXGetClientString (void* dpy, int name);
+ public static void* glXGetCurrentDisplay (void* dpy);
+ public static FBConfig* glXChooseFBConfig (void* dpy, int screen, [CCode (array_length = false)] int[] attribList, out int nitems);
+ public static int glXGetFBConfigAttrib (void* dpy, FBConfig config, int attribute, out int @value);
+ public static FBConfig glXGetFBConfigs (void* dpy, int screen, out int nelements);
+ public static XVisualInfo glXGetVisualFromFBConfig (void* dpy, FBConfig config);
+ public static Window glXCreateWindow (void* dpy, FBConfig config, Window win, [CCode (array_length = false)] int[] attribList);
+ public static void glXDestroyWindow (void* dpy, Window window);
+ public static Pixmap glXCreatePixmap (void* dpy, FBConfig config, Pixmap pixmap, [CCode (array_length = false)] int[] attribList);
+ public static void glXDestroyPixmap (void* dpy, Pixmap pixmap);
+ public static Pbuffer glXCreatePbuffer (void* dpy, FBConfig config, [CCode (array_length = false)] int[] attribList);
+ public static void glXDestroyPbuffer (void* dpy, Pbuffer pbuf);
+ public static void glXQueryDrawable (void* dpy, Drawable draw, int attribute, out uint @value);
+ public static Context glXCreateNewContext (void* dpy, FBConfig config, int renderType, Context shareList, bool direct);
+ public static bool glXMakeContextCurrent (void* dpy, Drawable draw, Drawable read, Context ctx);
+ public static int glXQueryContext (void* dpy, Context ctx, int attribute, out int @value);
+ public static void glXSelectEvent (void* dpy, Drawable drawable, ulong mask);
+ public static void glXGetSelectedEvent (void* dpy, Drawable drawable, out ulong mask);
+
+ public static Context glXGetCurrentContext ();
+ public static Drawable glXGetCurrentDrawable ();
+ public static void glXWaitGL ();
+ public static void glXWaitX ();
+ public static void glXUseXFont (Font font, int first, int count, int list);
+ public static Drawable glXGetCurrentReadDrawable ();
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]