summaryrefslogtreecommitdiff
path: root/drivers/gl_context/context_gl.cpp
blob: 82195cc6f61534ec48d75fda9838b9670519b823 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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(GLES2_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