diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-10 17:29:31 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-10 17:29:31 +0200 |
commit | 4aa7273eea642bff78477b0b220c7056628b13a8 (patch) | |
tree | 014430c208905164f99b37d663944192b8d6fd8c /src/mgl.c | |
parent | b81aff95e7924c38dbd1cf639011be1848af6967 (diff) |
Add texture loading (and render in test)
Diffstat (limited to 'src/mgl.c')
-rw-r--r-- | src/mgl.c | 27 |
1 files changed, 8 insertions, 19 deletions
@@ -1,25 +1,9 @@ #include "../include/mgl/mgl.h" #include <X11/Xutil.h> -#include <stdlib.h> #include <stdio.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 +#ifndef NDEBUG +#include <stdlib.h> +#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 }; |