// Class: openfl._internal.stage3D.GLUtils

var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this

$global.Object.defineProperty(exports, "__esModule", {value: true});

var __map_reserved = {};

// Imports

var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
function lime_graphics_opengl_GL() {return require("./../../../lime/graphics/opengl/GL");}
function js__$Boot_HaxeError() {return require("./../../../js/_Boot/HaxeError");}
function openfl_errors_IllegalOperationError() {return require("./../../../openfl/errors/IllegalOperationError");}

// Constructor

var GLUtils = function(){}

// Meta

GLUtils.__name__ = ["openfl","_internal","stage3D","GLUtils"];
GLUtils.prototype = {
	
};
GLUtils.prototype.__class__ = GLUtils.prototype.constructor = $hxClasses["openfl._internal.stage3D.GLUtils"] = GLUtils;

// Init



// Statics

GLUtils.CheckGLError = function() {
	if(!GLUtils.debug) {
		return;
	}
	var error = (lime_graphics_opengl_GL().default).getError();
	if(error != 0) {
		var errorText;
		switch(error) {
		case 0:
			errorText = "GL_NO_ERROR";
			break;
		case 1280:
			errorText = "GL_INVALID_ENUM";
			break;
		case 1281:
			errorText = "GL_INVALID_VALUE";
			break;
		case 1282:
			errorText = "GL_INVALID_OPERATION";
			break;
		case 1285:
			errorText = "GL_OUT_OF_MEMORY";
			break;
		case 1286:
			errorText = "GL_INVALID_FRAMEBUFFER_OPERATION";
			break;
		default:
			if(error == null) {
				errorText = "null";
			} else {
				errorText = "" + error;
			}
		}
		throw new (js__$Boot_HaxeError().default)(new (openfl_errors_IllegalOperationError().default)("Error calling openGL api. Error: " + errorText + "\n"));
	}
}
GLUtils.debug = false

// Export

exports.default = GLUtils;