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
This commit is contained in:
@@ -98,8 +98,11 @@ BGLView::SwapBuffers()
|
|||||||
void
|
void
|
||||||
BGLView::SwapBuffers(bool vSync)
|
BGLView::SwapBuffers(bool vSync)
|
||||||
{
|
{
|
||||||
if (fRenderer)
|
if (fRenderer) {
|
||||||
|
lock_draw();
|
||||||
fRenderer->SwapBuffers(vSync);
|
fRenderer->SwapBuffers(vSync);
|
||||||
|
unlock_draw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -177,9 +180,16 @@ BGLView::AttachedToWindow()
|
|||||||
|
|
||||||
fRenderer = fRoster->GetRenderer();
|
fRenderer = fRoster->GetRenderer();
|
||||||
if (fRenderer) {
|
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
|
// Don't paint white window background when resized
|
||||||
SetViewColor(B_TRANSPARENT_32_BIT);
|
SetViewColor(B_TRANSPARENT_32_BIT);
|
||||||
|
#else
|
||||||
|
SetViewColor(0, 0, 0);
|
||||||
|
#endif
|
||||||
// Set default OpenGL viewport:
|
// Set default OpenGL viewport:
|
||||||
glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight());
|
glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight());
|
||||||
|
|
||||||
@@ -205,7 +215,7 @@ BGLView::AllAttached()
|
|||||||
BView::AllAttached();
|
BView::AllAttached();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BGLView::DetachedFromWindow()
|
BGLView::DetachedFromWindow()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user