From 37f71235529f8fd4a4c90389dc6a3b41e355f4a9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 19 Oct 2013 19:40:10 +0200 Subject: TIZEN: Add some further OpenGL related changes by Chris. --- backends/platform/tizen/graphics.cpp | 29 +++++++++++++++-------------- backends/platform/tizen/graphics.h | 2 ++ backends/platform/tizen/system.cpp | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/tizen/graphics.cpp b/backends/platform/tizen/graphics.cpp index 6af0c2b37e..390796dc0e 100644 --- a/backends/platform/tizen/graphics.cpp +++ b/backends/platform/tizen/graphics.cpp @@ -37,6 +37,20 @@ TizenGraphicsManager::TizenGraphicsManager(TizenAppForm *appForm) : _eglContext(EGL_NO_CONTEXT), _initState(true) { assert(appForm != NULL); +} + +TizenGraphicsManager::~TizenGraphicsManager() { + logEntered(); + + if (_eglDisplay != EGL_NO_DISPLAY) { + eglMakeCurrent(_eglDisplay, NULL, NULL, NULL); + if (_eglContext != EGL_NO_CONTEXT) { + eglDestroyContext(_eglDisplay, _eglContext); + } + } +} + +result TizenGraphicsManager::Construct() { // Initialize our OpenGL ES context. loadEgl(); @@ -51,17 +65,7 @@ TizenGraphicsManager::TizenGraphicsManager(TizenAppForm *appForm) : _appForm->GetBounds(x, y, width, height); AppLog("screen size: %dx%d", width, height); setActualScreenSize(width, height); -} - -TizenGraphicsManager::~TizenGraphicsManager() { - logEntered(); - - if (_eglDisplay != EGL_NO_DISPLAY) { - eglMakeCurrent(_eglDisplay, NULL, NULL, NULL); - if (_eglContext != EGL_NO_CONTEXT) { - eglDestroyContext(_eglDisplay, _eglContext); - } - } + return E_SUCCESS; } const Graphics::Font *TizenGraphicsManager::getFontOSD() { @@ -189,9 +193,6 @@ bool TizenGraphicsManager::loadEgl() { systemError("eglMakeCurrent() failed"); return false; } - if (!_initState) { - _appForm->GetVisualElement()->SetShowState(true); - } logLeaving(); return true; } diff --git a/backends/platform/tizen/graphics.h b/backends/platform/tizen/graphics.h index 1ed8a7c653..29ba86a3c4 100644 --- a/backends/platform/tizen/graphics.h +++ b/backends/platform/tizen/graphics.h @@ -44,6 +44,8 @@ public: TizenGraphicsManager(TizenAppForm *appForm); virtual ~TizenGraphicsManager(); + result Construct(); + Common::List getSupportedFormats() const; bool hasFeature(OSystem::Feature f); void setFeatureState(OSystem::Feature f, bool enable); diff --git a/backends/platform/tizen/system.cpp b/backends/platform/tizen/system.cpp index 3448dc1421..f7ebc46719 100644 --- a/backends/platform/tizen/system.cpp +++ b/backends/platform/tizen/system.cpp @@ -267,7 +267,7 @@ result TizenSystem::initModules() { } _graphicsManager = (GraphicsManager *)new TizenGraphicsManager(_appForm); - if (!_graphicsManager) { + if (!_graphicsManager || graphicsManager->Construct() != E_SUCCESS) { return E_OUT_OF_MEMORY; } -- cgit v1.2.3