summaryrefslogtreecommitdiff
path: root/drivers/gl_context/context_gl.cpp
blob: 77a94f9333e59fc0f0ee4b2a41fa7e4921014ec8 (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(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