graphics

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 2476a9ce72ee0b59087df21baaa4c439235d9dc8
parent f3b08ddd7c7ad2acf03bb8c8ef49047f1922d721
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun, 15 Sep 2013 05:31:47 -0700

hello: don't rely on app to clear framebuffer and enable depthtest

Diffstat:
Mhello/hello.cc | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hello/hello.cc b/hello/hello.cc @@ -165,6 +165,9 @@ void TestApp::onKeyUp(unsigned code) { void TestApp::render(void) { int update = 0; + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glEnable(GL_DEPTH_TEST); + if (mouseBTN & 1) { float dx = ((float) mouseDX) / 400.0f; float dy = ((float) mouseDY) / 400.0f; @@ -236,7 +239,6 @@ void TestApp::render(void) { glEnable(GL_BLEND); text.render(); glDisable(GL_BLEND); - glEnable(GL_DEPTH_TEST); } App *createApp(void) {