summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/glwrapper-ogl.cc
diff options
context:
space:
mode:
authorEnne Walker <ennewalker@users.sourceforge.net>2010-04-23 16:15:39 -0400
committerEnne Walker <ennewalker@users.sourceforge.net>2010-04-24 11:41:02 -0400
commit628a7cdd6f98325059fe118837b72eddfacd5f86 (patch)
tree96cf72493e781830275ddca53144b48a6d5a0e86 /crawl-ref/source/glwrapper-ogl.cc
parenta22caea21579cd15007a2c2167d233789a1e01fa (diff)
downloadcrawl-ref-628a7cdd6f98325059fe118837b72eddfacd5f86.tar.gz
crawl-ref-628a7cdd6f98325059fe118837b72eddfacd5f86.zip
Move specific create funcs out of generic files.
glwrapper-ogl.cc, windowmanager-sdl.cc, and fontwrapper-ft.cc now contain the static functions for their parent class's factory create. This allows new implementations to be added without requiring modification of the generic file (with #ifdefs).
Diffstat (limited to 'crawl-ref/source/glwrapper-ogl.cc')
-rw-r--r--crawl-ref/source/glwrapper-ogl.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/glwrapper-ogl.cc b/crawl-ref/source/glwrapper-ogl.cc
index 875cf9f8f6..b97c89d9ab 100644
--- a/crawl-ref/source/glwrapper-ogl.cc
+++ b/crawl-ref/source/glwrapper-ogl.cc
@@ -15,6 +15,25 @@
#include "debug.h"
/////////////////////////////////////////////////////////////////////////////
+// Static functions from GLStateManager
+
+GLStateManager *glmanager = NULL;
+
+void GLStateManager::init()
+{
+ if (glmanager)
+ return;
+
+ glmanager = new OGLStateManager();
+}
+
+void GLStateManager::shutdown()
+{
+ delete glmanager;
+ glmanager = NULL;
+}
+
+/////////////////////////////////////////////////////////////////////////////
// OGLStateManager
OGLStateManager::OGLStateManager()