summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/main.c b/main.c
index 35f55bc..66f4395 100644
--- a/main.c
+++ b/main.c
@@ -28,7 +28,7 @@
#define EVENT_CODE_TIMER 0
// use compute shader to update particles?
-#define USE_COMPUTE_SHADER false
+#define USE_COMPUTE_SHADER true
// enable gl debug
#define USE_GL_DEBUG false
@@ -78,7 +78,9 @@ verts[] = {
static const char
cs_src[] =
"#version 320 es\n"
- // "#pragma debug(on)\n"
+#if USE_GL_DEBUG
+ "#pragma debug(on)\n"
+#endif /* USE_GL_DEBUG */
"\n"
"layout(local_size_x = " S(WORKGROUP_SIZE) ") in;\n"
"\n"
@@ -397,6 +399,14 @@ ctx_init(context_t * const ctx) {
exit(EXIT_FAILURE);
}
+ if (USE_GL_DEBUG) {
+ // set debug context
+ if (SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG) < 0) {
+ LOG_C("SDL_GL_SetAttribute() failed: %s", SDL_GetError());
+ exit(EXIT_FAILURE);
+ }
+ }
+
// create GL context
SDL_GLContext context = SDL_GL_CreateContext(ctx->win);
if (!context) {