diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gl.c | 4 | ||||
-rw-r--r-- | src/window.c | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -1,6 +1,6 @@ #include "../include/mgl/gl.h" #include <dlfcn.h> -/*#include <GL/glx.h>*/ +/*#include <GL/gl.h>*/ #include <stdio.h> typedef struct { @@ -37,6 +37,8 @@ int mgl_gl_load(mgl_gl *self) { { &self->glViewport, "glViewport" }, { &self->glClearColor, "glClearColor" }, { &self->glClear, "glClear" }, + { &self->glEnable, "glEnable" }, + { &self->glBlendFunc, "glBlendFunc" }, { NULL, NULL } }; diff --git a/src/window.c b/src/window.c index bdbcd6f..4d877d7 100644 --- a/src/window.c +++ b/src/window.c @@ -4,6 +4,9 @@ #include <stdio.h> #define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_BLEND 0x0BE2 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 int mgl_window_create(mgl_window *self, const char *title, int width, int height, mgl_window_callback *callback, void *userdata) { return mgl_window_create_with_params(self, title, width, height, DefaultRootWindow(mgl_get_context()->connection), callback, userdata); @@ -80,6 +83,8 @@ void mgl_window_show(mgl_window *self) { /* TODO: Switch current when rendering to another window, and set current to NULL when destroying the currently selected context */ context->gl.glXMakeCurrent(context->connection, self->window, context->glx_context); set_vertical_sync_enabled(self->window, 1); + context->gl.glEnable(GL_BLEND); + context->gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); mgl_window_draw(self); } |