Fix offscreen rendering mode

This commit is contained in:
kaetemi 2014-12-09 23:06:08 +01:00
parent be11582a17
commit 055a225778

View file

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