Fix offscreen rendering mode

--HG--
branch : develop
This commit is contained in:
kaetemi 2014-12-09 23:06:08 +01:00
parent 6db29c375a
commit 58590a9e7e

View file

@ -627,9 +627,11 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
// Offscreen mode ?
if (_CurrentMode.OffScreen)
{
#if 0
if (!createWindow(mode))
return false;
HWND tmpHWND = _win;
int width = mode.Width;
int height = mode.Height;
// resize the window
RECT rc;
@ -908,7 +910,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
_hDC = NULL;
return false;
}
#endif
}
else
{
@ -1437,8 +1438,17 @@ bool CDriverGL::createWindow(const GfxMode &mode)
#ifdef NL_OS_WINDOWS
// create the OpenGL window
window = CreateWindowW(L"NLClass", L"NeL Window", WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,
CW_USEDEFAULT, CW_USEDEFAULT, mode.Width, mode.Height, HWND_DESKTOP, NULL, GetModuleHandle(NULL), NULL);
DWORD dwStyle = WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
int pos = CW_USEDEFAULT;
HWND hwndParent = HWND_DESKTOP;
if (mode.OffScreen)
{
dwStyle &= ~WS_VISIBLE;
pos = 0;
hwndParent = NULL;
}
window = CreateWindowW(L"NLClass", L"NeL Window", dwStyle,
pos, pos, mode.Width, mode.Height, hwndParent, NULL, GetModuleHandle(NULL), NULL);
if (window == EmptyWindow)
{