aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-08-02 21:42:07 +0200
committerDavid Robillard <d@drobilla.net>2019-08-02 23:28:15 +0200
commit7096fa292a1044f4edfa627393cfde70e3ac8729 (patch)
tree4cf8626149ac6841e1d916d8f893fdb2d2cfc4f8
parentb628c72193e068277ab4fbf0e6db9a572c43be46 (diff)
Test: Configure GL in configure handler instead of main
-rw-r--r--test/pugl_test.c10
1 files 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) };