From 14716b59eedd024453c5d904a619d63a0f0fed85 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 2 Apr 2013 16:15:15 +0200 Subject: [PATCH] Explicitly set clear color --- gltest.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gltest.cpp b/gltest.cpp index ed45ac6..feb794f 100644 --- a/gltest.cpp +++ b/gltest.cpp @@ -99,15 +99,16 @@ protected: virtual void resizeGL(unsigned int width, unsigned int height) { - /* prevent divide-by-zero */ - if (height == 0) - height = 1; + // prevent divide-by-zero + if (height == 0) + height = 1; glViewport(0, 0, width, height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); glOrtho (0, 1, 1, 0, 0, 1); - glMatrixMode(GL_MODELVIEW); - glClear(GL_COLOR_BUFFER_BIT); + glMatrixMode(GL_MODELVIEW); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glClear(GL_COLOR_BUFFER_BIT); glFlush(); } -- 2.30.2