// Class: openfl.display3D.Program3D

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_stage3D_opengl_GLProgram3D() {return require("./../../openfl/_internal/stage3D/opengl/GLProgram3D");}
function List() {return require("./../../List");}
function openfl__$Vector_Vector_$Impl_$() {return require("./../../openfl/_Vector/Vector_Impl_");}

// Constructor

var Program3D = function(context3D) {
	this.__context = context3D;
	this.__memUsage = 0;
	this.__samplerUsageMask = 0;
	this.__uniforms = new (List().default)();
	this.__samplerUniforms = new (List().default)();
	this.__alphaSamplerUniforms = new (List().default)();
	this.__alphaSamplerEnabled = [];
	this.__samplerStates = (openfl__$Vector_Vector_$Impl_$().default)._new(8);
}

// Meta

Program3D.__name__ = ["openfl","display3D","Program3D"];
Program3D.prototype = {
	dispose: function() {
		(openfl__$internal_stage3D_opengl_GLProgram3D().default).dispose(this,this.__context.__renderer);
	},
	upload: function(vertexProgram,fragmentProgram) {
		(openfl__$internal_stage3D_opengl_GLProgram3D().default).upload(this,this.__context.__renderer,vertexProgram,fragmentProgram);
	},
	__flush: function() {
		this.__vertexUniformMap.flush();
		this.__fragmentUniformMap.flush();
	},
	__getSamplerState: function(sampler) {
		return this.__samplerStates.get(sampler);
	},
	__markDirty: function(isVertex,index,count) {
		if(isVertex) {
			this.__vertexUniformMap.markDirty(index,count);
		} else {
			this.__fragmentUniformMap.markDirty(index,count);
		}
	},
	__setPositionScale: function(positionScale) {
		if(this.__positionScale != null) {
			(openfl__$internal_stage3D_opengl_GLProgram3D().default).setPositionScale(this,this.__context.__renderer,positionScale);
		}
	},
	__setSamplerState: function(sampler,state) {
		this.__samplerStates.set(sampler,state);
	},
	__use: function() {
		(openfl__$internal_stage3D_opengl_GLProgram3D().default)["use"](this,this.__context.__renderer);
	}
};
Program3D.prototype.__class__ = $hxClasses["openfl.display3D.Program3D"] = Program3D;

// Init



// Statics




// Export

exports.default = Program3D;