From 2d2457b4d565bce1c58b76b427e1f9027e8b4bcc Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Thu, 26 Jan 2023 16:45:17 -0500 Subject: [PATCH] Implement getGLUTFontPointer for EGL platform This is simply copied from GLX, but there doesn't seem like there should be any differences. Fixes #89. --- OpenGL/platform/egl.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenGL/platform/egl.py b/OpenGL/platform/egl.py index e74f3dd8..55fbb0be 100644 --- a/OpenGL/platform/egl.py +++ b/OpenGL/platform/egl.py @@ -104,3 +104,19 @@ def GLE( self ): @baseplatform.lazy_property def GetCurrentContext( self ): return self.EGL.eglGetCurrentContext + + def getGLUTFontPointer( self, constant ): + """Platform specific function to retrieve a GLUT font pointer + + GLUTAPI void *glutBitmap9By15; + #define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15) + + Key here is that we want the addressof the pointer in the DLL, + not the pointer in the DLL. That is, our pointer is to the + pointer defined in the DLL, we don't want the *value* stored in + that pointer. + """ + name = [ x.title() for x in constant.split( '_' )[1:] ] + internal = 'glut' + "".join( [x.title() for x in name] ) + pointer = ctypes.c_void_p.in_dll( self.GLUT, internal ) + return ctypes.c_void_p(ctypes.addressof(pointer))