#include <hxcpp.h>

#ifndef INCLUDED_IMap
#include <IMap.h>
#endif
#ifndef INCLUDED_Lambda
#include <Lambda.h>
#endif
#ifndef INCLUDED_Luxe
#include <Luxe.h>
#endif
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_haxe_ds_IntMap
#include <haxe/ds/IntMap.h>
#endif
#ifndef INCLUDED_haxe_io_Bytes
#include <haxe/io/Bytes.h>
#endif
#ifndef INCLUDED_hxMath
#include <hxMath.h>
#endif
#ifndef INCLUDED_luxe_resource_Resource
#include <luxe/resource/Resource.h>
#endif
#ifndef INCLUDED_luxe_structural_BalancedBST
#include <luxe/structural/BalancedBST.h>
#endif
#ifndef INCLUDED_luxe_utils_Utils
#include <luxe/utils/Utils.h>
#endif
#ifndef INCLUDED_phoenix_BatchGroup
#include <phoenix/BatchGroup.h>
#endif
#ifndef INCLUDED_phoenix_BatchState
#include <phoenix/BatchState.h>
#endif
#ifndef INCLUDED_phoenix_Batcher
#include <phoenix/Batcher.h>
#endif
#ifndef INCLUDED_phoenix_Camera
#include <phoenix/Camera.h>
#endif
#ifndef INCLUDED_phoenix_PrimitiveType
#include <phoenix/PrimitiveType.h>
#endif
#ifndef INCLUDED_phoenix_Rectangle
#include <phoenix/Rectangle.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_geometry_Geometry
#include <phoenix/geometry/Geometry.h>
#endif
#ifndef INCLUDED_phoenix_geometry_GeometryState
#include <phoenix/geometry/GeometryState.h>
#endif
#ifndef INCLUDED_phoenix_geometry_Vertex
#include <phoenix/geometry/Vertex.h>
#endif
#ifndef INCLUDED_phoenix_utils_Rendering
#include <phoenix/utils/Rendering.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_GLBuffer
#include <snow/platform/native/render/opengl/GLBuffer.h>
#endif
#ifndef INCLUDED_snow_platform_native_render_opengl_GLObject
#include <snow/platform/native/render/opengl/GLObject.h>
#endif
#ifndef INCLUDED_snow_platform_native_utils_ArrayBufferView
#include <snow/platform/native/utils/ArrayBufferView.h>
#endif
#ifndef INCLUDED_snow_platform_native_utils_ByteArray
#include <snow/platform/native/utils/ByteArray.h>
#endif
#ifndef INCLUDED_snow_platform_native_utils_Float32Array
#include <snow/platform/native/utils/Float32Array.h>
#endif
#ifndef INCLUDED_snow_utils_IDataInput
#include <snow/utils/IDataInput.h>
#endif
#ifndef INCLUDED_snow_utils_IMemoryRange
#include <snow/utils/IMemoryRange.h>
#endif
namespace phoenix{

Void Batcher_obj::__construct(::phoenix::Renderer _r,::String __o__name)
{
HX_STACK_FRAME("phoenix.Batcher","new",0x3e82c79a,"phoenix.Batcher.new","phoenix/Batcher.hx",52,0xa9541457)

HX_STACK_ARG(_r,"_r")

HX_STACK_ARG(__o__name,"_name")
::String _name = __o__name.Default(HX_CSTRING(""));
{
	HX_STACK_LINE(124)
	this->name = HX_CSTRING("");
	HX_STACK_LINE(123)
	this->log = false;
	HX_STACK_LINE(121)
	this->visible_count = (int)0;
	HX_STACK_LINE(120)
	this->static_batched_count = (int)0;
	HX_STACK_LINE(119)
	this->dynamic_batched_count = (int)0;
	HX_STACK_LINE(118)
	this->draw_calls = (int)0;
	HX_STACK_LINE(104)
	this->normal_attribute = (int)3;
	HX_STACK_LINE(103)
	this->color_attribute = (int)2;
	HX_STACK_LINE(102)
	this->tcoord_attribute = (int)1;
	HX_STACK_LINE(101)
	this->vert_attribute = (int)0;
	HX_STACK_LINE(91)
	this->vert_count = (int)0;
	HX_STACK_LINE(90)
	this->max_floats = (int)0;
	HX_STACK_LINE(89)
	this->max_verts = (int)0;
	HX_STACK_LINE(88)
	this->buffer_index = (int)0;
	HX_STACK_LINE(85)
	this->buffer_count = (int)16;
	HX_STACK_LINE(82)
	this->static_normal_floats = (int)0;
	HX_STACK_LINE(81)
	this->static_color_floats = (int)0;
	HX_STACK_LINE(80)
	this->static_tcoord_floats = (int)0;
	HX_STACK_LINE(79)
	this->static_vert_floats = (int)0;
	HX_STACK_LINE(76)
	this->normal_floats = (int)0;
	HX_STACK_LINE(75)
	this->color_floats = (int)0;
	HX_STACK_LINE(74)
	this->tcoord_floats = (int)0;
	HX_STACK_LINE(73)
	this->vert_floats = (int)0;
	HX_STACK_LINE(60)
	this->tree_changed = false;
	HX_STACK_LINE(56)
	this->enabled = true;
	HX_STACK_LINE(55)
	this->layer = (int)0;
	HX_STACK_LINE(128)
	this->id = ::Luxe_obj::utils->uniqueid();
	HX_STACK_LINE(129)
	this->renderer = _r;
	HX_STACK_LINE(131)
	this->geometry = ::luxe::structural::BalancedBST_obj::__new(this->geometry_compare_dyn());
	HX_STACK_LINE(132)
	this->groups = ::haxe::ds::IntMap_obj::__new();
	HX_STACK_LINE(134)
	this->max_verts = ::Std_obj::_int(::Math_obj::pow((int)2,(int)16));
	HX_STACK_LINE(135)
	this->max_floats = (int(this->max_verts) << int((int)2));
	HX_STACK_LINE(138)
	this->vertlist = ::snow::platform::native::utils::Float32Array_obj::__new(this->max_floats,null(),null());
	HX_STACK_LINE(139)
	this->tcoordlist = ::snow::platform::native::utils::Float32Array_obj::__new(this->max_floats,null(),null());
	HX_STACK_LINE(140)
	this->colorlist = ::snow::platform::native::utils::Float32Array_obj::__new(this->max_floats,null(),null());
	HX_STACK_LINE(141)
	this->normallist = ::snow::platform::native::utils::Float32Array_obj::__new(this->max_floats,null(),null());
	HX_STACK_LINE(143)
	this->static_vertlist = ::snow::platform::native::utils::Float32Array_obj::__new(this->max_floats,null(),null());
	HX_STACK_LINE(144)
	this->static_tcoordlist = ::snow::platform::native::utils::Float32Array_obj::__new(this->max_floats,null(),null());
	HX_STACK_LINE(145)
	this->static_colorlist = ::snow::platform::native::utils::Float32Array_obj::__new(this->max_floats,null(),null());
	HX_STACK_LINE(146)
	this->static_normallist = ::snow::platform::native::utils::Float32Array_obj::__new(this->max_floats,null(),null());
	HX_STACK_LINE(149)
	this->view = this->renderer->camera;
	HX_STACK_LINE(152)
	this->vertexBuffers = Array_obj< ::Dynamic >::__new();
	HX_STACK_LINE(153)
	this->tcoordBuffers = Array_obj< ::Dynamic >::__new();
	HX_STACK_LINE(154)
	this->vcolorBuffers = Array_obj< ::Dynamic >::__new();
	HX_STACK_LINE(155)
	this->normalBuffers = Array_obj< ::Dynamic >::__new();
	HX_STACK_LINE(157)
	{
		HX_STACK_LINE(157)
		int _g1 = (int)0;		HX_STACK_VAR(_g1,"_g1");
		HX_STACK_LINE(157)
		int _g = this->buffer_count;		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(157)
		while(((_g1 < _g))){
			HX_STACK_LINE(157)
			int i = (_g1)++;		HX_STACK_VAR(i,"i");
			HX_STACK_LINE(159)
			::snow::platform::native::render::opengl::GLBuffer _vb = ::snow::platform::native::render::opengl::GL_obj::createBuffer();		HX_STACK_VAR(_vb,"_vb");
			HX_STACK_LINE(160)
			::snow::platform::native::render::opengl::GLBuffer _tb = ::snow::platform::native::render::opengl::GL_obj::createBuffer();		HX_STACK_VAR(_tb,"_tb");
			HX_STACK_LINE(161)
			::snow::platform::native::render::opengl::GLBuffer _cb = ::snow::platform::native::render::opengl::GL_obj::createBuffer();		HX_STACK_VAR(_cb,"_cb");
			HX_STACK_LINE(162)
			::snow::platform::native::render::opengl::GLBuffer _nb = ::snow::platform::native::render::opengl::GL_obj::createBuffer();		HX_STACK_VAR(_nb,"_nb");
			HX_STACK_LINE(165)
			::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,_vb);
			HX_STACK_LINE(166)
			::snow::platform::native::render::opengl::GL_obj::bufferData((int)34962,this->vertlist,(int)35048);
			HX_STACK_LINE(168)
			::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,_tb);
			HX_STACK_LINE(169)
			::snow::platform::native::render::opengl::GL_obj::bufferData((int)34962,this->tcoordlist,(int)35048);
			HX_STACK_LINE(171)
			::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,_cb);
			HX_STACK_LINE(172)
			::snow::platform::native::render::opengl::GL_obj::bufferData((int)34962,this->colorlist,(int)35048);
			HX_STACK_LINE(174)
			::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,_nb);
			HX_STACK_LINE(175)
			::snow::platform::native::render::opengl::GL_obj::bufferData((int)34962,this->normallist,(int)35048);
			HX_STACK_LINE(177)
			this->vertexBuffers->push(_vb);
			HX_STACK_LINE(178)
			this->tcoordBuffers->push(_tb);
			HX_STACK_LINE(179)
			this->vcolorBuffers->push(_cb);
			HX_STACK_LINE(180)
			this->normalBuffers->push(_nb);
		}
	}
	HX_STACK_LINE(185)
	::snow::platform::native::render::opengl::GL_obj::enableVertexAttribArray(this->vert_attribute);
	HX_STACK_LINE(186)
	::snow::platform::native::render::opengl::GL_obj::enableVertexAttribArray(this->tcoord_attribute);
	HX_STACK_LINE(187)
	::snow::platform::native::render::opengl::GL_obj::enableVertexAttribArray(this->color_attribute);
	HX_STACK_LINE(188)
	::snow::platform::native::render::opengl::GL_obj::enableVertexAttribArray(this->normal_attribute);
	HX_STACK_LINE(191)
	if (((_name.length == (int)0))){
		HX_STACK_LINE(192)
		this->name = ::Luxe_obj::utils->uniqueid();
	}
	else{
		HX_STACK_LINE(194)
		this->name = _name;
	}
}
;
	return null();
}

//Batcher_obj::~Batcher_obj() { }

Dynamic Batcher_obj::__CreateEmpty() { return  new Batcher_obj; }
hx::ObjectPtr< Batcher_obj > Batcher_obj::__new(::phoenix::Renderer _r,::String __o__name)
{  hx::ObjectPtr< Batcher_obj > result = new Batcher_obj();
	result->__construct(_r,__o__name);
	return result;}

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

int Batcher_obj::set_layer( int _layer){
	HX_STACK_FRAME("phoenix.Batcher","set_layer",0x4cd9e8ee,"phoenix.Batcher.set_layer","phoenix/Batcher.hx",199,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_layer,"_layer")
	HX_STACK_LINE(202)
	this->layer = _layer;
	HX_STACK_LINE(204)
	this->renderer->batchers->sort(this->renderer->sort_batchers_dyn());
	HX_STACK_LINE(207)
	return this->layer;
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,set_layer,return )

::String Batcher_obj::toString( ){
	HX_STACK_FRAME("phoenix.Batcher","toString",0x2a536732,"phoenix.Batcher.toString","phoenix/Batcher.hx",212,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_LINE(212)
	return ((HX_CSTRING("Batcher(") + this->name) + HX_CSTRING(")"));
}


HX_DEFINE_DYNAMIC_FUNC0(Batcher_obj,toString,return )

int Batcher_obj::compare( ::phoenix::Batcher other){
	HX_STACK_FRAME("phoenix.Batcher","compare",0xcf1d34df,"phoenix.Batcher.compare","phoenix/Batcher.hx",216,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(other,"other")
	HX_STACK_LINE(218)
	if (((this->layer == other->layer))){
		HX_STACK_LINE(218)
		return (int)0;
	}
	HX_STACK_LINE(219)
	if (((this->layer < other->layer))){
		HX_STACK_LINE(219)
		return (int)-1;
	}
	HX_STACK_LINE(221)
	return (int)1;
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,compare,return )

Void Batcher_obj::add_group( int _group,Dynamic _pre_render,Dynamic _post_render){
{
		HX_STACK_FRAME("phoenix.Batcher","add_group",0xcf8ada1b,"phoenix.Batcher.add_group","phoenix/Batcher.hx",225,0xa9541457)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_group,"_group")
		HX_STACK_ARG(_pre_render,"_pre_render")
		HX_STACK_ARG(_post_render,"_post_render")
		HX_STACK_LINE(227)
		if ((!(this->groups->exists(_group)))){
			HX_STACK_LINE(228)
			Array< ::Dynamic > value = Array_obj< ::Dynamic >::__new();		HX_STACK_VAR(value,"value");
			HX_STACK_LINE(228)
			this->groups->set(_group,value);
		}
		HX_STACK_LINE(231)
		this->groups->get(_group)->__Field(HX_CSTRING("push"),true)(::phoenix::BatchGroup_obj::__new(_pre_render,_post_render));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC3(Batcher_obj,add_group,(void))

::String Batcher_obj::compare_rule_to_string( int r){
	HX_STACK_FRAME("phoenix.Batcher","compare_rule_to_string",0xb26938b2,"phoenix.Batcher.compare_rule_to_string","phoenix/Batcher.hx",235,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(r,"r")
	HX_STACK_LINE(236)
	switch( (int)(r)){
		case (int)0: {
			HX_STACK_LINE(238)
			return HX_CSTRING("same");
		}
		;break;
		case (int)1: {
			HX_STACK_LINE(241)
			return HX_CSTRING("depth <");
		}
		;break;
		case (int)2: {
			HX_STACK_LINE(244)
			return HX_CSTRING("depth >");
		}
		;break;
		case (int)3: {
			HX_STACK_LINE(248)
			return HX_CSTRING("shader <");
		}
		;break;
		case (int)4: {
			HX_STACK_LINE(251)
			return HX_CSTRING("shader >");
		}
		;break;
		case (int)5: {
			HX_STACK_LINE(254)
			return HX_CSTRING("shader s._ >");
		}
		;break;
		case (int)6: {
			HX_STACK_LINE(257)
			return HX_CSTRING("shader _.s <");
		}
		;break;
		case (int)7: {
			HX_STACK_LINE(261)
			return HX_CSTRING("texture <");
		}
		;break;
		case (int)8: {
			HX_STACK_LINE(264)
			return HX_CSTRING("texture >");
		}
		;break;
		case (int)9: {
			HX_STACK_LINE(267)
			return HX_CSTRING("texture t._ >");
		}
		;break;
		case (int)10: {
			HX_STACK_LINE(270)
			return HX_CSTRING("texture _.t <");
		}
		;break;
		case (int)11: {
			HX_STACK_LINE(274)
			return HX_CSTRING("primitive <");
		}
		;break;
		case (int)12: {
			HX_STACK_LINE(277)
			return HX_CSTRING("primitive >");
		}
		;break;
		case (int)13: {
			HX_STACK_LINE(280)
			return HX_CSTRING("unclipped");
		}
		;break;
		case (int)14: {
			HX_STACK_LINE(283)
			return HX_CSTRING("clipped");
		}
		;break;
		case (int)15: {
			HX_STACK_LINE(286)
			return HX_CSTRING("timestamp <");
		}
		;break;
		case (int)16: {
			HX_STACK_LINE(289)
			return HX_CSTRING("timestamp >");
		}
		;break;
		case (int)17: {
			HX_STACK_LINE(292)
			return HX_CSTRING("timestamp ==");
		}
		;break;
		case (int)18: {
			HX_STACK_LINE(295)
			return HX_CSTRING("sequence <");
		}
		;break;
		case (int)19: {
			HX_STACK_LINE(298)
			return HX_CSTRING("sequence >");
		}
		;break;
		case (int)20: {
			HX_STACK_LINE(301)
			return HX_CSTRING("fallback");
		}
		;break;
	}
	HX_STACK_LINE(305)
	return HX_CSTRING("unknown");
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,compare_rule_to_string,return )

int Batcher_obj::compare_rule( Dynamic a,Dynamic b){
	HX_STACK_FRAME("phoenix.Batcher","compare_rule",0xfee0579c,"phoenix.Batcher.compare_rule","phoenix/Batcher.hx",309,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(a,"a")
	HX_STACK_ARG(b,"b")
	HX_STACK_LINE(311)
	if (((a->__Field(HX_CSTRING("uuid"),true) == b->__Field(HX_CSTRING("uuid"),true)))){
		HX_STACK_LINE(312)
		return (int)0;
	}
	HX_STACK_LINE(315)
	if (((a->__Field(HX_CSTRING("depth"),true) < b->__Field(HX_CSTRING("depth"),true)))){
		HX_STACK_LINE(316)
		return (int)1;
	}
	HX_STACK_LINE(317)
	if (((a->__Field(HX_CSTRING("depth"),true) > b->__Field(HX_CSTRING("depth"),true)))){
		HX_STACK_LINE(318)
		return (int)2;
	}
	HX_STACK_LINE(323)
	if (((bool((a->__Field(HX_CSTRING("shader"),true) != null())) && bool((b->__Field(HX_CSTRING("shader"),true) != null()))))){
		HX_STACK_LINE(326)
		if (((a->__Field(HX_CSTRING("shader"),true)->__Field(HX_CSTRING("id"),true) < b->__Field(HX_CSTRING("shader"),true)->__Field(HX_CSTRING("id"),true)))){
			HX_STACK_LINE(327)
			return (int)3;
		}
		HX_STACK_LINE(328)
		if (((a->__Field(HX_CSTRING("shader"),true)->__Field(HX_CSTRING("id"),true) > b->__Field(HX_CSTRING("shader"),true)->__Field(HX_CSTRING("id"),true)))){
			HX_STACK_LINE(329)
			return (int)4;
		}
	}
	else{
		HX_STACK_LINE(332)
		if (((bool((a->__Field(HX_CSTRING("shader"),true) != null())) && bool((b->__Field(HX_CSTRING("shader"),true) == null()))))){
			HX_STACK_LINE(333)
			return (int)5;
		}
		else{
			HX_STACK_LINE(335)
			if (((bool((a->__Field(HX_CSTRING("shader"),true) == null())) && bool((b->__Field(HX_CSTRING("shader"),true) != null()))))){
				HX_STACK_LINE(336)
				return (int)6;
			}
		}
	}
	HX_STACK_LINE(340)
	if (((bool((a->__Field(HX_CSTRING("texture"),true) != null())) && bool((b->__Field(HX_CSTRING("texture"),true) != null()))))){
		HX_STACK_LINE(343)
		if (((a->__Field(HX_CSTRING("texture"),true)->__Field(HX_CSTRING("id"),true) < b->__Field(HX_CSTRING("texture"),true)->__Field(HX_CSTRING("id"),true)))){
			HX_STACK_LINE(344)
			return (int)7;
		}
		HX_STACK_LINE(345)
		if (((a->__Field(HX_CSTRING("texture"),true)->__Field(HX_CSTRING("id"),true) > b->__Field(HX_CSTRING("texture"),true)->__Field(HX_CSTRING("id"),true)))){
			HX_STACK_LINE(346)
			return (int)8;
		}
	}
	else{
		HX_STACK_LINE(349)
		if (((bool((a->__Field(HX_CSTRING("texture"),true) != null())) && bool((b->__Field(HX_CSTRING("texture"),true) == null()))))){
			HX_STACK_LINE(350)
			return (int)9;
		}
		else{
			HX_STACK_LINE(352)
			if (((bool((a->__Field(HX_CSTRING("texture"),true) == null())) && bool((b->__Field(HX_CSTRING("texture"),true) != null()))))){
				HX_STACK_LINE(353)
				return (int)10;
			}
		}
	}
	HX_STACK_LINE(359)
	int a_primitive_index = a->__Field(HX_CSTRING("primitive_type"),true)->__Index();		HX_STACK_VAR(a_primitive_index,"a_primitive_index");
	HX_STACK_LINE(360)
	int b_primitive_index = b->__Field(HX_CSTRING("primitive_type"),true)->__Index();		HX_STACK_VAR(b_primitive_index,"b_primitive_index");
	HX_STACK_LINE(362)
	if (((a_primitive_index < b_primitive_index))){
		HX_STACK_LINE(363)
		return (int)11;
	}
	HX_STACK_LINE(364)
	if (((a_primitive_index > b_primitive_index))){
		HX_STACK_LINE(365)
		return (int)12;
	}
	HX_STACK_LINE(368)
	if (((a->__Field(HX_CSTRING("clip"),true) != b->__Field(HX_CSTRING("clip"),true)))){
		HX_STACK_LINE(370)
		if (((bool((a->__Field(HX_CSTRING("clip"),true) == false)) && bool((b->__Field(HX_CSTRING("clip"),true) == true))))){
			HX_STACK_LINE(371)
			return (int)13;
		}
		else{
			HX_STACK_LINE(374)
			if (((bool((a->__Field(HX_CSTRING("clip"),true) == true)) && bool((b->__Field(HX_CSTRING("clip"),true) == false))))){
				HX_STACK_LINE(375)
				return (int)14;
			}
		}
	}
	HX_STACK_LINE(383)
	if (((a->__Field(HX_CSTRING("timestamp"),true) < b->__Field(HX_CSTRING("timestamp"),true)))){
		HX_STACK_LINE(384)
		return (int)15;
	}
	HX_STACK_LINE(385)
	if (((a->__Field(HX_CSTRING("timestamp"),true) > b->__Field(HX_CSTRING("timestamp"),true)))){
		HX_STACK_LINE(386)
		return (int)16;
	}
	HX_STACK_LINE(387)
	if (((a->__Field(HX_CSTRING("timestamp"),true) == b->__Field(HX_CSTRING("timestamp"),true)))){
		HX_STACK_LINE(388)
		return (int)17;
	}
	HX_STACK_LINE(390)
	if (((a->__Field(HX_CSTRING("sequence"),true) < b->__Field(HX_CSTRING("sequence"),true)))){
		HX_STACK_LINE(391)
		return (int)18;
	}
	HX_STACK_LINE(392)
	if (((a->__Field(HX_CSTRING("sequence"),true) > b->__Field(HX_CSTRING("sequence"),true)))){
		HX_STACK_LINE(393)
		return (int)19;
	}
	HX_STACK_LINE(396)
	return (int)20;
}


HX_DEFINE_DYNAMIC_FUNC2(Batcher_obj,compare_rule,return )

int Batcher_obj::geometry_compare( Dynamic a,Dynamic b){
	HX_STACK_FRAME("phoenix.Batcher","geometry_compare",0xc33f035e,"phoenix.Batcher.geometry_compare","phoenix/Batcher.hx",399,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(a,"a")
	HX_STACK_ARG(b,"b")
	HX_STACK_LINE(411)
	if (((a->__Field(HX_CSTRING("uuid"),true) == b->__Field(HX_CSTRING("uuid"),true)))){
		HX_STACK_LINE(412)
		return (int)0;
	}
	HX_STACK_LINE(415)
	if (((a->__Field(HX_CSTRING("depth"),true) < b->__Field(HX_CSTRING("depth"),true)))){
		HX_STACK_LINE(416)
		return (int)-1;
	}
	HX_STACK_LINE(417)
	if (((a->__Field(HX_CSTRING("depth"),true) > b->__Field(HX_CSTRING("depth"),true)))){
		HX_STACK_LINE(418)
		return (int)1;
	}
	HX_STACK_LINE(422)
	if (((bool((a->__Field(HX_CSTRING("shader"),true) != null())) && bool((b->__Field(HX_CSTRING("shader"),true) != null()))))){
		HX_STACK_LINE(425)
		if (((a->__Field(HX_CSTRING("shader"),true)->__Field(HX_CSTRING("id"),true) < b->__Field(HX_CSTRING("shader"),true)->__Field(HX_CSTRING("id"),true)))){
			HX_STACK_LINE(426)
			return (int)-1;
		}
		HX_STACK_LINE(427)
		if (((a->__Field(HX_CSTRING("shader"),true)->__Field(HX_CSTRING("id"),true) > b->__Field(HX_CSTRING("shader"),true)->__Field(HX_CSTRING("id"),true)))){
			HX_STACK_LINE(428)
			return (int)1;
		}
	}
	else{
		HX_STACK_LINE(431)
		if (((bool((a->__Field(HX_CSTRING("shader"),true) != null())) && bool((b->__Field(HX_CSTRING("shader"),true) == null()))))){
			HX_STACK_LINE(432)
			return (int)1;
		}
		else{
			HX_STACK_LINE(434)
			if (((bool((a->__Field(HX_CSTRING("shader"),true) == null())) && bool((b->__Field(HX_CSTRING("shader"),true) != null()))))){
				HX_STACK_LINE(435)
				return (int)-1;
			}
		}
	}
	HX_STACK_LINE(439)
	if (((bool((a->__Field(HX_CSTRING("texture"),true) != null())) && bool((b->__Field(HX_CSTRING("texture"),true) != null()))))){
		HX_STACK_LINE(442)
		if (((a->__Field(HX_CSTRING("texture"),true)->__Field(HX_CSTRING("id"),true) < b->__Field(HX_CSTRING("texture"),true)->__Field(HX_CSTRING("id"),true)))){
			HX_STACK_LINE(443)
			return (int)-1;
		}
		HX_STACK_LINE(444)
		if (((a->__Field(HX_CSTRING("texture"),true)->__Field(HX_CSTRING("id"),true) > b->__Field(HX_CSTRING("texture"),true)->__Field(HX_CSTRING("id"),true)))){
			HX_STACK_LINE(445)
			return (int)1;
		}
	}
	else{
		HX_STACK_LINE(448)
		if (((bool((a->__Field(HX_CSTRING("texture"),true) != null())) && bool((b->__Field(HX_CSTRING("texture"),true) == null()))))){
			HX_STACK_LINE(449)
			return (int)1;
		}
		else{
			HX_STACK_LINE(451)
			if (((bool((a->__Field(HX_CSTRING("texture"),true) == null())) && bool((b->__Field(HX_CSTRING("texture"),true) != null()))))){
				HX_STACK_LINE(452)
				return (int)-1;
			}
		}
	}
	HX_STACK_LINE(457)
	int a_primitive_index = a->__Field(HX_CSTRING("primitive_type"),true)->__Index();		HX_STACK_VAR(a_primitive_index,"a_primitive_index");
	HX_STACK_LINE(458)
	int b_primitive_index = b->__Field(HX_CSTRING("primitive_type"),true)->__Index();		HX_STACK_VAR(b_primitive_index,"b_primitive_index");
	HX_STACK_LINE(460)
	if (((a_primitive_index < b_primitive_index))){
		HX_STACK_LINE(461)
		return (int)-1;
	}
	HX_STACK_LINE(462)
	if (((a_primitive_index > b_primitive_index))){
		HX_STACK_LINE(463)
		return (int)1;
	}
	HX_STACK_LINE(466)
	if (((a->__Field(HX_CSTRING("clip"),true) != b->__Field(HX_CSTRING("clip"),true)))){
		HX_STACK_LINE(468)
		if (((bool((a->__Field(HX_CSTRING("clip"),true) == false)) && bool((b->__Field(HX_CSTRING("clip"),true) == true))))){
			HX_STACK_LINE(469)
			return (int)1;
		}
		else{
			HX_STACK_LINE(472)
			if (((bool((a->__Field(HX_CSTRING("clip"),true) == true)) && bool((b->__Field(HX_CSTRING("clip"),true) == false))))){
				HX_STACK_LINE(473)
				return (int)-1;
			}
		}
	}
	HX_STACK_LINE(481)
	if (((a->__Field(HX_CSTRING("timestamp"),true) < b->__Field(HX_CSTRING("timestamp"),true)))){
		HX_STACK_LINE(482)
		return (int)-1;
	}
	HX_STACK_LINE(483)
	if (((a->__Field(HX_CSTRING("timestamp"),true) >= b->__Field(HX_CSTRING("timestamp"),true)))){
		HX_STACK_LINE(484)
		return (int)1;
	}
	HX_STACK_LINE(485)
	if (((a->__Field(HX_CSTRING("sequence"),true) < b->__Field(HX_CSTRING("sequence"),true)))){
		HX_STACK_LINE(486)
		return (int)-1;
	}
	HX_STACK_LINE(487)
	if (((a->__Field(HX_CSTRING("sequence"),true) > b->__Field(HX_CSTRING("sequence"),true)))){
		HX_STACK_LINE(488)
		return (int)1;
	}
	HX_STACK_LINE(491)
	return (int)1;
}


HX_DEFINE_DYNAMIC_FUNC2(Batcher_obj,geometry_compare,return )

Void Batcher_obj::list_geometry( ){
{
		HX_STACK_FRAME("phoenix.Batcher","list_geometry",0x542e65ad,"phoenix.Batcher.list_geometry","phoenix/Batcher.hx",496,0xa9541457)
		HX_STACK_THIS(this)
		HX_STACK_LINE(496)
		for(::cpp::FastIterator_obj< ::phoenix::geometry::Geometry > *__it = ::cpp::CreateFastIterator< ::phoenix::geometry::Geometry >(this->geometry->iterator());  __it->hasNext(); ){
			::phoenix::geometry::Geometry geom = __it->next();
			Dynamic();
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Batcher_obj,list_geometry,(void))

Void Batcher_obj::add( ::phoenix::geometry::Geometry _geom,hx::Null< bool >  __o__force_add){
bool _force_add = __o__force_add.Default(false);
	HX_STACK_FRAME("phoenix.Batcher","add",0x3e78e95b,"phoenix.Batcher.add","phoenix/Batcher.hx",508,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_geom,"_geom")
	HX_STACK_ARG(_force_add,"_force_add")
{
		HX_STACK_LINE(508)
		if (((  ((!(((this->geometry->find(_geom->key) == null()))))) ? bool(_force_add) : bool(true) ))){
			HX_STACK_LINE(511)
			if ((!(::Lambda_obj::has(_geom->batchers,hx::ObjectPtr<OBJ_>(this))))){
				HX_STACK_LINE(512)
				_geom->batchers->push(hx::ObjectPtr<OBJ_>(this));
			}
			HX_STACK_LINE(516)
			this->geometry->insert(_geom->key,_geom);
			HX_STACK_LINE(519)
			_geom->added = true;
			HX_STACK_LINE(522)
			this->tree_changed = true;
		}
		else{
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Batcher_obj,add,(void))

Void Batcher_obj::remove( ::phoenix::geometry::Geometry _geom,Dynamic __o__remove_batcher_from_geometry){
Dynamic _remove_batcher_from_geometry = __o__remove_batcher_from_geometry.Default(true);
	HX_STACK_FRAME("phoenix.Batcher","remove",0xc124654a,"phoenix.Batcher.remove","phoenix/Batcher.hx",533,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_geom,"_geom")
	HX_STACK_ARG(_remove_batcher_from_geometry,"_remove_batcher_from_geometry")
{
		HX_STACK_LINE(535)
		if ((_remove_batcher_from_geometry)){
			HX_STACK_LINE(536)
			_geom->batchers->remove(hx::ObjectPtr<OBJ_>(this));
			HX_STACK_LINE(537)
			if (((_geom->batchers->length == (int)0))){
				HX_STACK_LINE(538)
				_geom->added = false;
			}
		}
		HX_STACK_LINE(542)
		int countbefore = this->geometry->size();		HX_STACK_VAR(countbefore,"countbefore");
		HX_STACK_LINE(544)
		this->geometry->remove(_geom->key);
		HX_STACK_LINE(546)
		int countafter = this->geometry->size();		HX_STACK_VAR(countafter,"countafter");
		HX_STACK_LINE(548)
		if (((countbefore == countafter))){
		}
		HX_STACK_LINE(553)
		this->tree_changed = true;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Batcher_obj,remove,(void))

Void Batcher_obj::shader_activate( ::phoenix::Shader _shader){
{
		HX_STACK_FRAME("phoenix.Batcher","shader_activate",0x1836ad87,"phoenix.Batcher.shader_activate","phoenix/Batcher.hx",557,0xa9541457)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_shader,"_shader")
		HX_STACK_LINE(560)
		_shader->activate();
		HX_STACK_LINE(563)
		this->projectionmatrix_attribute = _shader->projectionmatrix_attribute;
		HX_STACK_LINE(564)
		this->modelviewmatrix_attribute = _shader->modelviewmatrix_attribute;
		HX_STACK_LINE(567)
		this->tex0_attribute = _shader->tex0_attribute;
		HX_STACK_LINE(568)
		this->tex1_attribute = _shader->tex1_attribute;
		HX_STACK_LINE(569)
		this->tex2_attribute = _shader->tex2_attribute;
		HX_STACK_LINE(570)
		this->tex3_attribute = _shader->tex3_attribute;
		HX_STACK_LINE(571)
		this->tex4_attribute = _shader->tex4_attribute;
		HX_STACK_LINE(572)
		this->tex5_attribute = _shader->tex5_attribute;
		HX_STACK_LINE(573)
		this->tex6_attribute = _shader->tex6_attribute;
		HX_STACK_LINE(574)
		this->tex7_attribute = _shader->tex7_attribute;
		HX_STACK_LINE(577)
		_shader->apply_uniforms();
		HX_STACK_LINE(580)
		::Luxe_obj::renderer->state->activeTexture((int)33984);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,shader_activate,(void))

Void Batcher_obj::batch( hx::Null< bool >  __o_persist_immediate){
bool persist_immediate = __o_persist_immediate.Default(false);
	HX_STACK_FRAME("phoenix.Batcher","batch",0x0f01a174,"phoenix.Batcher.batch","phoenix/Batcher.hx",588,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(persist_immediate,"persist_immediate")
{
		HX_STACK_LINE(591)
		this->dynamic_batched_count = (int)0;
		HX_STACK_LINE(592)
		this->static_batched_count = (int)0;
		HX_STACK_LINE(593)
		this->visible_count = (int)0;
		HX_STACK_LINE(595)
		this->vert_floats = (int)0;
		HX_STACK_LINE(596)
		this->tcoord_floats = (int)0;
		HX_STACK_LINE(597)
		this->color_floats = (int)0;
		HX_STACK_LINE(598)
		this->normal_floats = (int)0;
		HX_STACK_LINE(601)
		this->state = ::phoenix::BatchState_obj::__new(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(603)
		::phoenix::geometry::Geometry geom = null();		HX_STACK_VAR(geom,"geom");
		HX_STACK_LINE(606)
		for(::cpp::FastIterator_obj< ::phoenix::geometry::Geometry > *__it = ::cpp::CreateFastIterator< ::phoenix::geometry::Geometry >(this->geometry->iterator());  __it->hasNext(); ){
			::phoenix::geometry::Geometry _geom = __it->next();
			{
				HX_STACK_LINE(609)
				geom = _geom;
				HX_STACK_LINE(612)
				if (((bool((geom != null())) && bool(!(geom->dropped))))){
					HX_STACK_LINE(615)
					if ((this->state->update(geom))){
						HX_STACK_LINE(619)
						if (((this->vert_floats > (int)0))){
							HX_STACK_LINE(620)
							this->submit_current_vertex_list(this->state->last_geom_state->primitive_type);
						}
					}
					HX_STACK_LINE(626)
					this->state->activate(hx::ObjectPtr<OBJ_>(this));
					HX_STACK_LINE(628)
					if ((geom->visible)){
						HX_STACK_LINE(630)
						(this->visible_count)++;
						HX_STACK_LINE(633)
						if ((geom->get_locked())){
							HX_STACK_LINE(634)
							this->submit_static_geometry(geom);
							HX_STACK_LINE(635)
							hx::AddEq(this->vert_count,geom->vertices->length);
						}
						else{
							HX_STACK_LINE(639)
							if (((  ((!(((  ((!(((  ((!(((geom->get_primitive_type() == ::phoenix::PrimitiveType_obj::line_strip))))) ? bool((geom->get_primitive_type() == ::phoenix::PrimitiveType_obj::line_loop)) : bool(true) ))))) ? bool((geom->get_primitive_type() == ::phoenix::PrimitiveType_obj::triangle_strip)) : bool(true) ))))) ? bool((geom->get_primitive_type() == ::phoenix::PrimitiveType_obj::triangle_fan)) : bool(true) ))){
								HX_STACK_LINE(646)
								this->geometry_batch(geom);
								HX_STACK_LINE(648)
								this->submit_current_vertex_list(geom->get_primitive_type());
								HX_STACK_LINE(650)
								hx::AddEq(this->vert_count,geom->vertices->length);
							}
							else{
								HX_STACK_LINE(657)
								this->geometry_batch(geom);
								HX_STACK_LINE(660)
								(this->dynamic_batched_count)++;
								HX_STACK_LINE(661)
								hx::AddEq(this->vert_count,geom->vertices->length);
							}
						}
						HX_STACK_LINE(668)
						if (((bool(!(persist_immediate)) && bool(geom->immediate)))){
							HX_STACK_LINE(669)
							geom->drop(null());
						}
					}
				}
				else{
				}
			}
;
		}
		HX_STACK_LINE(682)
		if (((bool((this->vert_floats > (int)0)) && bool((geom != null()))))){
			HX_STACK_LINE(685)
			this->state->update(geom);
			HX_STACK_LINE(687)
			this->state->activate(hx::ObjectPtr<OBJ_>(this));
			HX_STACK_LINE(689)
			this->submit_current_vertex_list(this->state->last_geom_state->primitive_type);
		}
		HX_STACK_LINE(694)
		this->state->deactivate(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(696)
		this->state = null();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,batch,(void))

Void Batcher_obj::draw( Dynamic __o_persist_immediate){
Dynamic persist_immediate = __o_persist_immediate.Default(false);
	HX_STACK_FRAME("phoenix.Batcher","draw",0x6d59878a,"phoenix.Batcher.draw","phoenix/Batcher.hx",700,0xa9541457)
	HX_STACK_THIS(this)
	HX_STACK_ARG(persist_immediate,"persist_immediate")
{
		HX_STACK_LINE(703)
		this->draw_calls = (int)0;
		HX_STACK_LINE(704)
		this->vert_count = (int)0;
		HX_STACK_LINE(707)
		this->view->process();
		HX_STACK_LINE(712)
		::phoenix::Rectangle _g = this->view->get_viewport();		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(712)
		::phoenix::Rectangle _g1 = this->view->get_viewport();		HX_STACK_VAR(_g1,"_g1");
		HX_STACK_LINE(712)
		::phoenix::Rectangle _g2 = this->view->get_viewport();		HX_STACK_VAR(_g2,"_g2");
		HX_STACK_LINE(712)
		this->renderer->state->viewport(_g->x,_g1->y,_g2->w,this->view->get_viewport()->h);
		HX_STACK_LINE(715)
		this->batch(persist_immediate);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,draw,(void))

Void Batcher_obj::submit_static_geometry( ::phoenix::geometry::Geometry geom){
{
		HX_STACK_FRAME("phoenix.Batcher","submit_static_geometry",0x9aab1742,"phoenix.Batcher.submit_static_geometry","phoenix/Batcher.hx",719,0xa9541457)
		HX_STACK_THIS(this)
		HX_STACK_ARG(geom,"geom")
		HX_STACK_LINE(722)
		if (((geom->vertices->length == (int)0))){
			HX_STACK_LINE(723)
			return null();
		}
		HX_STACK_LINE(727)
		this->static_vert_floats = (int)0;
		HX_STACK_LINE(727)
		this->static_tcoord_floats = (int)0;
		HX_STACK_LINE(727)
		this->static_color_floats = (int)0;
		HX_STACK_LINE(727)
		this->static_normal_floats = (int)0;
		HX_STACK_LINE(729)
		if (((  ((!((!(geom->submitted))))) ? bool(geom->get_dirty()) : bool(true) ))){
			HX_STACK_LINE(732)
			this->geometry_batch_static(geom);
		}
		else{
			HX_STACK_LINE(736)
			this->static_vert_floats = (geom->vertices->length * (int)4);
			HX_STACK_LINE(737)
			this->static_tcoord_floats = (geom->vertices->length * (int)4);
			HX_STACK_LINE(738)
			this->static_color_floats = (geom->vertices->length * (int)4);
			HX_STACK_LINE(739)
			this->static_normal_floats = (geom->vertices->length * (int)4);
		}
		HX_STACK_LINE(744)
		if (((geom->static_vertex_buffer == null()))){
			HX_STACK_LINE(745)
			geom->static_vertex_buffer = ::snow::platform::native::render::opengl::GL_obj::createBuffer();
			HX_STACK_LINE(746)
			geom->static_tcoord_buffer = ::snow::platform::native::render::opengl::GL_obj::createBuffer();
			HX_STACK_LINE(747)
			geom->static_vcolor_buffer = ::snow::platform::native::render::opengl::GL_obj::createBuffer();
			HX_STACK_LINE(748)
			geom->static_normal_buffer = ::snow::platform::native::render::opengl::GL_obj::createBuffer();
		}
		HX_STACK_LINE(752)
		this->_enable_attributes();
		HX_STACK_LINE(755)
		::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,geom->static_vertex_buffer);
		HX_STACK_LINE(756)
		::snow::platform::native::render::opengl::GL_obj::vertexAttribPointer(this->vert_attribute,(int)4,(int)5126,false,(int)0,(int)0);
		HX_STACK_LINE(758)
		if (((  ((!((!(geom->submitted))))) ? bool(geom->get_dirty()) : bool(true) ))){
			HX_STACK_LINE(759)
			::snow::platform::native::render::opengl::GL_obj::bufferData((int)34962,this->static_vertlist,(int)35044);
		}
		HX_STACK_LINE(763)
		::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,geom->static_tcoord_buffer);
		HX_STACK_LINE(764)
		::snow::platform::native::render::opengl::GL_obj::vertexAttribPointer(this->tcoord_attribute,(int)4,(int)5126,false,(int)0,(int)0);
		HX_STACK_LINE(766)
		if (((  ((!((!(geom->submitted))))) ? bool(geom->get_dirty()) : bool(true) ))){
			HX_STACK_LINE(767)
			::snow::platform::native::render::opengl::GL_obj::bufferData((int)34962,this->static_tcoordlist,(int)35044);
		}
		HX_STACK_LINE(771)
		::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,geom->static_vcolor_buffer);
		HX_STACK_LINE(772)
		::snow::platform::native::render::opengl::GL_obj::vertexAttribPointer(this->color_attribute,(int)4,(int)5126,false,(int)0,(int)0);
		HX_STACK_LINE(774)
		if (((  ((!((!(geom->submitted))))) ? bool(geom->get_dirty()) : bool(true) ))){
			HX_STACK_LINE(775)
			::snow::platform::native::render::opengl::GL_obj::bufferData((int)34962,this->static_colorlist,(int)35044);
		}
		HX_STACK_LINE(779)
		::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,geom->static_normal_buffer);
		HX_STACK_LINE(780)
		::snow::platform::native::render::opengl::GL_obj::vertexAttribPointer(this->normal_attribute,(int)4,(int)5126,false,(int)0,(int)0);
		HX_STACK_LINE(782)
		if (((  ((!((!(geom->submitted))))) ? bool(geom->get_dirty()) : bool(true) ))){
			HX_STACK_LINE(783)
			::snow::platform::native::render::opengl::GL_obj::bufferData((int)34962,this->static_normallist,(int)35044);
		}
		HX_STACK_LINE(788)
		int _g = ::phoenix::utils::Rendering_obj::get_opengl_primitive_type(geom->get_primitive_type());		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(787)
		::snow::platform::native::render::opengl::GL_obj::drawArrays(_g,(int)0,::phoenix::utils::Rendering_obj::get_elements_for_type(geom->get_primitive_type(),this->static_vert_floats));
		HX_STACK_LINE(793)
		this->_disable_attributes();
		HX_STACK_LINE(795)
		(this->draw_calls)++;
		HX_STACK_LINE(796)
		(this->static_batched_count)++;
		HX_STACK_LINE(799)
		this->static_vert_floats = (int)0;
		HX_STACK_LINE(800)
		this->static_tcoord_floats = (int)0;
		HX_STACK_LINE(801)
		this->static_color_floats = (int)0;
		HX_STACK_LINE(802)
		this->static_normal_floats = (int)0;
		HX_STACK_LINE(805)
		geom->set_dirty(false);
		HX_STACK_LINE(806)
		geom->submitted = true;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,submit_static_geometry,(void))

Void Batcher_obj::submit_current_vertex_list( ::phoenix::PrimitiveType type){
{
		HX_STACK_FRAME("phoenix.Batcher","submit_current_vertex_list",0x67dd8932,"phoenix.Batcher.submit_current_vertex_list","phoenix/Batcher.hx",811,0xa9541457)
		HX_STACK_THIS(this)
		HX_STACK_ARG(type,"type")
		HX_STACK_LINE(813)
		if (((this->vert_floats == (int)0))){
			HX_STACK_LINE(815)
			return null();
		}
		HX_STACK_LINE(818)
		if (((this->vert_floats > this->max_floats))){
			HX_STACK_LINE(819)
			HX_STACK_DO_THROW(HX_CSTRING("uh oh, somehow too many floats are being submitted (max:$max_floats, attempt:$vert_floats)."));
		}
		HX_STACK_LINE(823)
		this->_enable_attributes();
		HX_STACK_LINE(825)
		::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,this->vertexBuffers->__get(this->buffer_index).StaticCast< ::snow::platform::native::render::opengl::GLBuffer >());
		HX_STACK_LINE(826)
		::snow::platform::native::render::opengl::GL_obj::vertexAttribPointer((int)0,(int)4,(int)5126,false,(int)0,(int)0);
		HX_STACK_LINE(827)
		::snow::platform::native::render::opengl::GL_obj::bufferSubData((int)34962,(int)0,::snow::platform::native::utils::Float32Array_obj::__new(this->vertlist->buffer,(int)0,this->vert_floats));
		HX_STACK_LINE(829)
		::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,this->tcoordBuffers->__get(this->buffer_index).StaticCast< ::snow::platform::native::render::opengl::GLBuffer >());
		HX_STACK_LINE(830)
		::snow::platform::native::render::opengl::GL_obj::vertexAttribPointer((int)1,(int)4,(int)5126,false,(int)0,(int)0);
		HX_STACK_LINE(831)
		::snow::platform::native::render::opengl::GL_obj::bufferSubData((int)34962,(int)0,::snow::platform::native::utils::Float32Array_obj::__new(this->tcoordlist->buffer,(int)0,this->tcoord_floats));
		HX_STACK_LINE(833)
		::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,this->vcolorBuffers->__get(this->buffer_index).StaticCast< ::snow::platform::native::render::opengl::GLBuffer >());
		HX_STACK_LINE(834)
		::snow::platform::native::render::opengl::GL_obj::vertexAttribPointer((int)2,(int)4,(int)5126,false,(int)0,(int)0);
		HX_STACK_LINE(835)
		::snow::platform::native::render::opengl::GL_obj::bufferSubData((int)34962,(int)0,::snow::platform::native::utils::Float32Array_obj::__new(this->colorlist->buffer,(int)0,this->color_floats));
		HX_STACK_LINE(837)
		::snow::platform::native::render::opengl::GL_obj::bindBuffer((int)34962,this->normalBuffers->__get(this->buffer_index).StaticCast< ::snow::platform::native::render::opengl::GLBuffer >());
		HX_STACK_LINE(838)
		::snow::platform::native::render::opengl::GL_obj::vertexAttribPointer((int)3,(int)4,(int)5126,false,(int)0,(int)0);
		HX_STACK_LINE(839)
		::snow::platform::native::render::opengl::GL_obj::bufferSubData((int)34962,(int)0,::snow::platform::native::utils::Float32Array_obj::__new(this->normallist->buffer,(int)0,this->normal_floats));
		HX_STACK_LINE(843)
		int _g = ::phoenix::utils::Rendering_obj::get_opengl_primitive_type(type);		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(842)
		::snow::platform::native::render::opengl::GL_obj::drawArrays(_g,(int)0,::phoenix::utils::Rendering_obj::get_elements_for_type(type,this->vert_floats));
		HX_STACK_LINE(848)
		this->_disable_attributes();
		HX_STACK_LINE(851)
		(this->buffer_index)++;
		HX_STACK_LINE(852)
		if (((this->buffer_index >= this->buffer_count))){
			HX_STACK_LINE(853)
			this->buffer_index = (int)0;
		}
		HX_STACK_LINE(857)
		this->vert_floats = (int)0;
		HX_STACK_LINE(857)
		this->tcoord_floats = (int)0;
		HX_STACK_LINE(857)
		this->color_floats = (int)0;
		HX_STACK_LINE(857)
		this->normal_floats = (int)0;
		HX_STACK_LINE(859)
		(this->draw_calls)++;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,submit_current_vertex_list,(void))

Void Batcher_obj::geometry_batch( ::phoenix::geometry::Geometry geom){
{
		HX_STACK_FRAME("phoenix.Batcher","geometry_batch",0x429a8233,"phoenix.Batcher.geometry_batch","phoenix/Batcher.hx",865,0xa9541457)
		HX_STACK_THIS(this)
		HX_STACK_ARG(geom,"geom")
		HX_STACK_LINE(868)
		Float _count_after = (geom->vertices->length + (Float(this->vert_floats) / Float((int)4)));		HX_STACK_VAR(_count_after,"_count_after");
		HX_STACK_LINE(871)
		if (((_count_after > this->max_verts))){
			HX_STACK_LINE(872)
			this->submit_current_vertex_list(geom->get_primitive_type());
		}
		HX_STACK_LINE(875)
		geom->batch(this->vert_floats,this->tcoord_floats,this->color_floats,this->normal_floats,this->vertlist,this->tcoordlist,this->colorlist,this->normallist);
		HX_STACK_LINE(880)
		hx::AddEq(this->vert_floats,(geom->vertices->length * (int)4));
		HX_STACK_LINE(881)
		hx::AddEq(this->tcoord_floats,(geom->vertices->length * (int)4));
		HX_STACK_LINE(882)
		hx::AddEq(this->color_floats,(geom->vertices->length * (int)4));
		HX_STACK_LINE(883)
		hx::AddEq(this->normal_floats,(geom->vertices->length * (int)4));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,geometry_batch,(void))

Void Batcher_obj::geometry_batch_static( ::phoenix::geometry::Geometry geom){
{
		HX_STACK_FRAME("phoenix.Batcher","geometry_batch_static",0x1c19687a,"phoenix.Batcher.geometry_batch_static","phoenix/Batcher.hx",887,0xa9541457)
		HX_STACK_THIS(this)
		HX_STACK_ARG(geom,"geom")
		HX_STACK_LINE(889)
		geom->batch(this->static_vert_floats,this->static_tcoord_floats,this->static_color_floats,this->static_normal_floats,this->static_vertlist,this->static_tcoordlist,this->static_colorlist,this->static_normallist);
		HX_STACK_LINE(894)
		hx::AddEq(this->static_vert_floats,(geom->vertices->length * (int)4));
		HX_STACK_LINE(895)
		hx::AddEq(this->static_tcoord_floats,(geom->vertices->length * (int)4));
		HX_STACK_LINE(896)
		hx::AddEq(this->static_color_floats,(geom->vertices->length * (int)4));
		HX_STACK_LINE(897)
		hx::AddEq(this->static_normal_floats,(geom->vertices->length * (int)4));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Batcher_obj,geometry_batch_static,(void))

Void Batcher_obj::_enable_attributes( ){
{
		HX_STACK_FRAME("phoenix.Batcher","_enable_attributes",0x53897f1a,"phoenix.Batcher._enable_attributes","phoenix/Batcher.hx",903,0xa9541457)
		HX_STACK_THIS(this)
		HX_STACK_LINE(906)
		::snow::platform::native::render::opengl::GL_obj::uniformMatrix4fv(this->projectionmatrix_attribute,false,this->view->projection_float32array);
		HX_STACK_LINE(907)
		::snow::platform::native::render::opengl::GL_obj::uniformMatrix4fv(this->modelviewmatrix_attribute,false,this->view->view_inverse_float32array);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Batcher_obj,_enable_attributes,(void))

Void Batcher_obj::_disable_attributes( ){
{
		HX_STACK_FRAME("phoenix.Batcher","_disable_attributes",0xe5fa1467,"phoenix.Batcher._disable_attributes","phoenix/Batcher.hx",911,0xa9541457)
		HX_STACK_THIS(this)
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Batcher_obj,_disable_attributes,(void))


Batcher_obj::Batcher_obj()
{
}

void Batcher_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(Batcher);
	HX_MARK_MEMBER_NAME(id,"id");
	HX_MARK_MEMBER_NAME(layer,"layer");
	HX_MARK_MEMBER_NAME(enabled,"enabled");
	HX_MARK_MEMBER_NAME(geometry,"geometry");
	HX_MARK_MEMBER_NAME(groups,"groups");
	HX_MARK_MEMBER_NAME(tree_changed,"tree_changed");
	HX_MARK_MEMBER_NAME(vertlist,"vertlist");
	HX_MARK_MEMBER_NAME(tcoordlist,"tcoordlist");
	HX_MARK_MEMBER_NAME(colorlist,"colorlist");
	HX_MARK_MEMBER_NAME(normallist,"normallist");
	HX_MARK_MEMBER_NAME(static_vertlist,"static_vertlist");
	HX_MARK_MEMBER_NAME(static_tcoordlist,"static_tcoordlist");
	HX_MARK_MEMBER_NAME(static_colorlist,"static_colorlist");
	HX_MARK_MEMBER_NAME(static_normallist,"static_normallist");
	HX_MARK_MEMBER_NAME(vert_floats,"vert_floats");
	HX_MARK_MEMBER_NAME(tcoord_floats,"tcoord_floats");
	HX_MARK_MEMBER_NAME(color_floats,"color_floats");
	HX_MARK_MEMBER_NAME(normal_floats,"normal_floats");
	HX_MARK_MEMBER_NAME(static_vert_floats,"static_vert_floats");
	HX_MARK_MEMBER_NAME(static_tcoord_floats,"static_tcoord_floats");
	HX_MARK_MEMBER_NAME(static_color_floats,"static_color_floats");
	HX_MARK_MEMBER_NAME(static_normal_floats,"static_normal_floats");
	HX_MARK_MEMBER_NAME(buffer_count,"buffer_count");
	HX_MARK_MEMBER_NAME(buffer_index,"buffer_index");
	HX_MARK_MEMBER_NAME(max_verts,"max_verts");
	HX_MARK_MEMBER_NAME(max_floats,"max_floats");
	HX_MARK_MEMBER_NAME(vert_count,"vert_count");
	HX_MARK_MEMBER_NAME(vertexBuffers,"vertexBuffers");
	HX_MARK_MEMBER_NAME(tcoordBuffers,"tcoordBuffers");
	HX_MARK_MEMBER_NAME(vcolorBuffers,"vcolorBuffers");
	HX_MARK_MEMBER_NAME(normalBuffers,"normalBuffers");
	HX_MARK_MEMBER_NAME(projectionmatrix_attribute,"projectionmatrix_attribute");
	HX_MARK_MEMBER_NAME(modelviewmatrix_attribute,"modelviewmatrix_attribute");
	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(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(renderer,"renderer");
	HX_MARK_MEMBER_NAME(view,"view");
	HX_MARK_MEMBER_NAME(draw_calls,"draw_calls");
	HX_MARK_MEMBER_NAME(dynamic_batched_count,"dynamic_batched_count");
	HX_MARK_MEMBER_NAME(static_batched_count,"static_batched_count");
	HX_MARK_MEMBER_NAME(visible_count,"visible_count");
	HX_MARK_MEMBER_NAME(log,"log");
	HX_MARK_MEMBER_NAME(name,"name");
	HX_MARK_MEMBER_NAME(state,"state");
	HX_MARK_END_CLASS();
}

void Batcher_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(id,"id");
	HX_VISIT_MEMBER_NAME(layer,"layer");
	HX_VISIT_MEMBER_NAME(enabled,"enabled");
	HX_VISIT_MEMBER_NAME(geometry,"geometry");
	HX_VISIT_MEMBER_NAME(groups,"groups");
	HX_VISIT_MEMBER_NAME(tree_changed,"tree_changed");
	HX_VISIT_MEMBER_NAME(vertlist,"vertlist");
	HX_VISIT_MEMBER_NAME(tcoordlist,"tcoordlist");
	HX_VISIT_MEMBER_NAME(colorlist,"colorlist");
	HX_VISIT_MEMBER_NAME(normallist,"normallist");
	HX_VISIT_MEMBER_NAME(static_vertlist,"static_vertlist");
	HX_VISIT_MEMBER_NAME(static_tcoordlist,"static_tcoordlist");
	HX_VISIT_MEMBER_NAME(static_colorlist,"static_colorlist");
	HX_VISIT_MEMBER_NAME(static_normallist,"static_normallist");
	HX_VISIT_MEMBER_NAME(vert_floats,"vert_floats");
	HX_VISIT_MEMBER_NAME(tcoord_floats,"tcoord_floats");
	HX_VISIT_MEMBER_NAME(color_floats,"color_floats");
	HX_VISIT_MEMBER_NAME(normal_floats,"normal_floats");
	HX_VISIT_MEMBER_NAME(static_vert_floats,"static_vert_floats");
	HX_VISIT_MEMBER_NAME(static_tcoord_floats,"static_tcoord_floats");
	HX_VISIT_MEMBER_NAME(static_color_floats,"static_color_floats");
	HX_VISIT_MEMBER_NAME(static_normal_floats,"static_normal_floats");
	HX_VISIT_MEMBER_NAME(buffer_count,"buffer_count");
	HX_VISIT_MEMBER_NAME(buffer_index,"buffer_index");
	HX_VISIT_MEMBER_NAME(max_verts,"max_verts");
	HX_VISIT_MEMBER_NAME(max_floats,"max_floats");
	HX_VISIT_MEMBER_NAME(vert_count,"vert_count");
	HX_VISIT_MEMBER_NAME(vertexBuffers,"vertexBuffers");
	HX_VISIT_MEMBER_NAME(tcoordBuffers,"tcoordBuffers");
	HX_VISIT_MEMBER_NAME(vcolorBuffers,"vcolorBuffers");
	HX_VISIT_MEMBER_NAME(normalBuffers,"normalBuffers");
	HX_VISIT_MEMBER_NAME(projectionmatrix_attribute,"projectionmatrix_attribute");
	HX_VISIT_MEMBER_NAME(modelviewmatrix_attribute,"modelviewmatrix_attribute");
	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(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(renderer,"renderer");
	HX_VISIT_MEMBER_NAME(view,"view");
	HX_VISIT_MEMBER_NAME(draw_calls,"draw_calls");
	HX_VISIT_MEMBER_NAME(dynamic_batched_count,"dynamic_batched_count");
	HX_VISIT_MEMBER_NAME(static_batched_count,"static_batched_count");
	HX_VISIT_MEMBER_NAME(visible_count,"visible_count");
	HX_VISIT_MEMBER_NAME(log,"log");
	HX_VISIT_MEMBER_NAME(name,"name");
	HX_VISIT_MEMBER_NAME(state,"state");
}

Dynamic Batcher_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 2:
		if (HX_FIELD_EQ(inName,"id") ) { return id; }
		break;
	case 3:
		if (HX_FIELD_EQ(inName,"log") ) { return log; }
		if (HX_FIELD_EQ(inName,"add") ) { return add_dyn(); }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"view") ) { return view; }
		if (HX_FIELD_EQ(inName,"name") ) { return name; }
		if (HX_FIELD_EQ(inName,"draw") ) { return draw_dyn(); }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"layer") ) { return layer; }
		if (HX_FIELD_EQ(inName,"state") ) { return state; }
		if (HX_FIELD_EQ(inName,"batch") ) { return batch_dyn(); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"groups") ) { return groups; }
		if (HX_FIELD_EQ(inName,"remove") ) { return remove_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"enabled") ) { return enabled; }
		if (HX_FIELD_EQ(inName,"compare") ) { return compare_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"geometry") ) { return geometry; }
		if (HX_FIELD_EQ(inName,"vertlist") ) { return vertlist; }
		if (HX_FIELD_EQ(inName,"renderer") ) { return renderer; }
		if (HX_FIELD_EQ(inName,"toString") ) { return toString_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"colorlist") ) { return colorlist; }
		if (HX_FIELD_EQ(inName,"max_verts") ) { return max_verts; }
		if (HX_FIELD_EQ(inName,"set_layer") ) { return set_layer_dyn(); }
		if (HX_FIELD_EQ(inName,"add_group") ) { return add_group_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"tcoordlist") ) { return tcoordlist; }
		if (HX_FIELD_EQ(inName,"normallist") ) { return normallist; }
		if (HX_FIELD_EQ(inName,"max_floats") ) { return max_floats; }
		if (HX_FIELD_EQ(inName,"vert_count") ) { return vert_count; }
		if (HX_FIELD_EQ(inName,"draw_calls") ) { return draw_calls; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"vert_floats") ) { return vert_floats; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"tree_changed") ) { return tree_changed; }
		if (HX_FIELD_EQ(inName,"color_floats") ) { return color_floats; }
		if (HX_FIELD_EQ(inName,"buffer_count") ) { return buffer_count; }
		if (HX_FIELD_EQ(inName,"buffer_index") ) { return buffer_index; }
		if (HX_FIELD_EQ(inName,"compare_rule") ) { return compare_rule_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"tcoord_floats") ) { return tcoord_floats; }
		if (HX_FIELD_EQ(inName,"normal_floats") ) { return normal_floats; }
		if (HX_FIELD_EQ(inName,"vertexBuffers") ) { return vertexBuffers; }
		if (HX_FIELD_EQ(inName,"tcoordBuffers") ) { return tcoordBuffers; }
		if (HX_FIELD_EQ(inName,"vcolorBuffers") ) { return vcolorBuffers; }
		if (HX_FIELD_EQ(inName,"normalBuffers") ) { return normalBuffers; }
		if (HX_FIELD_EQ(inName,"visible_count") ) { return visible_count; }
		if (HX_FIELD_EQ(inName,"list_geometry") ) { return list_geometry_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,"geometry_batch") ) { return geometry_batch_dyn(); }
		break;
	case 15:
		if (HX_FIELD_EQ(inName,"static_vertlist") ) { return static_vertlist; }
		if (HX_FIELD_EQ(inName,"color_attribute") ) { return color_attribute; }
		if (HX_FIELD_EQ(inName,"shader_activate") ) { return shader_activate_dyn(); }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"static_colorlist") ) { return static_colorlist; }
		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,"geometry_compare") ) { return geometry_compare_dyn(); }
		break;
	case 17:
		if (HX_FIELD_EQ(inName,"static_tcoordlist") ) { return static_tcoordlist; }
		if (HX_FIELD_EQ(inName,"static_normallist") ) { return static_normallist; }
		break;
	case 18:
		if (HX_FIELD_EQ(inName,"static_vert_floats") ) { return static_vert_floats; }
		if (HX_FIELD_EQ(inName,"_enable_attributes") ) { return _enable_attributes_dyn(); }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"static_color_floats") ) { return static_color_floats; }
		if (HX_FIELD_EQ(inName,"_disable_attributes") ) { return _disable_attributes_dyn(); }
		break;
	case 20:
		if (HX_FIELD_EQ(inName,"static_tcoord_floats") ) { return static_tcoord_floats; }
		if (HX_FIELD_EQ(inName,"static_normal_floats") ) { return static_normal_floats; }
		if (HX_FIELD_EQ(inName,"static_batched_count") ) { return static_batched_count; }
		break;
	case 21:
		if (HX_FIELD_EQ(inName,"dynamic_batched_count") ) { return dynamic_batched_count; }
		if (HX_FIELD_EQ(inName,"geometry_batch_static") ) { return geometry_batch_static_dyn(); }
		break;
	case 22:
		if (HX_FIELD_EQ(inName,"compare_rule_to_string") ) { return compare_rule_to_string_dyn(); }
		if (HX_FIELD_EQ(inName,"submit_static_geometry") ) { return submit_static_geometry_dyn(); }
		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; }
		if (HX_FIELD_EQ(inName,"submit_current_vertex_list") ) { return submit_current_vertex_list_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic Batcher_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 2:
		if (HX_FIELD_EQ(inName,"id") ) { id=inValue.Cast< ::String >(); return inValue; }
		break;
	case 3:
		if (HX_FIELD_EQ(inName,"log") ) { log=inValue.Cast< bool >(); return inValue; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"view") ) { view=inValue.Cast< ::phoenix::Camera >(); return inValue; }
		if (HX_FIELD_EQ(inName,"name") ) { name=inValue.Cast< ::String >(); return inValue; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"layer") ) { if (inCallProp) return set_layer(inValue);layer=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"state") ) { state=inValue.Cast< ::phoenix::BatchState >(); return inValue; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"groups") ) { groups=inValue.Cast< ::haxe::ds::IntMap >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"enabled") ) { enabled=inValue.Cast< bool >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"geometry") ) { geometry=inValue.Cast< ::luxe::structural::BalancedBST >(); return inValue; }
		if (HX_FIELD_EQ(inName,"vertlist") ) { vertlist=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		if (HX_FIELD_EQ(inName,"renderer") ) { renderer=inValue.Cast< ::phoenix::Renderer >(); return inValue; }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"colorlist") ) { colorlist=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		if (HX_FIELD_EQ(inName,"max_verts") ) { max_verts=inValue.Cast< int >(); return inValue; }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"tcoordlist") ) { tcoordlist=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		if (HX_FIELD_EQ(inName,"normallist") ) { normallist=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		if (HX_FIELD_EQ(inName,"max_floats") ) { max_floats=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"vert_count") ) { vert_count=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"draw_calls") ) { draw_calls=inValue.Cast< int >(); return inValue; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"vert_floats") ) { vert_floats=inValue.Cast< int >(); return inValue; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"tree_changed") ) { tree_changed=inValue.Cast< bool >(); return inValue; }
		if (HX_FIELD_EQ(inName,"color_floats") ) { color_floats=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"buffer_count") ) { buffer_count=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"buffer_index") ) { buffer_index=inValue.Cast< int >(); return inValue; }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"tcoord_floats") ) { tcoord_floats=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"normal_floats") ) { normal_floats=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"vertexBuffers") ) { vertexBuffers=inValue.Cast< Array< ::Dynamic > >(); return inValue; }
		if (HX_FIELD_EQ(inName,"tcoordBuffers") ) { tcoordBuffers=inValue.Cast< Array< ::Dynamic > >(); return inValue; }
		if (HX_FIELD_EQ(inName,"vcolorBuffers") ) { vcolorBuffers=inValue.Cast< Array< ::Dynamic > >(); return inValue; }
		if (HX_FIELD_EQ(inName,"normalBuffers") ) { normalBuffers=inValue.Cast< Array< ::Dynamic > >(); return inValue; }
		if (HX_FIELD_EQ(inName,"visible_count") ) { visible_count=inValue.Cast< int >(); 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,"static_vertlist") ) { static_vertlist=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		if (HX_FIELD_EQ(inName,"color_attribute") ) { color_attribute=inValue.Cast< int >(); return inValue; }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"static_colorlist") ) { static_colorlist=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		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; }
		break;
	case 17:
		if (HX_FIELD_EQ(inName,"static_tcoordlist") ) { static_tcoordlist=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		if (HX_FIELD_EQ(inName,"static_normallist") ) { static_normallist=inValue.Cast< ::snow::platform::native::utils::Float32Array >(); return inValue; }
		break;
	case 18:
		if (HX_FIELD_EQ(inName,"static_vert_floats") ) { static_vert_floats=inValue.Cast< int >(); return inValue; }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"static_color_floats") ) { static_color_floats=inValue.Cast< int >(); return inValue; }
		break;
	case 20:
		if (HX_FIELD_EQ(inName,"static_tcoord_floats") ) { static_tcoord_floats=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"static_normal_floats") ) { static_normal_floats=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"static_batched_count") ) { static_batched_count=inValue.Cast< int >(); return inValue; }
		break;
	case 21:
		if (HX_FIELD_EQ(inName,"dynamic_batched_count") ) { dynamic_batched_count=inValue.Cast< int >(); 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 Batcher_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("id"));
	outFields->push(HX_CSTRING("layer"));
	outFields->push(HX_CSTRING("enabled"));
	outFields->push(HX_CSTRING("geometry"));
	outFields->push(HX_CSTRING("groups"));
	outFields->push(HX_CSTRING("tree_changed"));
	outFields->push(HX_CSTRING("vertlist"));
	outFields->push(HX_CSTRING("tcoordlist"));
	outFields->push(HX_CSTRING("colorlist"));
	outFields->push(HX_CSTRING("normallist"));
	outFields->push(HX_CSTRING("static_vertlist"));
	outFields->push(HX_CSTRING("static_tcoordlist"));
	outFields->push(HX_CSTRING("static_colorlist"));
	outFields->push(HX_CSTRING("static_normallist"));
	outFields->push(HX_CSTRING("vert_floats"));
	outFields->push(HX_CSTRING("tcoord_floats"));
	outFields->push(HX_CSTRING("color_floats"));
	outFields->push(HX_CSTRING("normal_floats"));
	outFields->push(HX_CSTRING("static_vert_floats"));
	outFields->push(HX_CSTRING("static_tcoord_floats"));
	outFields->push(HX_CSTRING("static_color_floats"));
	outFields->push(HX_CSTRING("static_normal_floats"));
	outFields->push(HX_CSTRING("buffer_count"));
	outFields->push(HX_CSTRING("buffer_index"));
	outFields->push(HX_CSTRING("max_verts"));
	outFields->push(HX_CSTRING("max_floats"));
	outFields->push(HX_CSTRING("vert_count"));
	outFields->push(HX_CSTRING("vertexBuffers"));
	outFields->push(HX_CSTRING("tcoordBuffers"));
	outFields->push(HX_CSTRING("vcolorBuffers"));
	outFields->push(HX_CSTRING("normalBuffers"));
	outFields->push(HX_CSTRING("projectionmatrix_attribute"));
	outFields->push(HX_CSTRING("modelviewmatrix_attribute"));
	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("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("renderer"));
	outFields->push(HX_CSTRING("view"));
	outFields->push(HX_CSTRING("draw_calls"));
	outFields->push(HX_CSTRING("dynamic_batched_count"));
	outFields->push(HX_CSTRING("static_batched_count"));
	outFields->push(HX_CSTRING("visible_count"));
	outFields->push(HX_CSTRING("log"));
	outFields->push(HX_CSTRING("name"));
	outFields->push(HX_CSTRING("state"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsString,(int)offsetof(Batcher_obj,id),HX_CSTRING("id")},
	{hx::fsInt,(int)offsetof(Batcher_obj,layer),HX_CSTRING("layer")},
	{hx::fsBool,(int)offsetof(Batcher_obj,enabled),HX_CSTRING("enabled")},
	{hx::fsObject /*::luxe::structural::BalancedBST*/ ,(int)offsetof(Batcher_obj,geometry),HX_CSTRING("geometry")},
	{hx::fsObject /*::haxe::ds::IntMap*/ ,(int)offsetof(Batcher_obj,groups),HX_CSTRING("groups")},
	{hx::fsBool,(int)offsetof(Batcher_obj,tree_changed),HX_CSTRING("tree_changed")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Batcher_obj,vertlist),HX_CSTRING("vertlist")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Batcher_obj,tcoordlist),HX_CSTRING("tcoordlist")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Batcher_obj,colorlist),HX_CSTRING("colorlist")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Batcher_obj,normallist),HX_CSTRING("normallist")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Batcher_obj,static_vertlist),HX_CSTRING("static_vertlist")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Batcher_obj,static_tcoordlist),HX_CSTRING("static_tcoordlist")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Batcher_obj,static_colorlist),HX_CSTRING("static_colorlist")},
	{hx::fsObject /*::snow::platform::native::utils::Float32Array*/ ,(int)offsetof(Batcher_obj,static_normallist),HX_CSTRING("static_normallist")},
	{hx::fsInt,(int)offsetof(Batcher_obj,vert_floats),HX_CSTRING("vert_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tcoord_floats),HX_CSTRING("tcoord_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,color_floats),HX_CSTRING("color_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,normal_floats),HX_CSTRING("normal_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,static_vert_floats),HX_CSTRING("static_vert_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,static_tcoord_floats),HX_CSTRING("static_tcoord_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,static_color_floats),HX_CSTRING("static_color_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,static_normal_floats),HX_CSTRING("static_normal_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,buffer_count),HX_CSTRING("buffer_count")},
	{hx::fsInt,(int)offsetof(Batcher_obj,buffer_index),HX_CSTRING("buffer_index")},
	{hx::fsInt,(int)offsetof(Batcher_obj,max_verts),HX_CSTRING("max_verts")},
	{hx::fsInt,(int)offsetof(Batcher_obj,max_floats),HX_CSTRING("max_floats")},
	{hx::fsInt,(int)offsetof(Batcher_obj,vert_count),HX_CSTRING("vert_count")},
	{hx::fsObject /*Array< ::Dynamic >*/ ,(int)offsetof(Batcher_obj,vertexBuffers),HX_CSTRING("vertexBuffers")},
	{hx::fsObject /*Array< ::Dynamic >*/ ,(int)offsetof(Batcher_obj,tcoordBuffers),HX_CSTRING("tcoordBuffers")},
	{hx::fsObject /*Array< ::Dynamic >*/ ,(int)offsetof(Batcher_obj,vcolorBuffers),HX_CSTRING("vcolorBuffers")},
	{hx::fsObject /*Array< ::Dynamic >*/ ,(int)offsetof(Batcher_obj,normalBuffers),HX_CSTRING("normalBuffers")},
	{hx::fsInt,(int)offsetof(Batcher_obj,projectionmatrix_attribute),HX_CSTRING("projectionmatrix_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,modelviewmatrix_attribute),HX_CSTRING("modelviewmatrix_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,vert_attribute),HX_CSTRING("vert_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tcoord_attribute),HX_CSTRING("tcoord_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,color_attribute),HX_CSTRING("color_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,normal_attribute),HX_CSTRING("normal_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tex0_attribute),HX_CSTRING("tex0_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tex1_attribute),HX_CSTRING("tex1_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tex2_attribute),HX_CSTRING("tex2_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tex3_attribute),HX_CSTRING("tex3_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tex4_attribute),HX_CSTRING("tex4_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tex5_attribute),HX_CSTRING("tex5_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tex6_attribute),HX_CSTRING("tex6_attribute")},
	{hx::fsInt,(int)offsetof(Batcher_obj,tex7_attribute),HX_CSTRING("tex7_attribute")},
	{hx::fsObject /*::phoenix::Renderer*/ ,(int)offsetof(Batcher_obj,renderer),HX_CSTRING("renderer")},
	{hx::fsObject /*::phoenix::Camera*/ ,(int)offsetof(Batcher_obj,view),HX_CSTRING("view")},
	{hx::fsInt,(int)offsetof(Batcher_obj,draw_calls),HX_CSTRING("draw_calls")},
	{hx::fsInt,(int)offsetof(Batcher_obj,dynamic_batched_count),HX_CSTRING("dynamic_batched_count")},
	{hx::fsInt,(int)offsetof(Batcher_obj,static_batched_count),HX_CSTRING("static_batched_count")},
	{hx::fsInt,(int)offsetof(Batcher_obj,visible_count),HX_CSTRING("visible_count")},
	{hx::fsBool,(int)offsetof(Batcher_obj,log),HX_CSTRING("log")},
	{hx::fsString,(int)offsetof(Batcher_obj,name),HX_CSTRING("name")},
	{hx::fsObject /*::phoenix::BatchState*/ ,(int)offsetof(Batcher_obj,state),HX_CSTRING("state")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("id"),
	HX_CSTRING("layer"),
	HX_CSTRING("enabled"),
	HX_CSTRING("geometry"),
	HX_CSTRING("groups"),
	HX_CSTRING("tree_changed"),
	HX_CSTRING("vertlist"),
	HX_CSTRING("tcoordlist"),
	HX_CSTRING("colorlist"),
	HX_CSTRING("normallist"),
	HX_CSTRING("static_vertlist"),
	HX_CSTRING("static_tcoordlist"),
	HX_CSTRING("static_colorlist"),
	HX_CSTRING("static_normallist"),
	HX_CSTRING("vert_floats"),
	HX_CSTRING("tcoord_floats"),
	HX_CSTRING("color_floats"),
	HX_CSTRING("normal_floats"),
	HX_CSTRING("static_vert_floats"),
	HX_CSTRING("static_tcoord_floats"),
	HX_CSTRING("static_color_floats"),
	HX_CSTRING("static_normal_floats"),
	HX_CSTRING("buffer_count"),
	HX_CSTRING("buffer_index"),
	HX_CSTRING("max_verts"),
	HX_CSTRING("max_floats"),
	HX_CSTRING("vert_count"),
	HX_CSTRING("vertexBuffers"),
	HX_CSTRING("tcoordBuffers"),
	HX_CSTRING("vcolorBuffers"),
	HX_CSTRING("normalBuffers"),
	HX_CSTRING("projectionmatrix_attribute"),
	HX_CSTRING("modelviewmatrix_attribute"),
	HX_CSTRING("vert_attribute"),
	HX_CSTRING("tcoord_attribute"),
	HX_CSTRING("color_attribute"),
	HX_CSTRING("normal_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("renderer"),
	HX_CSTRING("view"),
	HX_CSTRING("draw_calls"),
	HX_CSTRING("dynamic_batched_count"),
	HX_CSTRING("static_batched_count"),
	HX_CSTRING("visible_count"),
	HX_CSTRING("log"),
	HX_CSTRING("name"),
	HX_CSTRING("set_layer"),
	HX_CSTRING("toString"),
	HX_CSTRING("compare"),
	HX_CSTRING("add_group"),
	HX_CSTRING("compare_rule_to_string"),
	HX_CSTRING("compare_rule"),
	HX_CSTRING("geometry_compare"),
	HX_CSTRING("list_geometry"),
	HX_CSTRING("add"),
	HX_CSTRING("remove"),
	HX_CSTRING("shader_activate"),
	HX_CSTRING("state"),
	HX_CSTRING("batch"),
	HX_CSTRING("draw"),
	HX_CSTRING("submit_static_geometry"),
	HX_CSTRING("submit_current_vertex_list"),
	HX_CSTRING("geometry_batch"),
	HX_CSTRING("geometry_batch_static"),
	HX_CSTRING("_enable_attributes"),
	HX_CSTRING("_disable_attributes"),
	String(null()) };

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

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

#endif

Class Batcher_obj::__mClass;

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

void Batcher_obj::__boot()
{
}

} // end namespace phoenix
