diff options
Diffstat (limited to 'src/graphics/backend/graphics.c')
-rw-r--r-- | src/graphics/backend/graphics.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/graphics/backend/graphics.c b/src/graphics/backend/graphics.c index 792894e..201b9e3 100644 --- a/src/graphics/backend/graphics.c +++ b/src/graphics/backend/graphics.c @@ -1,6 +1,7 @@ #include "../../../include/mgl/graphics/backend/graphics.h" #include "../../../include/mgl/graphics/backend/glx.h" #include "../../../include/mgl/graphics/backend/egl.h" +#include "../../../include/mgl/mgl.h" #include <string.h> @@ -24,7 +25,20 @@ void mgl_graphics_deinit(mgl_graphics *self) { } bool mgl_graphics_make_context_current(mgl_graphics *self, mgl_window_handle window) { - return self->make_context_current(self, window); + const bool result = self->make_context_current(self, window); + if(result) { + mgl_context *context = mgl_get_context(); + context->gl.glEnable(GL_TEXTURE_2D); + context->gl.glEnable(GL_BLEND); + context->gl.glEnable(GL_SCISSOR_TEST); + context->gl.glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + context->gl.glEnableClientState(GL_VERTEX_ARRAY); + context->gl.glEnableClientState(GL_TEXTURE_COORD_ARRAY); + context->gl.glEnableClientState(GL_COLOR_ARRAY); + context->gl.glPixelStorei(GL_PACK_ALIGNMENT, 1); + context->gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + } + return result; } void mgl_graphics_swap_buffers(mgl_graphics *self, mgl_window_handle window) { |