Index: ddraw/glDirectDraw.cpp |
— | — | @@ -643,7 +643,6 @@ |
644 | 644 | if(initialized)
|
645 | 645 | {
|
646 | 646 | RestoreDisplayMode();
|
647 | | - SetCooperativeLevel(hWnd, DDSCL_NORMAL);
|
648 | 647 | if(clippers)
|
649 | 648 | {
|
650 | 649 | for(int i = 0; i < clippercount; i++)
|
— | — | @@ -1404,7 +1403,6 @@ |
1405 | 1404 | d3ddesc = d3ddesc_default;
|
1406 | 1405 | d3ddesc3 = d3ddesc3_default;
|
1407 | 1406 | memcpy(stored_devices, d3ddevices, 3 * sizeof(D3DDevice));
|
1408 | | - winstyle = winstyleex = 0;
|
1409 | 1407 | initialized = true;
|
1410 | 1408 | TRACE_EXIT(23,DD_OK);
|
1411 | 1409 | return DD_OK;
|
— | — | @@ -1427,23 +1425,9 @@ |
1428 | 1426 | if(hWnd && !IsWindow(hWnd)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1429 | 1427 | if ((dwFlags & DDSCL_EXCLUSIVE) && !hWnd) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
1430 | 1428 | if(dwFlags & 0xFFFFE020) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1431 | | - if (((hWnd != this->hWnd) && this->hWnd) || (this->hWnd && (dwFlags & DDSCL_NORMAL)))
|
1432 | | - {
|
1433 | | - if (winstyle)
|
1434 | | - {
|
1435 | | - SetWindowLongPtrA(hWnd, GWL_STYLE, winstyle);
|
1436 | | - SetWindowLongPtrA(hWnd, GWL_EXSTYLE, winstyleex);
|
1437 | | - ShowWindow(hWnd, SW_RESTORE);
|
1438 | | - winstyle = winstyleex = 0;
|
1439 | | - SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
1440 | | - }
|
1441 | | - }
|
1442 | 1429 | this->hWnd = hWnd;
|
1443 | | - if (!winstyle && !winstyleex)
|
1444 | | - {
|
1445 | | - winstyle = GetWindowLongPtrA(hWnd, GWL_STYLE);
|
1446 | | - winstyleex = GetWindowLongPtrA(hWnd, GWL_EXSTYLE);
|
1447 | | - }
|
| 1430 | + winstyle = GetWindowLongPtrA(hWnd,GWL_STYLE);
|
| 1431 | + winstyleex = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
|
1448 | 1432 | bool exclusive = false;
|
1449 | 1433 | devwnd = false;
|
1450 | 1434 | if(dwFlags & DDSCL_ALLOWMODEX)
|
— | — | @@ -1512,14 +1496,7 @@ |
1513 | 1497 | bpp = devmode.dmBitsPerPel;
|
1514 | 1498 | internalrefresh = primaryrefresh = screenrefresh = devmode.dmDisplayFrequency;
|
1515 | 1499 | primarybpp = bpp;
|
1516 | | - if (fullscreen)
|
1517 | | - {
|
1518 | | - SetWindowLongPtrA(hWnd, GWL_EXSTYLE, winstyleex & ~(WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE));
|
1519 | | - SetWindowLongPtrA(hWnd, GWL_STYLE, (winstyle | WS_POPUP | WS_SYSMENU) & ~(WS_CAPTION | WS_THICKFRAME));
|
1520 | | - ShowWindow(hWnd, SW_MAXIMIZE);
|
1521 | | - }
|
1522 | | - SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
1523 | | - InitGL(x, y, bpp, fullscreen, internalrefresh, hWnd, this, devwnd);
|
| 1500 | + InitGL(x,y,bpp,fullscreen,internalrefresh,hWnd,this,devwnd);
|
1524 | 1501 | cooplevel = dwFlags;
|
1525 | 1502 | TRACE_EXIT(23,DD_OK);
|
1526 | 1503 | return DD_OK;
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -217,6 +217,17 @@ |
218 | 218 | InitializeCriticalSection(&This->cs);
|
219 | 219 | This->busy = CreateEvent(NULL,FALSE,FALSE,NULL);
|
220 | 220 | This->start = CreateEvent(NULL,FALSE,FALSE,NULL);
|
| 221 | + if(fullscreen)
|
| 222 | + {
|
| 223 | + SetWindowLongPtrA(This->hWnd,GWL_EXSTYLE,WS_EX_APPWINDOW);
|
| 224 | + SetWindowLongPtrA(This->hWnd,GWL_STYLE,WS_OVERLAPPED);
|
| 225 | + ShowWindow(This->hWnd,SW_MAXIMIZE);
|
| 226 | + }
|
| 227 | + if(width)
|
| 228 | + {
|
| 229 | + // TODO: Adjust window rect
|
| 230 | + }
|
| 231 | + SetWindowPos(This->hWnd,HWND_TOP,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
221 | 232 | This->RenderWnd = new glRenderWindow(width,height,fullscreen,This->hWnd,glDD7,devwnd);
|
222 | 233 | This->inputs[0] = (void*)width;
|
223 | 234 | This->inputs[1] = (void*)height;
|
— | — | @@ -565,6 +576,12 @@ |
566 | 577 | void glRenderer_SetWnd(glRenderer *This, int width, int height, int bpp, int fullscreen, unsigned int frequency, HWND newwnd, BOOL devwnd)
|
567 | 578 | {
|
568 | 579 | EnterCriticalSection(&This->cs);
|
| 580 | + if(fullscreen && newwnd)
|
| 581 | + {
|
| 582 | + SetWindowLongPtrA(newwnd,GWL_EXSTYLE,WS_EX_APPWINDOW);
|
| 583 | + SetWindowLongPtrA(newwnd,GWL_STYLE,WS_OVERLAPPED);
|
| 584 | + ShowWindow(newwnd,SW_MAXIMIZE);
|
| 585 | + }
|
569 | 586 | This->inputs[0] = (void*)width;
|
570 | 587 | This->inputs[1] = (void*)height;
|
571 | 588 | This->inputs[2] = (void*)bpp;
|