summaryrefslogtreecommitdiff
path: root/src/graphics/OpenGLGraphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics/OpenGLGraphics.cpp')
-rw-r--r--src/graphics/OpenGLGraphics.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/graphics/OpenGLGraphics.cpp b/src/graphics/OpenGLGraphics.cpp
index 66a1753..43bff6b 100644
--- a/src/graphics/OpenGLGraphics.cpp
+++ b/src/graphics/OpenGLGraphics.cpp
@@ -1,11 +1,17 @@
#include "Graphics.h"
#include "font.h"
+#include <pthread.h>
#ifdef OGLI
+static pthread_mutex_t gMutex = PTHREAD_MUTEX_INITIALIZER;
+
Graphics::Graphics():
sdl_scale(1)
{
+ if(gMutex == PTHREAD_MUTEX_INITIALIZER)
+ pthread_mutex_init (&gMutex, NULL);
+
Reset();
glEnable(GL_BLEND);
@@ -35,6 +41,16 @@ sdl_scale(1)
glDisable(GL_TEXTURE_2D);
}
+void Graphics::Acquire()
+{
+ pthread_mutex_lock(&gMutex);
+}
+
+void Graphics::Release()
+{
+ pthread_mutex_unlock(&gMutex);
+}
+
Graphics::~Graphics()
{
}