aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp149
-rw-r--r--backends/graphics/opengl/opengl-graphics.h35
-rw-r--r--backends/graphics/opengl/texture.cpp17
-rw-r--r--backends/graphics/opengl/texture.h2
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp39
-rw-r--r--backends/mixer/sdl/sdl-mixer.cpp10
-rw-r--r--backends/platform/sdl/sdl.cpp8
-rw-r--r--backends/platform/tizen/graphics.cpp3
8 files changed, 180 insertions, 83 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index a97f680f15..0a034128fe 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -265,21 +265,15 @@ OSystem::TransactionError OpenGLGraphicsManager::endGFXTransaction() {
delete _gameScreen;
_gameScreen = nullptr;
- GLenum glIntFormat, glFormat, glType;
#ifdef USE_RGB_COLOR
- if (_currentState.gameFormat.bytesPerPixel == 1) {
+ _gameScreen = createTexture(_currentState.gameFormat);
+#else
+ _gameScreen = createTexture(Graphics::PixelFormat::createFormatCLUT8());
#endif
- const bool supported = getGLPixelFormat(_defaultFormat, glIntFormat, glFormat, glType);
- assert(supported);
- _gameScreen = new TextureCLUT8(glIntFormat, glFormat, glType, _defaultFormat);
- _gameScreen->setPalette(0, 255, _gamePalette);
-#ifdef USE_RGB_COLOR
- } else {
- const bool supported = getGLPixelFormat(_currentState.gameFormat, glIntFormat, glFormat, glType);
- assert(supported);
- _gameScreen = new Texture(glIntFormat, glFormat, glType, _currentState.gameFormat);
+ assert(_gameScreen);
+ if (_gameScreen->hasPalette()) {
+ _gameScreen->setPalette(0, 256, _gamePalette);
}
-#endif
_gameScreen->allocate(_currentState.gameWidth, _currentState.gameHeight);
_gameScreen->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR);
@@ -359,15 +353,7 @@ void OpenGLGraphicsManager::updateScreen() {
const GLfloat shakeOffset = _gameScreenShakeOffset * (GLfloat)_displayHeight / _gameScreen->getHeight();
// First step: Draw the (virtual) game screen.
- glPushMatrix();
-
- // Adjust game screen shake position
- GLCALL(glTranslatef(0, shakeOffset, 0));
-
- // Draw the game screen
- _gameScreen->draw(_displayX, _displayY, _displayWidth, _displayHeight);
-
- glPopMatrix();
+ _gameScreen->draw(_displayX, _displayY + shakeOffset, _displayWidth, _displayHeight);
// Second step: Draw the overlay if visible.
if (_overlayVisible) {
@@ -376,18 +362,12 @@ void OpenGLGraphicsManager::updateScreen() {
// Third step: Draw the cursor if visible.
if (_cursorVisible && _cursor) {
- glPushMatrix();
-
// Adjust game screen shake position, but only when the overlay is not
// visible.
- if (!_overlayVisible) {
- GLCALL(glTranslatef(0, shakeOffset, 0));
- }
+ const GLfloat cursorOffset = _overlayVisible ? 0 : shakeOffset;
- _cursor->draw(_cursorX - _cursorHotspotXScaled, _cursorY - _cursorHotspotYScaled,
+ _cursor->draw(_cursorX - _cursorHotspotXScaled, _cursorY - _cursorHotspotYScaled + cursorOffset,
_cursorWidthScaled, _cursorHeightScaled);
-
- glPopMatrix();
}
#ifdef USE_OSD
@@ -566,27 +546,19 @@ void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int
GLenum glIntFormat, glFormat, glType;
- if (inputFormat.bytesPerPixel == 1) {
- // In case this is not supported this is a serious programming
- // error and the assert a bit below will trigger!
- const bool supported = getGLPixelFormat(_defaultFormatAlpha, glIntFormat, glFormat, glType);
- assert(supported);
- _cursor = new TextureCLUT8(glIntFormat, glFormat, glType, _defaultFormatAlpha);
+ Graphics::PixelFormat textureFormat;
+ if (inputFormat.bytesPerPixel == 1 || (inputFormat.aBits() && getGLPixelFormat(inputFormat, glIntFormat, glFormat, glType))) {
+ // There is two cases when we can use the cursor format directly.
+ // The first is when it's CLUT8, here color key handling can
+ // always be applied because we use the alpha channel of
+ // _defaultFormatAlpha for that.
+ // The other is when the input format has alpha bits and
+ // furthermore is directly supported.
+ textureFormat = inputFormat;
} else {
- // Try to use the format specified as input directly. We can only
- // do so when it actually has alpha bits.
- if (inputFormat.aBits() != 0 && getGLPixelFormat(inputFormat, glIntFormat, glFormat, glType)) {
- _cursor = new Texture(glIntFormat, glFormat, glType, inputFormat);
- }
-
- // Otherwise fall back to the default alpha format.
- if (!_cursor) {
- const bool supported = getGLPixelFormat(_defaultFormatAlpha, glIntFormat, glFormat, glType);
- assert(supported);
- _cursor = new Texture(glIntFormat, glFormat, glType, _defaultFormatAlpha);
- }
+ textureFormat = _defaultFormatAlpha;
}
-
+ _cursor = createTexture(textureFormat, true);
assert(_cursor);
_cursor->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR);
}
@@ -778,10 +750,8 @@ void OpenGLGraphicsManager::setActualScreenSize(uint width, uint height) {
delete _overlay;
_overlay = nullptr;
- GLenum glIntFormat, glFormat, glType;
- const bool supported = getGLPixelFormat(_defaultFormatAlpha, glIntFormat, glFormat, glType);
- assert(supported);
- _overlay = new Texture(glIntFormat, glFormat, glType, _defaultFormatAlpha);
+ _overlay = createTexture(_defaultFormatAlpha);
+ assert(_overlay);
// We always filter the overlay with GL_LINEAR. This assures it's
// readable in case it needs to be scaled and does not affect it
// otherwise.
@@ -795,10 +765,8 @@ void OpenGLGraphicsManager::setActualScreenSize(uint width, uint height) {
delete _osd;
_osd = nullptr;
- GLenum glIntFormat, glFormat, glType;
- const bool supported = getGLPixelFormat(_defaultFormatAlpha, glIntFormat, glFormat, glType);
- assert(supported);
- _osd = new Texture(glIntFormat, glFormat, glType, _defaultFormatAlpha);
+ _osd = createTexture(_defaultFormatAlpha);
+ assert(_osd);
// We always filter the osd with GL_LINEAR. This assures it's
// readable in case it needs to be scaled and does not affect it
// otherwise.
@@ -816,7 +784,7 @@ void OpenGLGraphicsManager::setActualScreenSize(uint width, uint height) {
++_screenChangeID;
}
-void OpenGLGraphicsManager::notifyContextChange(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha) {
+void OpenGLGraphicsManager::notifyContextCreate(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha) {
// Initialize all extensions.
initializeGLExtensions();
@@ -881,6 +849,26 @@ void OpenGLGraphicsManager::notifyContextChange(const Graphics::PixelFormat &def
#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) {
if (_overlayVisible) {
// It might be confusing that we actually have to handle something
@@ -909,11 +897,35 @@ void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) {
}
}
+Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &format, bool wantAlpha) {
+ GLenum glIntFormat, glFormat, glType;
+ if (format.bytesPerPixel == 1) {
+ const Graphics::PixelFormat &virtFormat = wantAlpha ? _defaultFormatAlpha : _defaultFormat;
+ const bool supported = getGLPixelFormat(virtFormat, glIntFormat, glFormat, glType);
+ if (!supported) {
+ return nullptr;
+ } else {
+ return new TextureCLUT8(glIntFormat, glFormat, glType, virtFormat);
+ }
+ } else {
+ const bool supported = getGLPixelFormat(format, glIntFormat, glFormat, glType);
+ if (!supported) {
+ return nullptr;
+ } else {
+ return new Texture(glIntFormat, glFormat, glType, format);
+ }
+ }
+}
+
bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const {
+#ifdef SCUMM_LITTLE_ENDIAN
+ if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888
+#else
if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888
+#endif
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
- glType = GL_UNSIGNED_INT_8_8_8_8;
+ glType = GL_UNSIGNED_BYTE;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565
glIntFormat = GL_RGB;
@@ -931,6 +943,13 @@ bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelF
glType = GL_UNSIGNED_SHORT_4_4_4_4;
return true;
#ifndef USE_GLES
+#ifdef SCUMM_LITTLE_ENDIAN
+ } else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888
+ glIntFormat = GL_RGBA;
+ glFormat = GL_RGBA;
+ glType = GL_UNSIGNED_INT_8_8_8_8;
+ return true;
+#endif
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555
// GL_BGRA does not exist in every GLES implementation so should not be configured if
// USE_GLES is set.
@@ -948,11 +967,13 @@ bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelF
glFormat = GL_BGRA;
glType = GL_UNSIGNED_SHORT_4_4_4_4_REV;
return true;
+#ifdef SCUMM_BIG_ENDIAN
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_INT_8_8_8_8_REV;
return true;
+#endif
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0)) { // BGRA8888
glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
@@ -1064,14 +1085,14 @@ void OpenGLGraphicsManager::recalculateCursorScaling() {
// In case scaling is actually enabled we will scale the cursor according
// to the game screen.
if (!_cursorDontScale) {
- const uint screenScaleFactorX = _displayWidth * 10000 / _gameScreen->getWidth();
- const uint screenScaleFactorY = _displayHeight * 10000 / _gameScreen->getHeight();
+ const frac_t screenScaleFactorX = intToFrac(_displayWidth) / _gameScreen->getWidth();
+ const frac_t screenScaleFactorY = intToFrac(_displayHeight) / _gameScreen->getHeight();
- _cursorHotspotXScaled = (_cursorHotspotXScaled * screenScaleFactorX) / 10000;
- _cursorWidthScaled = (_cursorWidthScaled * screenScaleFactorX) / 10000;
+ _cursorHotspotXScaled = fracToInt(_cursorHotspotXScaled * screenScaleFactorX);
+ _cursorWidthScaled = fracToInt(_cursorWidthScaled * screenScaleFactorX);
- _cursorHotspotYScaled = (_cursorHotspotYScaled * screenScaleFactorY) / 10000;
- _cursorHeightScaled = (_cursorHeightScaled * screenScaleFactorY) / 10000;
+ _cursorHotspotYScaled = fracToInt(_cursorHotspotYScaled * screenScaleFactorY);
+ _cursorHeightScaled = fracToInt(_cursorHeightScaled * screenScaleFactorY);
}
}
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 93c0c5bc83..d16f92d148 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -127,14 +127,22 @@ protected:
/**
* Notify the manager of a OpenGL context change. This should be the first
- * thing to call when you create an OpenGL (ES) context!
+ * thing to call after you created an OpenGL (ES) context!
*
* @param defaultFormat The new default format for the game screen
* (this is used for the CLUT8 game screens).
* @param defaultFromatAlpha The new default format with an alpha channel
* (this is used for the overlay and cursor).
*/
- void notifyContextChange(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha);
+ void notifyContextCreate(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.
@@ -163,6 +171,17 @@ protected:
virtual void setInternalMousePosition(int x, int y) = 0;
private:
+ /**
+ * Create a texture with the specified pixel format.
+ *
+ * @param format The pixel format the Texture object should accept as
+ * input.
+ * @param wantAlpha For CLUT8 textures this marks whether an alpha
+ * channel should be used.
+ * @return A pointer to the texture or nullptr on failure.
+ */
+ Texture *createTexture(const Graphics::PixelFormat &format, bool wantAlpha = false);
+
//
// Transaction support
//
@@ -367,22 +386,22 @@ private:
/**
* X coordinate of the cursor in phyiscal coordinates.
*/
- uint _cursorX;
+ int _cursorX;
/**
* Y coordinate of the cursor in physical coordinates.
*/
- uint _cursorY;
+ int _cursorY;
/**
* The X offset for the cursor hotspot in unscaled coordinates.
*/
- uint _cursorHotspotX;
+ int _cursorHotspotX;
/**
* The Y offset for the cursor hotspot in unscaled coordinates.
*/
- uint _cursorHotspotY;
+ int _cursorHotspotY;
/**
* Recalculate the cursor scaling. Scaling is always done according to
@@ -393,12 +412,12 @@ private:
/**
* The X offset for the cursor hotspot in scaled coordinates.
*/
- uint _cursorHotspotXScaled;
+ int _cursorHotspotXScaled;
/**
* The Y offset for the cursor hotspot in scaled coordinates.
*/
- uint _cursorHotspotYScaled;
+ int _cursorHotspotYScaled;
/**
* The width of the cursor scaled coordinates.
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp
index 8f17ed7eeb..7b0b22d630 100644
--- a/backends/graphics/opengl/texture.cpp
+++ b/backends/graphics/opengl/texture.cpp
@@ -65,6 +65,9 @@ void Texture::releaseInternalTexture() {
}
void Texture::recreateInternalTexture() {
+ // Release old texture name in case it exists.
+ releaseInternalTexture();
+
// Get a new texture name.
GLCALL(glGenTextures(1, &_glTexture));
@@ -163,7 +166,7 @@ void Texture::fill(uint32 color) {
flagDirty();
}
-void Texture::draw(GLuint x, GLuint y, GLuint w, GLuint h) {
+void Texture::draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
// Only do any processing when the Texture is initialized.
if (!_textureData.getPixels()) {
return;
@@ -187,13 +190,13 @@ void Texture::draw(GLuint x, GLuint y, GLuint w, GLuint h) {
GLCALL(glTexCoordPointer(2, GL_FLOAT, 0, texcoords));
// Calculate the screen rect where the texture will be drawn.
- const GLshort vertices[4*2] = {
- (GLshort)x, (GLshort)y,
- (GLshort)(x + w), (GLshort)y,
- (GLshort)x, (GLshort)(y + h),
- (GLshort)(x + w), (GLshort)(y + h)
+ const GLfloat vertices[4*2] = {
+ x, y,
+ x + w, y,
+ x, y + h,
+ x + w, y + h
};
- GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices));
+ GLCALL(glVertexPointer(2, GL_FLOAT, 0, vertices));
// Draw the texture to the screen buffer.
GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
diff --git a/backends/graphics/opengl/texture.h b/backends/graphics/opengl/texture.h
index e28d980de4..ad70833544 100644
--- a/backends/graphics/opengl/texture.h
+++ b/backends/graphics/opengl/texture.h
@@ -79,7 +79,7 @@ public:
void fill(uint32 color);
- void draw(GLuint x, GLuint y, GLuint w, GLuint h);
+ void draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h);
void flagDirty() { _allDirty = true; }
bool isDirty() const { return _allDirty || !_dirtyArea.isEmpty(); }
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 3f9fc1fbd5..9540a19e9e 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -158,8 +158,18 @@ void OpenGLSdlGraphicsManager::resetGraphicsScale() {
Common::List<Graphics::PixelFormat> OpenGLSdlGraphicsManager::getSupportedFormats() const {
Common::List<Graphics::PixelFormat> formats;
+ // Our default mode is (memory layout wise) RGBA8888 which is a different
+ // logical layout depending on the endianness. We chose this mode because
+ // it is the only 32bit color mode we can safely assume to be present in
+ // OpenGL and OpenGL ES implementations. Thus, we need to supply different
+ // logical formats based on endianness.
+#ifdef SCUMM_LITTLE_ENDIAN
+ // ABGR8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
+#else
// RGBA8888
formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
+#endif
// RGB565
formats.push_back(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
// RGBA5551
@@ -168,6 +178,13 @@ Common::List<Graphics::PixelFormat> OpenGLSdlGraphicsManager::getSupportedFormat
formats.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0));
#ifndef USE_GLES
+#ifdef SCUMM_LITTLE_ENDIAN
+ // RGBA8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
+#else
+ // ABGR8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
+#endif
// ARGB8888, this should not be here, but Sword25 requires it. :-/
formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24));
@@ -308,6 +325,14 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
flags |= SDL_RESIZABLE;
}
+ if (_hwScreen) {
+ // When a video mode has been setup already we notify the manager that
+ // the context is about to be destroyed.
+ // We do this because on Windows SDL_SetVideoMode can destroy and
+ // recreate the OpenGL context.
+ notifyContextDestroy();
+ }
+
_hwScreen = SDL_SetVideoMode(width, height, 32, flags);
if (!_hwScreen) {
@@ -319,8 +344,18 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
}
if (_hwScreen) {
- const Graphics::PixelFormat rgba8888 = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
- notifyContextChange(rgba8888, rgba8888);
+ // This is pretty confusing since RGBA8888 talks about the memory
+ // layout here. This is a different logical layout depending on
+ // whether we run on little endian or big endian. However, we can
+ // only safely assume that RGBA8888 in memory layout is supported.
+ // Thus, we chose this one.
+ const Graphics::PixelFormat rgba8888 =
+#ifdef SCUMM_LITTLE_ENDIAN
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
+#else
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+#endif
+ notifyContextCreate(rgba8888, rgba8888);
setActualScreenSize(_hwScreen->w, _hwScreen->h);
}
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp
index 3c79290b50..c5c717f75c 100644
--- a/backends/mixer/sdl/sdl-mixer.cpp
+++ b/backends/mixer/sdl/sdl-mixer.cpp
@@ -58,6 +58,16 @@ void SdlMixerManager::init() {
error("Could not initialize SDL: %s", SDL_GetError());
}
+ const int maxNameLen = 20;
+ char sdlDriverName[maxNameLen];
+ sdlDriverName[0] = '\0';
+ SDL_AudioDriverName(sdlDriverName, maxNameLen);
+ debug(1, "Using SDL Audio Driver \"%s\"", sdlDriverName);
+
+ // Warning if SDL on Windows is using the fallback waveout driver, rather than the nominal DX DirectSound driver, which can cause issues with audio.
+ if (strcmp(sdlDriverName, "waveout") == 0)
+ warning("Using the fallback \"waveout\" SDL audio driver instead of \"dsound\" can cause audio lag. Fix your DirectX setup and/or SDL.dll to avoid this.");
+
// Get the desired audio specs
SDL_AudioSpec desired = getAudioSpec(SAMPLES_PER_SEC);
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 913ae51f69..f56c00eed5 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -274,6 +274,14 @@ void OSystem_SDL::initSDL() {
if (SDL_Init(sdlFlags) == -1)
error("Could not initialize SDL: %s", SDL_GetError());
+ const int maxNameLen = 20;
+ char sdlDriverName[maxNameLen];
+ sdlDriverName[0] = '\0';
+ SDL_VideoDriverName(sdlDriverName, maxNameLen);
+ // Using printf rather than debug() here as debug()/logging
+ // is not active by this point.
+ printf("Using SDL Video Driver \"%s\" ...\n", sdlDriverName);
+
_initedSDL = true;
}
}
diff --git a/backends/platform/tizen/graphics.cpp b/backends/platform/tizen/graphics.cpp
index 390796dc0e..af69844475 100644
--- a/backends/platform/tizen/graphics.cpp
+++ b/backends/platform/tizen/graphics.cpp
@@ -43,6 +43,7 @@ TizenGraphicsManager::~TizenGraphicsManager() {
logEntered();
if (_eglDisplay != EGL_NO_DISPLAY) {
+ notifyContextDestroy();
eglMakeCurrent(_eglDisplay, NULL, NULL, NULL);
if (_eglContext != EGL_NO_CONTEXT) {
eglDestroyContext(_eglDisplay, _eglContext);
@@ -58,7 +59,7 @@ result TizenGraphicsManager::Construct() {
// We default to RGB565 and RGBA5551 which is closest to the actual output
// mode we setup.
- notifyContextChange(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0));
+ notifyContextCreate(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0));
// Tell our size.
int x, y, width, height;