// Class: openfl.display3D.textures.CubeTexture

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;
var $extend = require("./../../../extend_stub").default;
function openfl_display3D_textures_TextureBase() {return require("./../../../openfl/display3D/textures/TextureBase");}
function openfl__$internal_stage3D_opengl_GLCubeTexture() {return require("./../../../openfl/_internal/stage3D/opengl/GLCubeTexture");}
function haxe_Timer() {return require("./../../../haxe/Timer");}
function openfl_events_Event() {return require("./../../../openfl/events/Event");}

// Constructor

var CubeTexture = function(context,size,format,optimizeForRenderToTexture,streamingLevels) {
	(openfl_display3D_textures_TextureBase().default).call(this,context);
	this.__size = size;
	this.__optimizeForRenderToTexture = optimizeForRenderToTexture;
	this.__streamingLevels = streamingLevels;
	(openfl__$internal_stage3D_opengl_GLCubeTexture().default).create(this,this.__context.__renderer);
}

// Meta

CubeTexture.__name__ = ["openfl","display3D","textures","CubeTexture"];
CubeTexture.__super__ = (openfl_display3D_textures_TextureBase().default);
CubeTexture.prototype = $extend((openfl_display3D_textures_TextureBase().default).prototype, {
	uploadCompressedTextureFromByteArray: function(data,byteArrayOffset,async) {
		if(async == null) {
			async = false;
		}
		var _gthis = this;
		if(!async) {
			(openfl__$internal_stage3D_opengl_GLCubeTexture().default).uploadCompressedTextureFromByteArray(this,this.__context.__renderer,data,byteArrayOffset);
		} else {
			(haxe_Timer().default).delay(function() {
				(openfl__$internal_stage3D_opengl_GLCubeTexture().default).uploadCompressedTextureFromByteArray(_gthis,_gthis.__context.__renderer,data,byteArrayOffset);
				_gthis.dispatchEvent(new (openfl_events_Event().default)("textureReady"));
			},1);
		}
	},
	uploadFromBitmapData: function(source,side,miplevel,generateMipmap) {
		if(generateMipmap == null) {
			generateMipmap = false;
		}
		if(miplevel == null) {
			miplevel = 0;
		}
		if(source == null) {
			return;
		}
		(openfl__$internal_stage3D_opengl_GLCubeTexture().default).uploadFromBitmapData(this,this.__context.__renderer,source,side,miplevel,generateMipmap);
	},
	uploadFromByteArray: function(data,byteArrayOffset,side,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		(openfl__$internal_stage3D_opengl_GLCubeTexture().default).uploadFromByteArray(this,this.__context.__renderer,data,byteArrayOffset,side,miplevel);
	},
	uploadFromTypedArray: function(data,side,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(data == null) {
			return;
		}
		(openfl__$internal_stage3D_opengl_GLCubeTexture().default).uploadFromTypedArray(this,this.__context.__renderer,data,side,miplevel);
	},
	__setSamplerState: function(state) {
		(openfl__$internal_stage3D_opengl_GLCubeTexture().default).setSamplerState(this,this.__context.__renderer,state);
	}
});
CubeTexture.prototype.__class__ = $hxClasses["openfl.display3D.textures.CubeTexture"] = CubeTexture;

// Init



// Statics




// Export

exports.default = CubeTexture;