From 4aa7273eea642bff78477b0b220c7056628b13a8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 10 Oct 2021 17:29:31 +0200 Subject: Add texture loading (and render in test) --- src/mgl.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'src/mgl.c') diff --git a/src/mgl.c b/src/mgl.c index 02ed363..cbdfb41 100644 --- a/src/mgl.c +++ b/src/mgl.c @@ -1,25 +1,9 @@ #include "../include/mgl/mgl.h" #include -#include #include - -#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 +#ifndef NDEBUG +#include +#endif static mgl_context context; static int init_count = 0; @@ -34,12 +18,17 @@ static int ignore_xerror(Display *display, XErrorEvent *ee) { static int glx_context_init() { const int attr[] = { GLX_RGBA, + GLX_BUFFER_SIZE, 24, GLX_DEPTH_SIZE, 0, GLX_STENCIL_SIZE, 0, GLX_RED_SIZE, 8, GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8, GLX_ALPHA_SIZE, 0, + GLX_ACCUM_RED_SIZE, 0, + GLX_ACCUM_GREEN_SIZE, 0, + GLX_ACCUM_BLUE_SIZE, 0, + GLX_ACCUM_ALPHA_SIZE, 0, GLX_DOUBLEBUFFER, /* TODO: Add option to turn this off? */ None }; -- cgit v1.2.3