clean up shutdown

This commit is contained in:
David Rose 2003-01-11 18:13:22 +00:00
parent 4c142c3a4a
commit 9ac12dbe92
2 changed files with 16 additions and 0 deletions

View File

@ -86,8 +86,10 @@ make_gsg() {
void wglGraphicsWindow::
release_gsg() {
if (_gsg != (GraphicsStateGuardian *)NULL) {
wglMakeCurrent(_hdc, _context);
GraphicsWindow::release_gsg();
wglDeleteContext(_context);
wglMakeCurrent(_hdc, NULL);
_context = (HGLRC)0;
}
}
@ -180,6 +182,19 @@ open_window() {
return true;
}
////////////////////////////////////////////////////////////////////
// Function: wglGraphicsWindow::close_window
// Access: Protected, Virtual
// Description: Closes the window right now. Called from the window
// thread.
////////////////////////////////////////////////////////////////////
void wglGraphicsWindow::
close_window() {
ReleaseDC(_mwindow, _hdc);
_hdc = (HDC)0;
WinGraphicsWindow::close_window();
}
////////////////////////////////////////////////////////////////////
// Function: wglGraphicsWindow::choose_pfnum
// Access: Private

View File

@ -40,6 +40,7 @@ public:
protected:
virtual bool open_window();
virtual void close_window();
private:
int choose_pfnum() const;