aboutsummaryrefslogtreecommitdiff
path: root/src/mgl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mgl.c')
-rw-r--r--src/mgl.c27
1 files changed, 8 insertions, 19 deletions
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 <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
};