From 9524dfebea9694b0650ecebf962bb1d1102ee187 Mon Sep 17 00:00:00 2001 From: vurtun Date: Wed, 25 Mar 2015 18:43:54 +0100 Subject: [PATCH] removed platform depended compiler flag --- Makefile | 2 +- opengl.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 414c1ef0..e52844be 100644 --- a/Makefile +++ b/Makefile @@ -31,5 +31,5 @@ clang: $(BIN) $(BIN): @mkdir -p bin rm -f bin/$(BIN) $(OBJS) - $(CC) $(SRC) -D_POSIX_C_SOURCE=200809L $(CFLAGS) -o bin/$(BIN) -lSDL2 -lGL -lGLU + $(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) -lSDL2 -lGL -lGLU diff --git a/opengl.c b/opengl.c index c7828792..41799c3b 100644 --- a/opengl.c +++ b/opengl.c @@ -15,14 +15,12 @@ #include "gui.h" /* macros */ -#define WIN_WIDTH 800 -#define WIN_HEIGHT 600 -#define DTIME 33 -#define MAX_BUFFER (256 * 1024) +#define UNUSED(v) (void)v +#define WIN_WIDTH 600 +#define WIN_HEIGHT 400 +#define MAX_BUFFER (64 * 1024) #define MAX_PANELS 4 - -#define LEN(a)(sizeof(a)/sizeof(a)[0]) -#define UNUSED(a)((void)(a)) +#define DTIME 33 /* functions */ static void die(const char*,...); @@ -382,7 +380,7 @@ main(int argc, char *argv[]) panel = gui_panel_new(ctx, 20, 20, 200, 200, &config, font); subpanel = gui_panel_new(ctx, 250, 20, 200, 200, &config, font); - running = 1; + running = gui_true; while (running) { SDL_Event ev; started = SDL_GetTicks(); @@ -396,9 +394,9 @@ main(int argc, char *argv[]) else if (ev.type == SDL_KEYUP) krelease(&input, &ev); } gui_input_end(&input); + SDL_GetWindowSize(win, &width, &height); /* ------------------------- GUI --------------------------*/ - SDL_GetWindowSize(win, &width, &height); gui_begin(ctx, (gui_float)width, (gui_float)height); running = gui_begin_panel(ctx, panel, "Demo", GUI_PANEL_HEADER|GUI_PANEL_CLOSEABLE|GUI_PANEL_MINIMIZABLE|