mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
release exclusive mode when window is closed
This commit is contained in:
parent
4ceb93f312
commit
2ceb53166f
@ -167,6 +167,15 @@ make_gsg() {
|
|||||||
void wdxGraphicsWindow7::
|
void wdxGraphicsWindow7::
|
||||||
release_gsg() {
|
release_gsg() {
|
||||||
if (_gsg != (GraphicsStateGuardian *)NULL) {
|
if (_gsg != (GraphicsStateGuardian *)NULL) {
|
||||||
|
|
||||||
|
if (is_fullscreen()) {
|
||||||
|
// Release the cooperative level we grabbed when we created the
|
||||||
|
// GSG.
|
||||||
|
DXScreenData *pScrn = &_dxgsg->scrn;
|
||||||
|
nassertv(pScrn != (DXScreenData *)NULL);
|
||||||
|
pScrn->pDD->SetCooperativeLevel(_mwindow, DDSCL_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
GraphicsWindow::release_gsg();
|
GraphicsWindow::release_gsg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -498,7 +507,7 @@ create_screen_buffers_and_device(DXScreenData &Display, bool force_16bpp_zbuffer
|
|||||||
|
|
||||||
PRINTVIDMEM(pDD, &ddsd.ddsCaps, "initial primary & backbuf");
|
PRINTVIDMEM(pDD, &ddsd.ddsCaps, "initial primary & backbuf");
|
||||||
|
|
||||||
// Create the primary surface
|
// Create the primary surface for the fullscreen window
|
||||||
hr = pDD->CreateSurface(&ddsd, &pPrimaryDDSurf, NULL);
|
hr = pDD->CreateSurface(&ddsd, &pPrimaryDDSurf, NULL);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
wdxdisplay7_cat.fatal()
|
wdxdisplay7_cat.fatal()
|
||||||
@ -619,8 +628,8 @@ create_screen_buffers_and_device(DXScreenData &Display, bool force_16bpp_zbuffer
|
|||||||
|
|
||||||
PRINTVIDMEM(pDD, &SurfaceDesc.ddsCaps, "initial primary surface");
|
PRINTVIDMEM(pDD, &SurfaceDesc.ddsCaps, "initial primary surface");
|
||||||
|
|
||||||
// Create the primary surface. This includes all of the visible
|
// Create the primary surface for windowed mode. This includes
|
||||||
// window, so no need to specify height/width
|
// all of the visible window, so no need to specify height/width.
|
||||||
hr = pDD->CreateSurface(&SurfaceDesc, &pPrimaryDDSurf, NULL);
|
hr = pDD->CreateSurface(&SurfaceDesc, &pPrimaryDDSurf, NULL);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
wdxdisplay7_cat.fatal()
|
wdxdisplay7_cat.fatal()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user