summaryrefslogtreecommitdiffstats
path: root/src/hgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/hgl')
-rw-r--r--src/hgl/GLView.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hgl/GLView.cpp b/src/hgl/GLView.cpp
index 9ae5b5c83ac..9e01dcc2c60 100644
--- a/src/hgl/GLView.cpp
+++ b/src/hgl/GLView.cpp
@@ -51,6 +51,7 @@ BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode,
fDitherMap(NULL)
{
fRoster = new GLRendererRoster(this, options);
+ fRenderer = fRoster->GetRenderer();
}
@@ -68,7 +69,7 @@ BGLView::LockGL()
// TODO: acquire the OpenGL API lock it on this glview
fDisplayLock.Lock();
- if (fRenderer)
+ if (fRenderer != NULL && fDisplayLock.CountLocks() == 1)
fRenderer->LockGL();
}
@@ -76,7 +77,7 @@ BGLView::LockGL()
void
BGLView::UnlockGL()
{
- if (fRenderer)
+ if (fRenderer != NULL && fDisplayLock.CountLocks() == 1)
fRenderer->UnlockGL();
fDisplayLock.Unlock();
@@ -189,7 +190,6 @@ BGLView::AttachedToWindow()
for (BView* view = this; view != NULL; view = view->Parent())
view->ConvertToParent(&fBounds);
- fRenderer = fRoster->GetRenderer();
if (fRenderer != NULL) {
// Jackburton: The following code was commented because it doesn't look
// good in "direct" mode: