diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-10 13:56:10 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-10 13:59:44 +0200 |
commit | 54b2376adad98d91d32378efc3f241f120ba970f (patch) | |
tree | 4556581f7c51f88e9cb1e5610bc8afef524340e1 /include/mgl/gl.h | |
parent | 3b2fceed064c06d55e1cd33d51e855e909c81f75 (diff) |
Draw every frame instead of x11 expose, enable vsync (if available)
Diffstat (limited to 'include/mgl/gl.h')
-rw-r--r-- | include/mgl/gl.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/mgl/gl.h b/include/mgl/gl.h index 1791059..b5b6ca1 100644 --- a/include/mgl/gl.h +++ b/include/mgl/gl.h @@ -1,11 +1,28 @@ #ifndef MGL_GL_H #define MGL_GL_H +typedef struct _XVisualInfo _XVisualInfo; +typedef struct _XDisplay Display; +typedef struct __GLXcontextRec *GLXContext; +typedef unsigned long GLXDrawable; + typedef struct { void *handle; + + _XVisualInfo* (*glXChooseVisual)(Display *dpy, int screen, int *attribList); + GLXContext (*glXCreateContext)(Display *dpy, _XVisualInfo *vis, GLXContext shareList, int direct); + void (*glXDestroyContext)(Display *dpy, GLXContext ctx); + int (*glXMakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx); + void (*glXSwapBuffers)(Display *dpy, GLXDrawable drawable); + void (*glViewport)(int x, int y, int width, int height); void (*glClearColor)(float red, float green, float blue, float alpha); void (*glClear)(unsigned int mask); + + /* Optional*/ + void (*glXSwapIntervalEXT)(Display * dpy, GLXDrawable drawable, int interval); + int (*glXSwapIntervalMESA)(unsigned int interval); + int (*glXSwapIntervalSGI)(int interval); } mgl_gl; int mgl_gl_load(mgl_gl *self); |