From 7096fa292a1044f4edfa627393cfde70e3ac8729 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 2 Aug 2019 21:42:07 +0200 Subject: Test: Configure GL in configure handler instead of main --- test/pugl_test.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/pugl_test.c b/test/pugl_test.c index 12ce529..0470586 100644 --- a/test/pugl_test.c +++ b/test/pugl_test.c @@ -48,6 +48,10 @@ onReshape(PuglView* view, int width, int height) { (void)view; + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + glClearColor(0.2f, 0.2f, 0.2f, 1.0f); + glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0, 0, width, height); @@ -188,12 +192,6 @@ main(int argc, char** argv) return 1; } - puglEnterContext(view, false); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - glClearColor(0.2f, 0.2f, 0.2f, 1.0f); - puglLeaveContext(view, false); - puglShowWindow(view); PuglFpsPrinter fpsPrinter = { puglGetTime(view) }; -- cgit v1.2.1