From a5524a7e3e8248a5a4baa8af62a1a758f1d07e7f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 23 Sep 2022 21:10:08 +0200 Subject: Make window rgba and set background transparent to allow window clear to work with transparency --- include/mgl/gl.h | 8 +++++--- include/mgl/gl_macro.h | 15 ++++++--------- include/mgl/mgl.h | 1 + 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/mgl/gl.h b/include/mgl/gl.h index 2546a68..cf2cd47 100644 --- a/include/mgl/gl.h +++ b/include/mgl/gl.h @@ -9,15 +9,17 @@ typedef struct _XVisualInfo _XVisualInfo; typedef struct _XDisplay Display; typedef struct __GLXcontextRec *GLXContext; typedef unsigned long GLXDrawable; +typedef struct __GLXFBConfigRec *GLXFBConfig; typedef struct { void *handle; - _XVisualInfo* (*glXChooseVisual)(Display *dpy, int screen, int *attribList); - GLXContext (*glXCreateContext)(Display *dpy, _XVisualInfo *vis, GLXContext shareList, int direct); + GLXContext (*glXCreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, int direct); + int (*glXMakeContextCurrent)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); void (*glXDestroyContext)(Display *dpy, GLXContext ctx); - int (*glXMakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx); void (*glXSwapBuffers)(Display *dpy, GLXDrawable drawable); + GLXFBConfig* (*glXChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems); + _XVisualInfo* (*glXGetVisualFromFBConfig)(Display *dpy, GLXFBConfig config); void (*glViewport)(int x, int y, int width, int height); void (*glScissor)(int x, int y, int width, int height); diff --git a/include/mgl/gl_macro.h b/include/mgl/gl_macro.h index 043d3f9..3141f78 100644 --- a/include/mgl/gl_macro.h +++ b/include/mgl/gl_macro.h @@ -1,23 +1,20 @@ #ifndef MGL_GL_MACRO_H #define MGL_GL_MACRO_H -#define GLX_USE_GL 1 -#define GLX_BUFFER_SIZE 2 -#define GLX_LEVEL 3 #define GLX_RGBA 4 #define GLX_DOUBLEBUFFER 5 #define GLX_STEREO 6 -#define GLX_AUX_BUFFERS 7 #define GLX_RED_SIZE 8 #define GLX_GREEN_SIZE 9 #define GLX_BLUE_SIZE 10 #define GLX_ALPHA_SIZE 11 #define GLX_DEPTH_SIZE 12 -#define GLX_STENCIL_SIZE 13 -#define GLX_ACCUM_RED_SIZE 14 -#define GLX_ACCUM_GREEN_SIZE 15 -#define GLX_ACCUM_BLUE_SIZE 16 -#define GLX_ACCUM_ALPHA_SIZE 17 + +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_RGBA_TYPE 0x8014 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_BLEND 0x0BE2 diff --git a/include/mgl/mgl.h b/include/mgl/mgl.h index 4cbc8d5..bd0ae5b 100644 --- a/include/mgl/mgl.h +++ b/include/mgl/mgl.h @@ -11,6 +11,7 @@ struct mgl_context { mgl_connection connection; mgl_gl gl; _XVisualInfo *visual_info; + GLXFBConfig fbconfig; unsigned long wm_delete_window_atom; unsigned long net_wm_ping_atom; unsigned long net_wm_pid_atom; -- cgit v1.2.3