diff options
| author | Juan Linietsky | 2014-02-09 22:10:30 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-02-09 22:10:30 -0300 |
| commit | 0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac (patch) | |
| tree | 276c4d099e178eb67fbd14f61d77b05e3808e9e3 /drivers/gl_context/context_gl.cpp | |
| parent | 0e49da1687bc8192ed210947da52c9e5c5f301bb (diff) | |
| download | godot-0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac.tar.gz godot-0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac.tar.zst godot-0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac.zip | |
Diffstat (limited to 'drivers/gl_context/context_gl.cpp')
| -rw-r--r-- | drivers/gl_context/context_gl.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/gl_context/context_gl.cpp b/drivers/gl_context/context_gl.cpp new file mode 100644 index 000000000..77a94f933 --- /dev/null +++ b/drivers/gl_context/context_gl.cpp @@ -0,0 +1,41 @@ +/*************************************************/ +/* context_gl.cpp */ +/*************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/*************************************************/ +/* Source code within this file is: */ +/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* All Rights Reserved. */ +/*************************************************/ + +#include "context_gl.h" + + +#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) || defined(GLES2_ENABLED) || defined(GLES1_ENABLED) + + + +ContextGL *ContextGL::singleton=NULL; + +ContextGL *ContextGL::get_singleton() { + + return singleton; +} + + +ContextGL::ContextGL() { + + ERR_FAIL_COND(singleton); + + singleton=this; +} + + +ContextGL::~ContextGL() { + + if (singleton==this) + singleton=NULL; +} + +#endif |
