MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ddgr_gdi_Close

Function ddgr_gdi_Close

dd_grwin32/ddgrWin32GDI.cpp:159–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157// Deinitialized GDI objects
158
159void ddgr_gdi_Close() {
160 if (GDI_DATA(hOffscreenDC)) {
161 DeleteDC(GDI_DATA(hOffscreenDC));
162 }
163
164 if (GDI_DATA(fullscreen)) {
165 if (GDI_DATA(ddraw)) {
166 // For full screen, deinitialize directdraw/
167 if (GDI_DATA(lpDD)) {
168 GDI_DATA(lpDD)->RestoreDisplayMode();
169 GDI_DATA(lpDD)->Release();
170 }
171 GDI_DATA(lpDD) = NULL;
172 } else {
173 // do a ChangeDisplaySettings to old mode.
174 LONG lres;
175 GDI_DATA(devmodes[GDI_DATA(olddispmode)]).dmFields =
176 DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY;
177
178 lres = ChangeDisplaySettings(&GDI_DATA(devmodes[GDI_DATA(olddispmode)]), 0);
179 ASSERT(lres == DISP_CHANGE_SUCCESSFUL);
180 }
181 }
182
183 GDI_DATA(hPrimaryWnd) = NULL;
184 GDI_DATA(init) = false;
185
186 mprintf(0, "GDI system closed.\n");
187}
188
189// ---------------------------------------------------------------------------
190// Initializes the video surface for blting

Callers 1

ddgr_CloseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected