#include <hxcpp.h>

#ifndef INCLUDED_IMap
#include <IMap.h>
#endif
#ifndef INCLUDED_Luxe
#include <Luxe.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
#ifndef INCLUDED_haxe_ds_StringMap
#include <haxe/ds/StringMap.h>
#endif
#ifndef INCLUDED_luxe_resource_Resource
#include <luxe/resource/Resource.h>
#endif
#ifndef INCLUDED_luxe_resource_ResourceManager
#include <luxe/resource/ResourceManager.h>
#endif
#ifndef INCLUDED_luxe_resource_ResourceType
#include <luxe/resource/ResourceType.h>
#endif
#ifndef INCLUDED_luxe_resource_TextResource
#include <luxe/resource/TextResource.h>
#endif
#ifndef INCLUDED_phoenix_Color
#include <phoenix/Color.h>
#endif
#ifndef INCLUDED_phoenix_RenderState
#include <phoenix/RenderState.h>
#endif
#ifndef INCLUDED_phoenix_Renderer
#include <phoenix/Renderer.h>
#endif
#ifndef INCLUDED_phoenix_Shader
#include <phoenix/Shader.h>
#endif
#ifndef INCLUDED_phoenix_Texture
#include <phoenix/Texture.h>
#endif
#ifndef INCLUDED_phoenix_UniformValueType
#include <phoenix/UniformValueType.h>
#endif
#ifndef INCLUDED_phoenix_Vector
#include <phoenix/Vector.h>
#endif
#ifndef INCLUDED_snow_platform_native_render_opengl_GL
#include <snow/platform/native/render/opengl/GL.h>
#endif
#ifndef INCLUDED_snow_platform_native_render_opengl_GLObject
#include <snow/platform/native/render/opengl/GLObject.h>
#endif
#ifndef INCLUDED_snow_platform_native_render_opengl_GLProgram
#include <snow/platform/native/render/opengl/GLProgram.h>
#endif
#ifndef INCLUDED_snow_platform_native_render_opengl_GLShader
#include <snow/platform/native/render/opengl/GLShader.h>
#endif
namespace phoenix{

Void Shader_obj::__construct(::luxe::resource::ResourceManager _manager)
{
HX_STACK_FRAME("phoenix.Shader","new",0xb939fd36,"phoenix.Shader.new","phoenix/Shader.hx",34,0x14ec92d9)

HX_STACK_ARG(_manager,"_manager")
{
	HX_STACK_LINE(50)
	this->normal_attribute = (int)3;
	HX_STACK_LINE(49)
	this->color_attribute = (int)2;
	HX_STACK_LINE(48)
	this->tcoord_attribute = (int)1;
	HX_STACK_LINE(47)
	this->vert_attribute = (int)0;
	HX_STACK_LINE(40)
	this->fragment_source_name = HX_CSTRING("");
	HX_STACK_LINE(39)
	this->vertex_source_name = HX_CSTRING("");
	HX_STACK_LINE(37)
	this->log = HX_CSTRING("");
	HX_STACK_LINE(36)
	this->errors = HX_CSTRING("");
	HX_STACK_LINE(69)
	super::__construct(_manager,::luxe::resource::ResourceType_obj::shader,null());
	HX_STACK_LINE(70)
	this->uniforms = ::haxe::ds::StringMap_obj::__new();
	HX_STACK_LINE(71)
	this->uniform_textures = ::haxe::ds::StringMap_obj::__new();
}
;
	return null();
}

//Shader_obj::~Shader_obj() { }

Dynamic Shader_obj::__CreateEmpty() { return  new Shader_obj; }
hx::ObjectPtr< Shader_obj > Shader_obj::__new(::luxe::resource::ResourceManager _manager)
{  hx::ObjectPtr< Shader_obj > result = new Shader_obj();
	result->__construct(_manager);
	return result;}

Dynamic Shader_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< Shader_obj > result = new Shader_obj();
	result->__construct(inArgs[0]);
	return result;}

