From e90885a66a8053ee914ef22db96f13fba0ed1441 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 26 Nov 2010 15:01:18 +0000 Subject: [PATCH] Humble start with glx api. --- glxapi.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/glxapi.py b/glxapi.py index b58e471..2c853df 100644 --- a/glxapi.py +++ b/glxapi.py @@ -27,6 +27,26 @@ from stdapi import * from glapi import glapi +VisualID = Alias("VisualID", UInt32) + +GLXContext = Opaque("GLXContext") +Display = Opaque("Display *") +Visual = Opaque("Visual *") + +XVisualInfo = Struct("XVisualInfo", [ + (Visual, "visual"), + (VisualID, "visualid"), + (Int, "screen"), + (Int, "depth"), + (Int, "c_class"), + (ULong, "red_mask"), + (ULong, "green_mask"), + (ULong, "blue_mask"), + (Int, "colormap_size"), + (Int, "bits_per_rgb"), +]) + +Bool_ = Alias("Bool", Int) glxapi = API("GLX") @@ -34,6 +54,8 @@ PROC = Opaque("__GLXextFuncPtr") glxapi.add_functions(glapi.functions) glxapi.add_functions([ + Function(GLXContext, "glXCreateContext", [(Display, "dpy"), (Pointer(XVisualInfo), "vis"), (GLXContext, "shareList"), (Bool_, "direct")]), + Function(PROC, "glXGetProcAddressARB", [(Alias("const GLubyte *", CString), "procName")]), Function(PROC, "glXGetProcAddress", [(Alias("const GLubyte *", CString), "procName")]), ]) -- 2.43.0