From ca3e59106d6ab3cf0f75f5da72d944fe75844e5c Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 7 May 2007 21:21:28 +0000 Subject: [PATCH] call lock/unlock_draw() in SwapBuffers too. Don't set the view color to B_TRANSPARENT_32_BIT because it doesn't look good in direct mode. Korli, please review. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21062 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/opengl/GLView.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/kits/opengl/GLView.cpp b/src/kits/opengl/GLView.cpp index 7656f43db0..450db5e4e7 100644 --- a/src/kits/opengl/GLView.cpp +++ b/src/kits/opengl/GLView.cpp @@ -98,8 +98,11 @@ BGLView::SwapBuffers() void BGLView::SwapBuffers(bool vSync) { - if (fRenderer) + if (fRenderer) { + lock_draw(); fRenderer->SwapBuffers(vSync); + unlock_draw(); + } } @@ -177,9 +180,16 @@ BGLView::AttachedToWindow() fRenderer = fRoster->GetRenderer(); if (fRenderer) { + // Jackburton: The following code was commented because it doesn't look good in "direct" mode: + // when the window is moved, the app_server doesn't paint the view's background, and + // the stuff behind the window itself shows up. + // Setting the view color to black, instead, looks a bit more elegant. +#if 0 // Don't paint white window background when resized SetViewColor(B_TRANSPARENT_32_BIT); - +#else + SetViewColor(0, 0, 0); +#endif // Set default OpenGL viewport: glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); @@ -205,7 +215,7 @@ BGLView::AllAttached() BView::AllAttached(); } - + void BGLView::DetachedFromWindow() {