Void Shader_obj::activate( ){
{
		HX_STACK_FRAME("phoenix.Shader","activate",0x6f45a71d,"phoenix.Shader.activate","phoenix/Shader.hx",76,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_LINE(76)
		if (((this->program != null()))){
			HX_STACK_LINE(78)
			::Luxe_obj::renderer->state->useProgram(this->program);
		}
		else{
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Shader_obj,activate,(void))

Void Shader_obj::deactivate( ){
{
		HX_STACK_FRAME("phoenix.Shader","deactivate",0x87a4161e,"phoenix.Shader.deactivate","phoenix/Shader.hx",85,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_LINE(85)
		::Luxe_obj::renderer->state->useProgram(null());
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Shader_obj,deactivate,(void))

Void Shader_obj::set_uniform_int( ::String _name,int _value){
{
		HX_STACK_FRAME("phoenix.Shader","set_uniform_int",0x0e18879d,"phoenix.Shader.set_uniform_int","phoenix/Shader.hx",89,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_name,"_name")
		HX_STACK_ARG(_value,"_value")
		HX_STACK_LINE(89)
		if ((this->uniforms->exists(_name))){
			HX_STACK_LINE(90)
			Dynamic _uniformvalue = this->uniforms->get(_name);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(91)
			_uniformvalue->__FieldRef(HX_CSTRING("value")) = _value;
		}
		else{
			struct _Function_2_1{
				inline static Dynamic Block( ::phoenix::Shader_obj *__this,::String &_name,int &_value){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Shader.hx",94,0x14ec92d9)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("name") , _name,false);
						__result->Add(HX_CSTRING("value") , _value,false);
						__result->Add(HX_CSTRING("type") , ::phoenix::UniformValueType_obj::_int,false);
						__result->Add(HX_CSTRING("location") , ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(__this->program,_name),false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(94)
			Dynamic _uniformvalue = _Function_2_1::Block(this,_name,_value);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(101)
			this->uniforms->set(_name,_uniformvalue);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Shader_obj,set_uniform_int,(void))

Void Shader_obj::set_uniform_float( ::String _name,Float _value){
{
		HX_STACK_FRAME("phoenix.Shader","set_uniform_float",0x6f75c7ca,"phoenix.Shader.set_uniform_float","phoenix/Shader.hx",105,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_name,"_name")
		HX_STACK_ARG(_value,"_value")
		HX_STACK_LINE(105)
		if ((this->uniforms->exists(_name))){
			HX_STACK_LINE(106)
			Dynamic _uniformvalue = this->uniforms->get(_name);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(107)
			_uniformvalue->__FieldRef(HX_CSTRING("value")) = _value;
		}
		else{
			struct _Function_2_1{
				inline static Dynamic Block( ::phoenix::Shader_obj *__this,::String &_name,Float &_value){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Shader.hx",110,0x14ec92d9)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("name") , _name,false);
						__result->Add(HX_CSTRING("value") , _value,false);
						__result->Add(HX_CSTRING("type") , ::phoenix::UniformValueType_obj::_float,false);
						__result->Add(HX_CSTRING("location") , ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(__this->program,_name),false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(110)
			Dynamic _uniformvalue = _Function_2_1::Block(this,_name,_value);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(117)
			this->uniforms->set(_name,_uniformvalue);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Shader_obj,set_uniform_float,(void))

Void Shader_obj::set_uniform_vector2( ::String _name,::phoenix::Vector _value){
{
		HX_STACK_FRAME("phoenix.Shader","set_uniform_vector2",0x7ee363bd,"phoenix.Shader.set_uniform_vector2","phoenix/Shader.hx",123,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_name,"_name")
		HX_STACK_ARG(_value,"_value")
		HX_STACK_LINE(123)
		if ((this->uniforms->exists(_name))){
			HX_STACK_LINE(125)
			Dynamic _uniformvalue = this->uniforms->get(_name);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(126)
			_uniformvalue->__FieldRef(HX_CSTRING("value")) = _value;
		}
		else{
			struct _Function_2_1{
				inline static Dynamic Block( ::phoenix::Shader_obj *__this,::String &_name,::phoenix::Vector &_value){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Shader.hx",130,0x14ec92d9)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("name") , _name,false);
						__result->Add(HX_CSTRING("value") , _value,false);
						__result->Add(HX_CSTRING("type") , ::phoenix::UniformValueType_obj::vector2,false);
						__result->Add(HX_CSTRING("location") , ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(__this->program,_name),false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(130)
			Dynamic _uniformvalue = _Function_2_1::Block(this,_name,_value);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(137)
			this->uniforms->set(_name,_uniformvalue);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Shader_obj,set_uniform_vector2,(void))

Void Shader_obj::set_uniform_vector3( ::String _name,::phoenix::Vector _value){
{
		HX_STACK_FRAME("phoenix.Shader","set_uniform_vector3",0x7ee363be,"phoenix.Shader.set_uniform_vector3","phoenix/Shader.hx",143,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_name,"_name")
		HX_STACK_ARG(_value,"_value")
		HX_STACK_LINE(143)
		if ((this->uniforms->exists(_name))){
			HX_STACK_LINE(145)
			Dynamic _uniformvalue = this->uniforms->get(_name);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(146)
			_uniformvalue->__FieldRef(HX_CSTRING("value")) = _value;
		}
		else{
			struct _Function_2_1{
				inline static Dynamic Block( ::phoenix::Shader_obj *__this,::String &_name,::phoenix::Vector &_value){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Shader.hx",150,0x14ec92d9)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("name") , _name,false);
						__result->Add(HX_CSTRING("value") , _value,false);
						__result->Add(HX_CSTRING("type") , ::phoenix::UniformValueType_obj::vector3,false);
						__result->Add(HX_CSTRING("location") , ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(__this->program,_name),false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(150)
			Dynamic _uniformvalue = _Function_2_1::Block(this,_name,_value);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(157)
			this->uniforms->set(_name,_uniformvalue);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Shader_obj,set_uniform_vector3,(void))

Void Shader_obj::set_uniform_vector4( ::String _name,::phoenix::Vector _value){
{
		HX_STACK_FRAME("phoenix.Shader","set_uniform_vector4",0x7ee363bf,"phoenix.Shader.set_uniform_vector4","phoenix/Shader.hx",165,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_name,"_name")
		HX_STACK_ARG(_value,"_value")
		HX_STACK_LINE(165)
		if ((this->uniforms->exists(_name))){
			HX_STACK_LINE(167)
			Dynamic _uniformvalue = this->uniforms->get(_name);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(168)
			_uniformvalue->__FieldRef(HX_CSTRING("value")) = _value;
		}
		else{
			struct _Function_2_1{
				inline static Dynamic Block( ::phoenix::Shader_obj *__this,::String &_name,::phoenix::Vector &_value){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Shader.hx",172,0x14ec92d9)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("name") , _name,false);
						__result->Add(HX_CSTRING("value") , _value,false);
						__result->Add(HX_CSTRING("type") , ::phoenix::UniformValueType_obj::vector4,false);
						__result->Add(HX_CSTRING("location") , ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(__this->program,_name),false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(172)
			Dynamic _uniformvalue = _Function_2_1::Block(this,_name,_value);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(179)
			this->uniforms->set(_name,_uniformvalue);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Shader_obj,set_uniform_vector4,(void))

Void Shader_obj::set_uniform_color( ::String _name,::phoenix::Color _value){
{
		HX_STACK_FRAME("phoenix.Shader","set_uniform_color",0xb73b7391,"phoenix.Shader.set_uniform_color","phoenix/Shader.hx",187,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_name,"_name")
		HX_STACK_ARG(_value,"_value")
		HX_STACK_LINE(187)
		if ((this->uniforms->exists(_name))){
			HX_STACK_LINE(189)
			Dynamic _uniformvalue = this->uniforms->get(_name);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(190)
			_uniformvalue->__FieldRef(HX_CSTRING("value")) = _value;
		}
		else{
			struct _Function_2_1{
				inline static Dynamic Block( ::phoenix::Shader_obj *__this,::String &_name,::phoenix::Color &_value){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Shader.hx",194,0x14ec92d9)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("name") , _name,false);
						__result->Add(HX_CSTRING("value") , _value,false);
						__result->Add(HX_CSTRING("type") , ::phoenix::UniformValueType_obj::color,false);
						__result->Add(HX_CSTRING("location") , ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(__this->program,_name),false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(194)
			Dynamic _uniformvalue = _Function_2_1::Block(this,_name,_value);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(201)
			this->uniforms->set(_name,_uniformvalue);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Shader_obj,set_uniform_color,(void))

Void Shader_obj::set_uniform_texture( ::String _name,::phoenix::Texture _value){
{
		HX_STACK_FRAME("phoenix.Shader","set_uniform_texture",0x43273289,"phoenix.Shader.set_uniform_texture","phoenix/Shader.hx",208,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_name,"_name")
		HX_STACK_ARG(_value,"_value")
		HX_STACK_LINE(208)
		if ((this->uniforms->exists(_name))){
			HX_STACK_LINE(210)
			Dynamic _uniformvalue = this->uniforms->get(_name);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(211)
			_uniformvalue->__FieldRef(HX_CSTRING("value")) = _value;
			HX_STACK_LINE(212)
			this->uniform_textures->set(_name,_value);
		}
		else{
			struct _Function_2_1{
				inline static Dynamic Block( ::phoenix::Shader_obj *__this,::String &_name,::phoenix::Texture &_value){
					HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Shader.hx",216,0x14ec92d9)
					{
						hx::Anon __result = hx::Anon_obj::Create();
						__result->Add(HX_CSTRING("name") , _name,false);
						__result->Add(HX_CSTRING("value") , _value,false);
						__result->Add(HX_CSTRING("type") , ::phoenix::UniformValueType_obj::texture,false);
						__result->Add(HX_CSTRING("location") , ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(__this->program,_name),false);
						return __result;
					}
					return null();
				}
			};
			HX_STACK_LINE(216)
			Dynamic _uniformvalue = _Function_2_1::Block(this,_name,_value);		HX_STACK_VAR(_uniformvalue,"_uniformvalue");
			HX_STACK_LINE(222)
			this->uniforms->set(_name,_uniformvalue);
			HX_STACK_LINE(223)
			this->uniform_textures->set(_name,_value);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Shader_obj,set_uniform_texture,(void))

::snow::platform::native::render::opengl::GLShader Shader_obj::compile( int _type,::String _source,hx::Null< bool >  __o__verbose){
bool _verbose = __o__verbose.Default(false);
	HX_STACK_FRAME("phoenix.Shader","compile",0x809b7549,"phoenix.Shader.compile","phoenix/Shader.hx",229,0x14ec92d9)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_type,"_type")
	HX_STACK_ARG(_source,"_source")
	HX_STACK_ARG(_verbose,"_verbose")
{
		HX_STACK_LINE(231)
		::snow::platform::native::render::opengl::GLShader _shader = ::snow::platform::native::render::opengl::GL_obj::createShader(_type);		HX_STACK_VAR(_shader,"_shader");
		HX_STACK_LINE(233)
		::snow::platform::native::render::opengl::GL_obj::shaderSource(_shader,_source);
		HX_STACK_LINE(234)
		::snow::platform::native::render::opengl::GL_obj::compileShader(_shader);
		HX_STACK_LINE(236)
		::String shader_log = HX_CSTRING("");		HX_STACK_VAR(shader_log,"shader_log");
		HX_STACK_LINE(238)
		if ((_verbose)){
			HX_STACK_LINE(239)
			shader_log = ::snow::platform::native::render::opengl::GL_obj::getShaderInfoLog(_shader);
			HX_STACK_LINE(241)
			if (((shader_log.length > (int)0))){
				HX_STACK_LINE(243)
				this->addLog(((((HX_CSTRING("\n\t :: start -- (") + ((  (((_type == (int)35632))) ? ::String(HX_CSTRING("fragment")) : ::String(HX_CSTRING("vertex")) ))) + HX_CSTRING(") Shader compile log -- ")) + this->id) + HX_CSTRING("\n")));
				HX_STACK_LINE(245)
				this->addLog(((HX_CSTRING("\t\t") + shader_log) + HX_CSTRING("\n")));
				HX_STACK_LINE(247)
				this->addLog((((HX_CSTRING("\t :: end -- (") + ((  (((_type == (int)35632))) ? ::String(HX_CSTRING("fragment")) : ::String(HX_CSTRING("vertex")) ))) + HX_CSTRING(") Shader compile log -- ")) + this->id));
			}
		}
		HX_STACK_LINE(253)
		if (((::snow::platform::native::render::opengl::GL_obj::getShaderParameter(_shader,(int)35713) == (int)0))){
			HX_STACK_LINE(255)
			::String _info;		HX_STACK_VAR(_info,"_info");
			HX_STACK_LINE(255)
			if (((_type == (int)35632))){
				HX_STACK_LINE(255)
				_info = HX_CSTRING("fragment");
			}
			else{
				HX_STACK_LINE(255)
				_info = HX_CSTRING("vertex");
			}
			HX_STACK_LINE(256)
			if (((_type == (int)35632))){
				HX_STACK_LINE(256)
				hx::AddEq(_info,((HX_CSTRING("(") + this->fragment_source_name) + HX_CSTRING(")")));
			}
			else{
				HX_STACK_LINE(256)
				hx::AddEq(_info,((HX_CSTRING("(") + this->vertex_source_name) + HX_CSTRING(")")));
			}
			HX_STACK_LINE(258)
			this->addError(((HX_CSTRING("\tFailed to compile shader (") + _info) + HX_CSTRING(") : \n")));
			HX_STACK_LINE(261)
			if ((!(_verbose))){
				HX_STACK_LINE(262)
				shader_log = ::snow::platform::native::render::opengl::GL_obj::getShaderInfoLog(_shader);
			}
			HX_STACK_LINE(265)
			this->addError((HX_CSTRING("\t\t") + shader_log));
			HX_STACK_LINE(267)
			::snow::platform::native::render::opengl::GL_obj::deleteShader(_shader);
			HX_STACK_LINE(268)
			_shader = null();
			HX_STACK_LINE(270)
			return null();
		}
		HX_STACK_LINE(274)
		return _shader;
	}
}


HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,compile,return )

::snow::platform::native::render::opengl::GLProgram Shader_obj::link( ){
	HX_STACK_FRAME("phoenix.Shader","link",0x58342664,"phoenix.Shader.link","phoenix/Shader.hx",277,0x14ec92d9)
	HX_STACK_THIS(this)
	HX_STACK_LINE(279)
	::snow::platform::native::render::opengl::GLProgram _program = ::snow::platform::native::render::opengl::GL_obj::createProgram();		HX_STACK_VAR(_program,"_program");
	HX_STACK_LINE(281)
	::snow::platform::native::render::opengl::GL_obj::attachShader(_program,this->vert_shader);
	HX_STACK_LINE(282)
	::snow::platform::native::render::opengl::GL_obj::attachShader(_program,this->frag_shader);
	HX_STACK_LINE(285)
	::snow::platform::native::render::opengl::GL_obj::bindAttribLocation(_program,this->vert_attribute,HX_CSTRING("vertexPosition"));
	HX_STACK_LINE(286)
	::snow::platform::native::render::opengl::GL_obj::bindAttribLocation(_program,this->tcoord_attribute,HX_CSTRING("vertexTCoord"));
	HX_STACK_LINE(287)
	::snow::platform::native::render::opengl::GL_obj::bindAttribLocation(_program,this->color_attribute,HX_CSTRING("vertexColor"));
	HX_STACK_LINE(288)
	::snow::platform::native::render::opengl::GL_obj::bindAttribLocation(_program,this->normal_attribute,HX_CSTRING("vertexNormal"));
	HX_STACK_LINE(290)
	::snow::platform::native::render::opengl::GL_obj::linkProgram(_program);
	HX_STACK_LINE(292)
	if (((::snow::platform::native::render::opengl::GL_obj::getProgramParameter(_program,(int)35714) == (int)0))){
		HX_STACK_LINE(293)
		this->addError(HX_CSTRING("\tFailed to link shader program:"));
		HX_STACK_LINE(294)
		this->addError((HX_CSTRING("\t\t") + ::snow::platform::native::render::opengl::GL_obj::getProgramInfoLog(_program)));
		HX_STACK_LINE(295)
		::snow::platform::native::render::opengl::GL_obj::deleteProgram(_program);
		HX_STACK_LINE(296)
		_program = null();
		HX_STACK_LINE(297)
		return null();
	}
	HX_STACK_LINE(301)
	this->activate();
	HX_STACK_LINE(310)
	this->projectionmatrix_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("projectionMatrix"));
	HX_STACK_LINE(311)
	this->modelviewmatrix_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("modelViewMatrix"));
	HX_STACK_LINE(314)
	this->tex0_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("tex0"));
	HX_STACK_LINE(315)
	this->tex1_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("tex1"));
	HX_STACK_LINE(316)
	this->tex2_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("tex2"));
	HX_STACK_LINE(317)
	this->tex3_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("tex3"));
	HX_STACK_LINE(318)
	this->tex4_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("tex4"));
	HX_STACK_LINE(319)
	this->tex5_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("tex5"));
	HX_STACK_LINE(320)
	this->tex6_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("tex6"));
	HX_STACK_LINE(321)
	this->tex7_attribute = ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(_program,HX_CSTRING("tex7"));
	HX_STACK_LINE(323)
	return _program;
}


HX_DEFINE_DYNAMIC_FUNC0(Shader_obj,link,return )

Void Shader_obj::drop( ){
{
		HX_STACK_FRAME("phoenix.Shader","drop",0x52f14699,"phoenix.Shader.drop","phoenix/Shader.hx",326,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_LINE(327)
		this->super::drop();
		HX_STACK_LINE(328)
		this->destroy();
	}
return null();
}


Void Shader_obj::destroy( ){
{
		HX_STACK_FRAME("phoenix.Shader","destroy",0x21b27cd0,"phoenix.Shader.destroy","phoenix/Shader.hx",331,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_LINE(332)
		if (((this->vert_shader != null()))){
			HX_STACK_LINE(332)
			::snow::platform::native::render::opengl::GL_obj::deleteShader(this->vert_shader);
		}
		HX_STACK_LINE(333)
		if (((this->frag_shader != null()))){
			HX_STACK_LINE(333)
			::snow::platform::native::render::opengl::GL_obj::deleteShader(this->frag_shader);
		}
		HX_STACK_LINE(334)
		if (((this->program != null()))){
			HX_STACK_LINE(334)
			::snow::platform::native::render::opengl::GL_obj::deleteProgram(this->program);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Shader_obj,destroy,(void))

bool Shader_obj::from_string( ::String _vertex_source,::String _fragment_source,::String __o__frag_name,::String __o__vertex_name,hx::Null< bool >  __o__verbose){
::String _frag_name = __o__frag_name.Default(HX_CSTRING(""));
::String _vertex_name = __o__vertex_name.Default(HX_CSTRING(""));
bool _verbose = __o__verbose.Default(false);
	HX_STACK_FRAME("phoenix.Shader","from_string",0x2d56691c,"phoenix.Shader.from_string","phoenix/Shader.hx",393,0x14ec92d9)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vertex_source,"_vertex_source")
	HX_STACK_ARG(_fragment_source,"_fragment_source")
	HX_STACK_ARG(_frag_name,"_frag_name")
	HX_STACK_ARG(_vertex_name,"_vertex_name")
	HX_STACK_ARG(_verbose,"_verbose")
{
		HX_STACK_LINE(396)
		this->destroy();
		HX_STACK_LINE(399)
		this->fragment_source_name = _frag_name;
		HX_STACK_LINE(400)
		this->vertex_source_name = _vertex_name;
		HX_STACK_LINE(403)
		this->vert_shader = this->compile((int)35633,_vertex_source,_verbose);
		HX_STACK_LINE(404)
		this->frag_shader = this->compile((int)35632,_fragment_source,_verbose);
		HX_STACK_LINE(407)
		if (((bool((this->vert_shader == null())) || bool((this->frag_shader == null()))))){
			HX_STACK_LINE(408)
			if ((_verbose)){
				HX_STACK_LINE(409)
				HX_STACK_DO_THROW((((((HX_CSTRING("SHADER : ") + this->id) + HX_CSTRING(" \n\n ")) + this->log) + HX_CSTRING("\n")) + this->errors));
			}
			else{
				HX_STACK_LINE(411)
				HX_STACK_DO_THROW(this->errors);
			}
			HX_STACK_LINE(413)
			return false;
		}
		HX_STACK_LINE(417)
		this->program = this->link();
		HX_STACK_LINE(420)
		if (((this->program == null()))){
			HX_STACK_LINE(421)
			if ((_verbose)){
				HX_STACK_LINE(422)
				HX_STACK_DO_THROW(((this->log + HX_CSTRING("\n")) + this->errors));
			}
			else{
				HX_STACK_LINE(424)
				HX_STACK_DO_THROW(this->errors);
			}
		}
		else{
			HX_STACK_LINE(427)
			if (((bool(_verbose) && bool((this->log.length > (int)0))))){
				HX_STACK_LINE(428)
				::haxe::Log_obj::trace(this->log,hx::SourceInfo(HX_CSTRING("Shader.hx"),428,HX_CSTRING("phoenix.Shader"),HX_CSTRING("from_string")));
			}
		}
		HX_STACK_LINE(433)
		if (((this->program == null()))){
			HX_STACK_LINE(433)
			return false;
		}
		HX_STACK_LINE(437)
		return true;
	}
}


HX_DEFINE_DYNAMIC_FUNC5(Shader_obj,from_string,return )

Void Shader_obj::apply_uniforms( ){
{
		HX_STACK_FRAME("phoenix.Shader","apply_uniforms",0x384d17da,"phoenix.Shader.apply_uniforms","phoenix/Shader.hx",440,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_LINE(442)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(this->tex0_attribute,(int)0);
		HX_STACK_LINE(443)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(this->tex1_attribute,(int)1);
		HX_STACK_LINE(444)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(this->tex2_attribute,(int)2);
		HX_STACK_LINE(445)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(this->tex3_attribute,(int)3);
		HX_STACK_LINE(446)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(this->tex4_attribute,(int)4);
		HX_STACK_LINE(447)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(this->tex5_attribute,(int)5);
		HX_STACK_LINE(448)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(this->tex6_attribute,(int)6);
		HX_STACK_LINE(449)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(this->tex7_attribute,(int)7);
		HX_STACK_LINE(451)
		for(::cpp::FastIterator_obj< Dynamic > *__it = ::cpp::CreateFastIterator< Dynamic >(this->uniforms->iterator());  __it->hasNext(); ){
			Dynamic uniform = __it->next();
			{
				HX_STACK_LINE(453)
				::phoenix::UniformValueType _g = uniform->__Field(HX_CSTRING("type"),true);		HX_STACK_VAR(_g,"_g");
				HX_STACK_LINE(453)
				switch( (int)(_g->__Index())){
					case (int)0: {
						HX_STACK_LINE(455)
						this->setUniformInt(uniform->__Field(HX_CSTRING("name"),true),uniform->__Field(HX_CSTRING("value"),true),uniform->__Field(HX_CSTRING("location"),true));
					}
					;break;
					case (int)1: {
						HX_STACK_LINE(457)
						this->setUniformFloat(uniform->__Field(HX_CSTRING("name"),true),uniform->__Field(HX_CSTRING("value"),true),uniform->__Field(HX_CSTRING("location"),true));
					}
					;break;
					case (int)2: {
						HX_STACK_LINE(459)
						this->setUniformVector2(uniform->__Field(HX_CSTRING("name"),true),uniform->__Field(HX_CSTRING("value"),true),uniform->__Field(HX_CSTRING("location"),true));
					}
					;break;
					case (int)3: {
						HX_STACK_LINE(461)
						this->setUniformVector3(uniform->__Field(HX_CSTRING("name"),true),uniform->__Field(HX_CSTRING("value"),true),uniform->__Field(HX_CSTRING("location"),true));
					}
					;break;
					case (int)4: {
						HX_STACK_LINE(463)
						this->setUniformVector4(uniform->__Field(HX_CSTRING("name"),true),uniform->__Field(HX_CSTRING("value"),true),uniform->__Field(HX_CSTRING("location"),true));
					}
					;break;
					case (int)5: {
						HX_STACK_LINE(465)
						this->setUniformColor(uniform->__Field(HX_CSTRING("name"),true),uniform->__Field(HX_CSTRING("value"),true),uniform->__Field(HX_CSTRING("location"),true));
					}
					;break;
					case (int)6: {
						HX_STACK_LINE(467)
						this->setUniformTexture(uniform->__Field(HX_CSTRING("name"),true),uniform->__Field(HX_CSTRING("value"),true),uniform->__Field(HX_CSTRING("location"),true));
					}
					;break;
					case (int)7: {
					}
					;break;
				}
			}
;
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Shader_obj,apply_uniforms,(void))

int Shader_obj::getUniform( ::String uniform_name){
	HX_STACK_FRAME("phoenix.Shader","getUniform",0x50688128,"phoenix.Shader.getUniform","phoenix/Shader.hx",475,0x14ec92d9)
	HX_STACK_THIS(this)
	HX_STACK_ARG(uniform_name,"uniform_name")
	HX_STACK_LINE(475)
	return ::snow::platform::native::render::opengl::GL_obj::getUniformLocation(this->program,uniform_name);
}


HX_DEFINE_DYNAMIC_FUNC1(Shader_obj,getUniform,return )

Void Shader_obj::setUniformInt( ::String uniform_name,int value,Dynamic location){
{
		HX_STACK_FRAME("phoenix.Shader","setUniformInt",0x84cc4eb3,"phoenix.Shader.setUniformInt","phoenix/Shader.hx",479,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(uniform_name,"uniform_name")
		HX_STACK_ARG(value,"value")
		HX_STACK_ARG(location,"location")
		HX_STACK_LINE(479)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(location,value);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,setUniformInt,(void))

Void Shader_obj::setUniformFloat( ::String uniform_name,Float value,Dynamic location){
{
		HX_STACK_FRAME("phoenix.Shader","setUniformFloat",0xcffa0060,"phoenix.Shader.setUniformFloat","phoenix/Shader.hx",482,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(uniform_name,"uniform_name")
		HX_STACK_ARG(value,"value")
		HX_STACK_ARG(location,"location")
		HX_STACK_LINE(482)
		::snow::platform::native::render::opengl::GL_obj::uniform1f(location,value);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,setUniformFloat,(void))

Void Shader_obj::setUniformVector2( ::String uniform_name,::phoenix::Vector value,Dynamic location){
{
		HX_STACK_FRAME("phoenix.Shader","setUniformVector2",0x33576dd3,"phoenix.Shader.setUniformVector2","phoenix/Shader.hx",485,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(uniform_name,"uniform_name")
		HX_STACK_ARG(value,"value")
		HX_STACK_ARG(location,"location")
		HX_STACK_LINE(485)
		::snow::platform::native::render::opengl::GL_obj::uniform2f(location,value->x,value->y);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,setUniformVector2,(void))

Void Shader_obj::setUniformVector3( ::String uniform_name,::phoenix::Vector value,Dynamic location){
{
		HX_STACK_FRAME("phoenix.Shader","setUniformVector3",0x33576dd4,"phoenix.Shader.setUniformVector3","phoenix/Shader.hx",488,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(uniform_name,"uniform_name")
		HX_STACK_ARG(value,"value")
		HX_STACK_ARG(location,"location")
		HX_STACK_LINE(488)
		::snow::platform::native::render::opengl::GL_obj::uniform3f(location,value->x,value->y,value->z);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,setUniformVector3,(void))

Void Shader_obj::setUniformVector4( ::String uniform_name,::phoenix::Vector value,Dynamic location){
{
		HX_STACK_FRAME("phoenix.Shader","setUniformVector4",0x33576dd5,"phoenix.Shader.setUniformVector4","phoenix/Shader.hx",491,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(uniform_name,"uniform_name")
		HX_STACK_ARG(value,"value")
		HX_STACK_ARG(location,"location")
		HX_STACK_LINE(491)
		::snow::platform::native::render::opengl::GL_obj::uniform4f(location,value->x,value->y,value->z,value->w);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,setUniformVector4,(void))

Void Shader_obj::setUniformColor( ::String uniform_name,::phoenix::Color value,Dynamic location){
{
		HX_STACK_FRAME("phoenix.Shader","setUniformColor",0x17bfac27,"phoenix.Shader.setUniformColor","phoenix/Shader.hx",494,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(uniform_name,"uniform_name")
		HX_STACK_ARG(value,"value")
		HX_STACK_ARG(location,"location")
		HX_STACK_LINE(494)
		::snow::platform::native::render::opengl::GL_obj::uniform4f(location,value->r,value->g,value->b,value->a);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,setUniformColor,(void))

Void Shader_obj::setUniformTexture( ::String uniform_name,::phoenix::Texture value,Dynamic location){
{
		HX_STACK_FRAME("phoenix.Shader","setUniformTexture",0xf79b3c9f,"phoenix.Shader.setUniformTexture","phoenix/Shader.hx",496,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(uniform_name,"uniform_name")
		HX_STACK_ARG(value,"value")
		HX_STACK_ARG(location,"location")
		HX_STACK_LINE(497)
		::snow::platform::native::render::opengl::GL_obj::uniform1i(location,value->slot);
		HX_STACK_LINE(498)
		value->bind();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,setUniformTexture,(void))

Void Shader_obj::addLog( ::String _log){
{
		HX_STACK_FRAME("phoenix.Shader","addLog",0x9cb461cd,"phoenix.Shader.addLog","phoenix/Shader.hx",502,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_log,"_log")
		HX_STACK_LINE(502)
		hx::AddEq(this->log,_log);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Shader_obj,addLog,(void))

Void Shader_obj::addError( ::String _error){
{
		HX_STACK_FRAME("phoenix.Shader","addError",0x76207d51,"phoenix.Shader.addError","phoenix/Shader.hx",506,0x14ec92d9)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_error,"_error")
		HX_STACK_LINE(506)
		hx::AddEq(this->errors,_error);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Shader_obj,addError,(void))

::phoenix::Shader Shader_obj::load( ::String _psid,::String _vsid,Dynamic _onloaded){
	HX_STACK_FRAME("phoenix.Shader","load",0x5838a890,"phoenix.Shader.load","phoenix/Shader.hx",337,0x14ec92d9)
	HX_STACK_ARG(_psid,"_psid")
	HX_STACK_ARG(_vsid,"_vsid")
	HX_STACK_ARG(_onloaded,"_onloaded")
	HX_STACK_LINE(339)
	::String _frag_shader = HX_CSTRING("");		HX_STACK_VAR(_frag_shader,"_frag_shader");
	HX_STACK_LINE(340)
	::String _vert_shader = HX_CSTRING("");		HX_STACK_VAR(_vert_shader,"_vert_shader");
	HX_STACK_LINE(342)
	if (((bool((_vsid == HX_CSTRING("default"))) || bool((_vsid == HX_CSTRING("")))))){
		HX_STACK_LINE(343)
		_vsid = HX_CSTRING("default shader");
		HX_STACK_LINE(344)
		_vert_shader = ::Luxe_obj::renderer->default_vert_source;
	}
	else{
		HX_STACK_LINE(346)
		_vert_shader = ::Luxe_obj::loadText(_vsid,null())->text;
	}
	HX_STACK_LINE(349)
	if (((bool((_psid == HX_CSTRING("default"))) || bool((_psid == HX_CSTRING("")))))){
		HX_STACK_LINE(350)
		_psid = HX_CSTRING("default shader");
		HX_STACK_LINE(351)
		_frag_shader = ::Luxe_obj::renderer->default_frag_source;
	}
	else{
		HX_STACK_LINE(352)
		if (((_psid == HX_CSTRING("textured")))){
			HX_STACK_LINE(353)
			_psid = HX_CSTRING("default textured");
			HX_STACK_LINE(354)
			_frag_shader = ::Luxe_obj::renderer->default_frag_textured_source;
		}
		else{
			HX_STACK_LINE(356)
			_frag_shader = ::Luxe_obj::loadText(_psid,null())->text;
		}
	}
	HX_STACK_LINE(359)
	::phoenix::Shader _shader = null();		HX_STACK_VAR(_shader,"_shader");
	HX_STACK_LINE(361)
	if (((bool((_frag_shader.length > (int)0)) && bool((_vert_shader.length > (int)0))))){
		HX_STACK_LINE(363)
		::String prefixes = HX_CSTRING("");		HX_STACK_VAR(prefixes,"prefixes");
		HX_STACK_LINE(369)
		_shader = ::phoenix::Shader_obj::__new(::Luxe_obj::resources);
		HX_STACK_LINE(370)
		_shader->from_string(_vert_shader,(prefixes + _frag_shader),_psid,_vsid,false);
	}
	HX_STACK_LINE(374)
	if (((_shader != null()))){
		HX_STACK_LINE(376)
		_shader->id = ((_psid + HX_CSTRING("|")) + _vsid);
		HX_STACK_LINE(378)
		if (((_onloaded != null()))){
			HX_STACK_LINE(379)
			_onloaded(_shader).Cast< Void >();
		}
		HX_STACK_LINE(382)
		::haxe::Log_obj::trace((HX_CSTRING("   i / shader / ") + ((HX_CSTRING("shader loaded ") + _shader->id))),hx::SourceInfo(HX_CSTRING("Shader.hx"),382,HX_CSTRING("phoenix.Shader"),HX_CSTRING("load")));
		HX_STACK_LINE(384)
		return _shader;
	}
	else{
		HX_STACK_LINE(387)
		return null();
	}
	HX_STACK_LINE(374)
	return null();
}


STATIC_HX_DEFINE_DYNAMIC_FUNC3(Shader_obj,load,return )


Shader_obj::Shader_obj()
{
}

void Shader_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(Shader);
	HX_MARK_MEMBER_NAME(errors,"errors");
	HX_MARK_MEMBER_NAME(log,"log");
	HX_MARK_MEMBER_NAME(vertex_source_name,"vertex_source_name");
	HX_MARK_MEMBER_NAME(fragment_source_name,"fragment_source_name");
	HX_MARK_MEMBER_NAME(vert_shader,"vert_shader");
	HX_MARK_MEMBER_NAME(frag_shader,"frag_shader");
	HX_MARK_MEMBER_NAME(program,"program");
	HX_MARK_MEMBER_NAME(shader,"shader");
	HX_MARK_MEMBER_NAME(vert_attribute,"vert_attribute");
	HX_MARK_MEMBER_NAME(tcoord_attribute,"tcoord_attribute");
	HX_MARK_MEMBER_NAME(color_attribute,"color_attribute");
	HX_MARK_MEMBER_NAME(normal_attribute,"normal_attribute");
	HX_MARK_MEMBER_NAME(projectionmatrix_attribute,"projectionmatrix_attribute");
	HX_MARK_MEMBER_NAME(modelviewmatrix_attribute,"modelviewmatrix_attribute");
	HX_MARK_MEMBER_NAME(tex0_attribute,"tex0_attribute");
	HX_MARK_MEMBER_NAME(tex1_attribute,"tex1_attribute");
	HX_MARK_MEMBER_NAME(tex2_attribute,"tex2_attribute");
	HX_MARK_MEMBER_NAME(tex3_attribute,"tex3_attribute");
	HX_MARK_MEMBER_NAME(tex4_attribute,"tex4_attribute");
	HX_MARK_MEMBER_NAME(tex5_attribute,"tex5_attribute");
	HX_MARK_MEMBER_NAME(tex6_attribute,"tex6_attribute");
	HX_MARK_MEMBER_NAME(tex7_attribute,"tex7_attribute");
	HX_MARK_MEMBER_NAME(uniforms,"uniforms");
	HX_MARK_MEMBER_NAME(uniform_textures,"uniform_textures");
	::luxe::resource::Resource_obj::__Mark(HX_MARK_ARG);
	HX_MARK_END_CLASS();
}

void Shader_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(errors,"errors");
	HX_VISIT_MEMBER_NAME(log,"log");
	HX_VISIT_MEMBER_NAME(vertex_source_name,"vertex_source_name");
	HX_VISIT_MEMBER_NAME(fragment_source_name,"fragment_source_name");
	HX_VISIT_MEMBER_NAME(vert_shader,"vert_shader");
	HX_VISIT_MEMBER_NAME(frag_shader,"frag_shader");
	HX_VISIT_MEMBER_NAME(program,"program");
	HX_VISIT_MEMBER_NAME(shader,"shader");
	HX_VISIT_MEMBER_NAME(vert_attribute,"vert_attribute");
	HX_VISIT_MEMBER_NAME(tcoord_attribute,"tcoord_attribute");
	HX_VISIT_MEMBER_NAME(color_attribute,"color_attribute");
	HX_VISIT_MEMBER_NAME(normal_attribute,"normal_attribute");
	HX_VISIT_MEMBER_NAME(projectionmatrix_attribute,"projectionmatrix_attribute");
	HX_VISIT_MEMBER_NAME(modelviewmatrix_attribute,"modelviewmatrix_attribute");
	HX_VISIT_MEMBER_NAME(tex0_attribute,"tex0_attribute");
	HX_VISIT_MEMBER_NAME(tex1_attribute,"tex1_attribute");
	HX_VISIT_MEMBER_NAME(tex2_attribute,"tex2_attribute");
	HX_VISIT_MEMBER_NAME(tex3_attribute,"tex3_attribute");
	HX_VISIT_MEMBER_NAME(tex4_attribute,"tex4_attribute");
	HX_VISIT_MEMBER_NAME(tex5_attribute,"tex5_attribute");
	HX_VISIT_MEMBER_NAME(tex6_attribute,"tex6_attribute");
	HX_VISIT_MEMBER_NAME(tex7_attribute,"tex7_attribute");
	HX_VISIT_MEMBER_NAME(uniforms,"uniforms");
	HX_VISIT_MEMBER_NAME(uniform_textures,"uniform_textures");
	::luxe::resource::Resource_obj::__Visit(HX_VISIT_ARG);
}

Dynamic Shader_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"log") ) { return log; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"load") ) { return load_dyn(); }
		if (HX_FIELD_EQ(inName,"link") ) { return link_dyn(); }
		if (HX_FIELD_EQ(inName,"drop") ) { return drop_dyn(); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"errors") ) { return errors; }
		if (HX_FIELD_EQ(inName,"shader") ) { return shader; }
		if (HX_FIELD_EQ(inName,"addLog") ) { return addLog_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"program") ) { return program; }
		if (HX_FIELD_EQ(inName,"compile") ) { return compile_dyn(); }
		if (HX_FIELD_EQ(inName,"destroy") ) { return destroy_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"uniforms") ) { return uniforms; }
		if (HX_FIELD_EQ(inName,"activate") ) { return activate_dyn(); }
		if (HX_FIELD_EQ(inName,"addError") ) { return addError_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"deactivate") ) { return deactivate_dyn(); }
		if (HX_FIELD_EQ(inName,"getUniform") ) { return getUniform_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"vert_shader") ) { return vert_shader; }
		if (HX_FIELD_EQ(inName,"frag_shader") ) { return frag_shader; }
		if (HX_FIELD_EQ(inName,"from_string") ) { return from_string_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"setUniformInt") ) { return setUniformInt_dyn(); }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"vert_attribute") ) { return vert_attribute; }
		if (HX_FIELD_EQ(inName,"tex0_attribute") ) { return tex0_attribute; }
		if (HX_FIELD_EQ(inName,"tex1_attribute") ) { return tex1_attribute; }
		if (HX_FIELD_EQ(inName,"tex2_attribute") ) { return tex2_attribute; }
		if (HX_FIELD_EQ(inName,"tex3_attribute") ) { return tex3_attribute; }
		if (HX_FIELD_EQ(inName,"tex4_attribute") ) { return tex4_attribute; }
		if (HX_FIELD_EQ(inName,"tex5_attribute") ) { return tex5_attribute; }
		if (HX_FIELD_EQ(inName,"tex6_attribute") ) { return tex6_attribute; }
		if (HX_FIELD_EQ(inName,"tex7_attribute") ) { return tex7_attribute; }
		if (HX_FIELD_EQ(inName,"apply_uniforms") ) { return apply_uniforms_dyn(); }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"color_attribute") ) { return color_attribute; }
		if (HX_FIELD_EQ(inName,"set_uniform_int") ) { return set_uniform_int_dyn(); }
		if (HX_FIELD_EQ(inName,"setUniformFloat") ) { return setUniformFloat_dyn(); }
		if (HX_FIELD_EQ(inName,"setUniformColor") ) { return setUniformColor_dyn(); }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"tcoord_attribute") ) { return tcoord_attribute; }
		if (HX_FIELD_EQ(inName,"normal_attribute") ) { return normal_attribute; }
		if (HX_FIELD_EQ(inName,"uniform_textures") ) { return uniform_textures; }
		break;
	case 17:
		if (HX_FIELD_EQ(inName,"set_uniform_float") ) { return set_uniform_float_dyn(); }
		if (HX_FIELD_EQ(inName,"set_uniform_color") ) { return set_uniform_color_dyn(); }
		if (HX_FIELD_EQ(inName,"setUniformVector2") ) { return setUniformVector2_dyn(); }
		if (HX_FIELD_EQ(inName,"setUniformVector3") ) { return setUniformVector3_dyn(); }
		if (HX_FIELD_EQ(inName,"setUniformVector4") ) { return setUniformVector4_dyn(); }
		if (HX_FIELD_EQ(inName,"setUniformTexture") ) { return setUniformTexture_dyn(); }
		break;
	case 18:
		if (HX_FIELD_EQ(inName,"vertex_source_name") ) { return vertex_source_name; }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"set_uniform_vector2") ) { return set_uniform_vector2_dyn(); }
		if (HX_FIELD_EQ(inName,"set_uniform_vector3") ) { return set_uniform_vector3_dyn(); }
		if (HX_FIELD_EQ(inName,"set_uniform_vector4") ) { return set_uniform_vector4_dyn(); }
		if (HX_FIELD_EQ(inName,"set_uniform_texture") ) { return set_uniform_texture_dyn(); }
		break;
	case 20:
		if (HX_FIELD_EQ(inName,"fragment_source_name") ) { return fragment_source_name; }
		break;
	case 25:
		if (HX_FIELD_EQ(inName,"modelviewmatrix_attribute") ) { return modelviewmatrix_attribute; }
		break;
	case 26:
		if (HX_FIELD_EQ(inName,"projectionmatrix_attribute") ) { return projectionmatrix_attribute; }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic Shader_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"log") ) { log=inValue.Cast< ::String >(); return inValue; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"errors") ) { errors=inValue.Cast< ::String >(); return inValue; }
		if (HX_FIELD_EQ(inName,"shader") ) { shader=inValue.Cast< ::snow::platform::native::render::opengl::GLShader >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"program") ) { program=inValue.Cast< ::snow::platform::native::render::opengl::GLProgram >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"uniforms") ) { uniforms=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"vert_shader") ) { vert_shader=inValue.Cast< ::snow::platform::native::render::opengl::GLShader >(); return inValue; }
		if (HX_FIELD_EQ(inName,"frag_shader") ) { frag_shader=inValue.Cast< ::snow::platform::native::render::opengl::GLShader >(); return inValue; }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"vert_attribute") ) { vert_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tex0_attribute") ) { tex0_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tex1_attribute") ) { tex1_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tex2_attribute") ) { tex2_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tex3_attribute") ) { tex3_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tex4_attribute") ) { tex4_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tex5_attribute") ) { tex5_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tex6_attribute") ) { tex6_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tex7_attribute") ) { tex7_attribute=inValue.Cast< int >(); return inValue; }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"color_attribute") ) { color_attribute=inValue.Cast< int >(); return inValue; }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"tcoord_attribute") ) { tcoord_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"normal_attribute") ) { normal_attribute=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"uniform_textures") ) { uniform_textures=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; }
		break;
	case 18:
		if (HX_FIELD_EQ(inName,"vertex_source_name") ) { vertex_source_name=inValue.Cast< ::String >(); return inValue; }
		break;
	case 20:
		if (HX_FIELD_EQ(inName,"fragment_source_name") ) { fragment_source_name=inValue.Cast< ::String >(); return inValue; }
		break;
	case 25:
		if (HX_FIELD_EQ(inName,"modelviewmatrix_attribute") ) { modelviewmatrix_attribute=inValue.Cast< int >(); return inValue; }
		break;
	case 26:
		if (HX_FIELD_EQ(inName,"projectionmatrix_attribute") ) { projectionmatrix_attribute=inValue.Cast< int >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void Shader_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("errors"));
	outFields->push(HX_CSTRING("log"));
	outFields->push(HX_CSTRING("vertex_source_name"));
	outFields->push(HX_CSTRING("fragment_source_name"));
	outFields->push(HX_CSTRING("vert_shader"));
	outFields->push(HX_CSTRING("frag_shader"));
	outFields->push(HX_CSTRING("program"));
	outFields->push(HX_CSTRING("shader"));
	outFields->push(HX_CSTRING("vert_attribute"));
	outFields->push(HX_CSTRING("tcoord_attribute"));
	outFields->push(HX_CSTRING("color_attribute"));
	outFields->push(HX_CSTRING("normal_attribute"));
	outFields->push(HX_CSTRING("projectionmatrix_attribute"));
	outFields->push(HX_CSTRING("modelviewmatrix_attribute"));
	outFields->push(HX_CSTRING("tex0_attribute"));
	outFields->push(HX_CSTRING("tex1_attribute"));
	outFields->push(HX_CSTRING("tex2_attribute"));
	outFields->push(HX_CSTRING("tex3_attribute"));
	outFields->push(HX_CSTRING("tex4_attribute"));
	outFields->push(HX_CSTRING("tex5_attribute"));
	outFields->push(HX_CSTRING("tex6_attribute"));
	outFields->push(HX_CSTRING("tex7_attribute"));
	outFields->push(HX_CSTRING("uniforms"));
	outFields->push(HX_CSTRING("uniform_textures"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	HX_CSTRING("load"),
	String(null()) };

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsString,(int)offsetof(Shader_obj,errors),HX_CSTRING("errors")},
	{hx::fsString,(int)offsetof(Shader_obj,log),HX_CSTRING("log")},
	{hx::fsString,(int)offsetof(Shader_obj,vertex_source_name),HX_CSTRING("vertex_source_name")},
	{hx::fsString,(int)offsetof(Shader_obj,fragment_source_name),HX_CSTRING("fragment_source_name")},
	{hx::fsObject /*::snow::platform::native::render::opengl::GLShader*/ ,(int)offsetof(Shader_obj,vert_shader),HX_CSTRING("vert_shader")},
	{hx::fsObject /*::snow::platform::native::render::opengl::GLShader*/ ,(int)offsetof(Shader_obj,frag_shader),HX_CSTRING("frag_shader")},
	{hx::fsObject /*::snow::platform::native::render::opengl::GLProgram*/ ,(int)offsetof(Shader_obj,program),HX_CSTRING("program")},
	{hx::fsObject /*::snow::platform::native::render::opengl::GLShader*/ ,(int)offsetof(Shader_obj,shader),HX_CSTRING("shader")},
	{hx::fsInt,(int)offsetof(Shader_obj,vert_attribute),HX_CSTRING("vert_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tcoord_attribute),HX_CSTRING("tcoord_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,color_attribute),HX_CSTRING("color_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,normal_attribute),HX_CSTRING("normal_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,projectionmatrix_attribute),HX_CSTRING("projectionmatrix_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,modelviewmatrix_attribute),HX_CSTRING("modelviewmatrix_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tex0_attribute),HX_CSTRING("tex0_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tex1_attribute),HX_CSTRING("tex1_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tex2_attribute),HX_CSTRING("tex2_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tex3_attribute),HX_CSTRING("tex3_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tex4_attribute),HX_CSTRING("tex4_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tex5_attribute),HX_CSTRING("tex5_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tex6_attribute),HX_CSTRING("tex6_attribute")},
	{hx::fsInt,(int)offsetof(Shader_obj,tex7_attribute),HX_CSTRING("tex7_attribute")},
	{hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(Shader_obj,uniforms),HX_CSTRING("uniforms")},
	{hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(Shader_obj,uniform_textures),HX_CSTRING("uniform_textures")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("errors"),
	HX_CSTRING("log"),
	HX_CSTRING("vertex_source_name"),
	HX_CSTRING("fragment_source_name"),
	HX_CSTRING("vert_shader"),
	HX_CSTRING("frag_shader"),
	HX_CSTRING("program"),
	HX_CSTRING("shader"),
	HX_CSTRING("vert_attribute"),
	HX_CSTRING("tcoord_attribute"),
	HX_CSTRING("color_attribute"),
	HX_CSTRING("normal_attribute"),
	HX_CSTRING("projectionmatrix_attribute"),
	HX_CSTRING("modelviewmatrix_attribute"),
	HX_CSTRING("tex0_attribute"),
	HX_CSTRING("tex1_attribute"),
	HX_CSTRING("tex2_attribute"),
	HX_CSTRING("tex3_attribute"),
	HX_CSTRING("tex4_attribute"),
	HX_CSTRING("tex5_attribute"),
	HX_CSTRING("tex6_attribute"),
	HX_CSTRING("tex7_attribute"),
	HX_CSTRING("uniforms"),
	HX_CSTRING("uniform_textures"),
	HX_CSTRING("activate"),
	HX_CSTRING("deactivate"),
	HX_CSTRING("set_uniform_int"),
	HX_CSTRING("set_uniform_float"),
	HX_CSTRING("set_uniform_vector2"),
	HX_CSTRING("set_uniform_vector3"),
	HX_CSTRING("set_uniform_vector4"),
	HX_CSTRING("set_uniform_color"),
	HX_CSTRING("set_uniform_texture"),
	HX_CSTRING("compile"),
	HX_CSTRING("link"),
	HX_CSTRING("drop"),
	HX_CSTRING("destroy"),
	HX_CSTRING("from_string"),
	HX_CSTRING("apply_uniforms"),
	HX_CSTRING("getUniform"),
	HX_CSTRING("setUniformInt"),
	HX_CSTRING("setUniformFloat"),
	HX_CSTRING("setUniformVector2"),
	HX_CSTRING("setUniformVector3"),
	HX_CSTRING("setUniformVector4"),
	HX_CSTRING("setUniformColor"),
	HX_CSTRING("setUniformTexture"),
	HX_CSTRING("addLog"),
	HX_CSTRING("addError"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(Shader_obj::__mClass,"__mClass");
};

#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(Shader_obj::__mClass,"__mClass");
};

#endif

Class Shader_obj::__mClass;

void Shader_obj::__register()
{
	hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("phoenix.Shader"), hx::TCanCast< Shader_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
    , sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
    , sMemberStorageInfo
#endif
);
}

void Shader_obj::__boot()
{
}

} // end namespace phoenix
