aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/opengl/openglgfx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword25/gfx/opengl/openglgfx.cpp')
-rw-r--r--engines/sword25/gfx/opengl/openglgfx.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/sword25/gfx/opengl/openglgfx.cpp b/engines/sword25/gfx/opengl/openglgfx.cpp
index 7e6ad4d392..30263d7b1d 100644
--- a/engines/sword25/gfx/opengl/openglgfx.cpp
+++ b/engines/sword25/gfx/opengl/openglgfx.cpp
@@ -32,6 +32,8 @@
*
*/
+#include "common/system.h"
+
#include "sword25/gfx/bitmapresource.h"
#include "sword25/gfx/animationresource.h"
#include "sword25/gfx/fontresource.h"
@@ -56,8 +58,8 @@ namespace Sword25 {
// -----------------------------------------------------------------------------
namespace {
-const unsigned int BIT_DEPTH = 32;
-const unsigned int BACKBUFFER_COUNT = 1;
+const int BIT_DEPTH = 32;
+const int BACKBUFFER_COUNT = 1;
const Common::String PNG_EXTENSION(".png");
const Common::String PNG_S_EXTENSION("_s.png");
const Common::String ANI_EXTENSION("_ani.xml");
@@ -79,7 +81,7 @@ BS_OpenGLGfx::BS_OpenGLGfx(BS_Kernel *pKernel) :
// -----------------------------------------------------------------------------
BS_OpenGLGfx::~BS_OpenGLGfx() {
- if (m_GLspritesInitialized) GLS_Quit();
+ _backSurface.free();
}
// -----------------------------------------------------------------------------
@@ -116,6 +118,8 @@ bool BS_OpenGLGfx::Init(int Width, int Height, int BitDepth, int BackbufferCount
m_ScreenRect.right = m_Width;
m_ScreenRect.bottom = m_Height;
+ _backSurface.create(Width, Height, 4);
+
// We already iniitalized gfx after the engine creation
m_GLspritesInitialized = true;