// Class: openfl._internal.renderer.opengl.GLVideoTexture

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 openfl__$internal_renderer_opengl_GLUtils() {return require("./../../../../openfl/_internal/renderer/opengl/GLUtils");}
function lime_graphics__$WebGLRenderContext_WebGLRenderContext_$Impl_$() {return require("./../../../../lime/graphics/_WebGLRenderContext/WebGLRenderContext_Impl_");}

// Constructor

var GLVideoTexture = function(){}

// Meta

GLVideoTexture.__name__ = ["openfl","_internal","renderer","opengl","GLVideoTexture"];
GLVideoTexture.prototype = {
	
};
GLVideoTexture.prototype.__class__ = GLVideoTexture.prototype.constructor = $hxClasses["openfl._internal.renderer.opengl.GLVideoTexture"] = GLVideoTexture;

// Init



// Statics

GLVideoTexture.create = function(videoTexture,renderer) {
	var gl = renderer.__context.webgl;
	videoTexture.__textureTarget = gl.TEXTURE_2D;
}
GLVideoTexture.getTexture = function(videoTexture,renderer) {
	if(!videoTexture.__netStream.__video.paused) {
		var gl = renderer.__context.webgl;
		renderer.bindTexture(videoTexture.__textureTarget,videoTexture.__textureID);
		(openfl__$internal_renderer_opengl_GLUtils().default).CheckGLError();
		(lime_graphics__$WebGLRenderContext_WebGLRenderContext_$Impl_$().default).texImage2D(gl,gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,videoTexture.__netStream.__video);
		(openfl__$internal_renderer_opengl_GLUtils().default).CheckGLError();
	}
	return videoTexture.__textureID;
}


// Export

exports.default = GLVideoTexture;