From 4af6f994e85a14aa78c0adbc61e7e7b64da56165 Mon Sep 17 00:00:00 2001 From: saidwho12 <34974180+saidwho12@users.noreply.github.com> Date: Thu, 10 Oct 2019 15:28:50 -0400 Subject: [PATCH] Update main.c glViewport called before OpenGL loading causes SIGSEGV on linux. I moved it under glewInit() call. --- demo/sdl_opengl3/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/sdl_opengl3/main.c b/demo/sdl_opengl3/main.c index 9959d8ac..dfb22eb6 100644 --- a/demo/sdl_opengl3/main.c +++ b/demo/sdl_opengl3/main.c @@ -97,12 +97,12 @@ int main(void) SDL_GetWindowSize(win, &win_width, &win_height); /* OpenGL setup */ - glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT); glewExperimental = 1; if (glewInit() != GLEW_OK) { fprintf(stderr, "Failed to setup GLEW\n"); exit(1); } + glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT); ctx = nk_sdl_init(win); /* Load Fonts: if none of these are loaded a default font will be used */