context_gl.cpp 862 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*************************************************/
  2. /* context_gl.cpp */
  3. /*************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /*************************************************/
  7. /* Source code within this file is: */
  8. /* (c) 2007-2010 Juan Linietsky, Ariel Manzur */
  9. /* All Rights Reserved. */
  10. /*************************************************/
  11. #include "context_gl.h"
  12. #if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED)
  13. ContextGL *ContextGL::singleton=NULL;
  14. ContextGL *ContextGL::get_singleton() {
  15. return singleton;
  16. }
  17. ContextGL::ContextGL() {
  18. ERR_FAIL_COND(singleton);
  19. singleton=this;
  20. }
  21. ContextGL::~ContextGL() {
  22. if (singleton==this)
  23. singleton=NULL;
  24. }
  25. #endif