Kaydet (Commit) 73ca9a6b authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

init the OpenGL context in the windows backend

Change-Id: Ic4fb491c95170639015a4452f355354ad01612bc
üst dafa1c73
......@@ -164,6 +164,8 @@ public:
// only in vcl's platform code
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
bool init(Display* dpy, Window win, int screen);
#elif defined( _WIN32 )
bool init( HDC hDC, HWND hWnd );
#endif
void makeCurrent();
......
......@@ -513,6 +513,16 @@ bool OpenGLContext::init(Display* dpy, Window win, int screen)
return ImplInit();
}
#elif defined( _WIN32 )
bool OpenGLContext::init(HDC hDC, HWND hWnd)
{
if (mbInitialized)
return false;
m_aGLWin.hDC = hDC;
m_aGLWin.hWnd = hWnd;
return ImplInit();
}
#endif
bool OpenGLContext::ImplInit()
......@@ -524,7 +534,6 @@ bool OpenGLContext::ImplInit()
m_aGLWin.Height = 0;
#if defined( WNT )
m_aGLWin.hDC = GetDC(m_aGLWin.hWnd);
#elif defined( MACOSX )
#elif defined( IOS )
......@@ -778,6 +787,7 @@ bool OpenGLContext::initWindow()
m_aGLWin.hWnd = sysData->hWnd;
}
m_aGLWin.hDC = GetDC(m_aGLWin.hWnd);
return true;
}
......
......@@ -483,6 +483,12 @@ void WinSalGraphics::InitGraphics()
::SetTextAlign( getHDC(), TA_BASELINE | TA_LEFT | TA_NOUPDATECP );
::SetBkMode( getHDC(), WIN32_TRANSPARENT );
::SetROP2( getHDC(), R2_COPYPEN );
OpenGLSalGraphicsImpl* pImpl = dynamic_cast<OpenGLSalGraphicsImpl*>(mpImpl.get());
if (pImpl)
{
pImpl->GetOpenGLContext().init(mhLocalDC, mhWnd);
}
}
void WinSalGraphics::DeInitGraphics()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment