OPENGL: Add notification function about context destruction.
This commit is contained in:
parent
602d3034a9
commit
8be41e4f2c
2 changed files with 28 additions and 0 deletions
|
@ -881,6 +881,26 @@ void OpenGLGraphicsManager::notifyContextChange(const Graphics::PixelFormat &def
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OpenGLGraphicsManager::notifyContextDestroy() {
|
||||||
|
if (_gameScreen) {
|
||||||
|
_gameScreen->releaseInternalTexture();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_overlay) {
|
||||||
|
_overlay->releaseInternalTexture();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_cursor) {
|
||||||
|
_cursor->releaseInternalTexture();
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OSD
|
||||||
|
if (_osd) {
|
||||||
|
_osd->releaseInternalTexture();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) {
|
void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) {
|
||||||
if (_overlayVisible) {
|
if (_overlayVisible) {
|
||||||
// It might be confusing that we actually have to handle something
|
// It might be confusing that we actually have to handle something
|
||||||
|
|
|
@ -136,6 +136,14 @@ protected:
|
||||||
*/
|
*/
|
||||||
void notifyContextChange(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha);
|
void notifyContextChange(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notify the manager that the OpenGL context is about to be destroyed.
|
||||||
|
* This will free up/reset internal OpenGL related state and *must* be
|
||||||
|
* called whenever a context might be created again after destroying a
|
||||||
|
* context.
|
||||||
|
*/
|
||||||
|
void notifyContextDestroy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjust the physical mouse coordinates according to the currently visible screen.
|
* Adjust the physical mouse coordinates according to the currently visible screen.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue