godot/drivers/gl_context/context_gl.cpp

42 lines
862 B
C++
Raw Normal View History

2014-02-10 01:10:30 +00:00
/*************************************************/
/* context_gl.cpp */
/*************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/*************************************************/
/* Source code within this file is: */
2016-01-01 13:50:53 +00:00
/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */
2014-02-10 01:10:30 +00:00
/* All Rights Reserved. */
/*************************************************/
#include "context_gl.h"
#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED)
2014-02-10 01:10:30 +00:00
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