diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-27 19:06:17 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-27 19:06:17 (GMT) |
| commit | 5befe5c25f8f188e7588de44ab2c8bead22ae999 (patch) | |
| tree | 643b02af217770c1a3156be03e01442557795760 /src/graphics/OpenGLGraphics.cpp | |
| parent | f8ca8af387b8611c18ca7c5357efd19c8bc28941 (diff) | |
| download | powder-5befe5c25f8f188e7588de44ab2c8bead22ae999.zip powder-5befe5c25f8f188e7588de44ab2c8bead22ae999.tar.gz | |
Local file browser + some more interesting things like Progress bar UI component
Diffstat (limited to 'src/graphics/OpenGLGraphics.cpp')
| -rw-r--r-- | src/graphics/OpenGLGraphics.cpp | 16 |
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() { } |
