diff options
author | StapleButter <thetotalworm@gmail.com> | 2019-05-31 02:21:41 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2019-05-31 02:21:41 +0200 |
commit | 3ef00f8fa628dbc0d04c045d8736044afc929d97 (patch) | |
tree | a7dce90d7b8ac0ffd1df7ec8e5779f12108b1a6b /src/libui_sdl/libui/unix | |
parent | 27d451d07a398a79cedef8040dfb6a612672b06c (diff) |
attempt at fixing THE FLICKERING without making everything shitty. also, clean up code
Diffstat (limited to 'src/libui_sdl/libui/unix')
-rw-r--r-- | src/libui_sdl/libui/unix/gl.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libui_sdl/libui/unix/gl.c b/src/libui_sdl/libui/unix/gl.c index ab29abb..dbb30fa 100644 --- a/src/libui_sdl/libui/unix/gl.c +++ b/src/libui_sdl/libui/unix/gl.c @@ -3,6 +3,8 @@ #include <GL/gl.h> +void* glXGetProcAddressARB(const GLubyte* name); + extern GThread* gtkthread; struct uiGLContext @@ -179,7 +181,6 @@ static void areaRellocRenderbuffer(uiGLContext* glctx) void areaPreRedrawGL(uiGLContext* glctx) { g_mutex_lock(&glctx->mutex); - glctx->backbuffer = glctx->backbuffer ? 0 : 1; } void areaPostRedrawGL(uiGLContext* glctx) @@ -206,7 +207,7 @@ void areaDrawGL(GtkWidget* widget, uiAreaDrawParams* dp, cairo_t* cr, uiGLContex int uiGLGetFramebuffer(uiGLContext* ctx) { - return ctx->framebuffer[ctx->backbuffer];// ? 0 : 1]; + return ctx->framebuffer[ctx->backbuffer]; } float uiGLGetFramebufferScale(uiGLContext* ctx) @@ -216,8 +217,7 @@ float uiGLGetFramebufferScale(uiGLContext* ctx) void uiGLSwapBuffers(uiGLContext* ctx) { - // nothing to do here, GTK will take care of this - //glFinish(); + ctx->backbuffer = ctx->backbuffer ? 0 : 1; } void uiGLMakeContextCurrent(uiGLContext* ctx) @@ -250,15 +250,15 @@ void uiGLEnd(uiGLContext* ctx) void *uiGLGetProcAddress(const char* proc) { -printf("get: %s - ", proc); -void* a = dlsym(NULL, proc); -void* b = glXGetProcAddress(proc); -void* c = glXGetProcAddressARB(proc); -printf("%p / %p / %p\n", a, b, c); -return a; - // this *will* break for older systems that don't have libglvnd! - // TODO: use a real solution - return dlsym(NULL /* RTLD_DEFAULT */, proc); + // TODO: consider using epoxy or something funny + + void* ptr = dlsym(NULL /* RTLD_DEFAULT */, proc); + if (ptr) return ptr; + + ptr = glXGetProcAddressARB((const GLubyte*)proc); + if (ptr) return ptr; + + return NULL; } unsigned int uiGLGetVersion(uiGLContext* ctx) { |