summaryrefslogtreecommitdiff
path: root/vcl/opengl/win
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-22 07:58:38 -0500
committerJan Holesovsky <kendy@collabora.com>2014-11-22 20:14:19 +0100
commite26237f6cbc0d499c91aa32c3bea1f9daee6578e (patch)
treed592bb8b6e516f5cf05ac5cc98bdbe1d0a9fcf9a /vcl/opengl/win
parent90af2a6c403e7f6e5192d54f69b38b85a9e6fbc8 (diff)
vcl: Always use the same OpenGL context when drawing in a window
Change-Id: Ief0e947149c133aaa8e81973e088c4df6432bfdc
Diffstat (limited to 'vcl/opengl/win')
-rw-r--r--vcl/opengl/win/gdiimpl.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 18e0da860e6b..08159278f576 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -68,4 +68,34 @@ GLfloat WinOpenGLSalGraphicsImpl::GetHeight() const
return 1;
}
+bool WinOpenGLSalGraphicsImpl::IsOffscreen() const
+{
+ WinSalFrame* pFrame = GetWindowPtr( mrParent.gethWnd() );
+ return ( pFrame == NULL );
+}
+
+OpenGLContext* WinOpenGLSalGraphicsImpl::CreateWinContext()
+{
+ OpenGLContext* pContext = new OpenGLContext();
+ pContext->requestSingleBufferedRendering();
+ pContext->init( mrParent.mhLocalDC, mrParent.mhWnd );
+ return pContext;
+}
+
+bool WinOpenGLSalGraphicsImpl::CompareWinContext( OpenGLContext* pContext )
+{
+ if( !pContext || !pContext->isInitialized() )
+ return false;
+ return ( pContext->getOpenGLWindow().hWnd == mrParent.mhWnd );
+}
+
+OpenGLContext* WinOpenGLSalGraphicsImpl::CreatePixmapContext()
+{
+ OpenGLContext* pContext = new OpenGLContext();
+ pContext->requestVirtualDevice();
+ pContext->requestSingleBufferedRendering();
+ pContext->init( mrParent.mhLocalDC, mrParent.mhWnd );
+ return pContext;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */