#include <hxcpp.h>

#ifndef INCLUDED_Luxe
#include <Luxe.h>
#endif
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_haxe_Resource
#include <haxe/Resource.h>
#endif
#ifndef INCLUDED_luxe_Core
#include <luxe/Core.h>
#endif
#ifndef INCLUDED_luxe_Screen
#include <luxe/Screen.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_phoenix_Batcher
#include <phoenix/Batcher.h>
#endif
#ifndef INCLUDED_phoenix_BitmapFont
#include <phoenix/BitmapFont.h>
#endif
#ifndef INCLUDED_phoenix_BlendMode
#include <phoenix/BlendMode.h>
#endif
#ifndef INCLUDED_phoenix_Camera
#include <phoenix/Camera.h>
#endif
#ifndef INCLUDED_phoenix_Color
#include <phoenix/Color.h>
#endif
#ifndef INCLUDED_phoenix_FilterType
#include <phoenix/FilterType.h>
#endif
#ifndef INCLUDED_phoenix_RenderPath
#include <phoenix/RenderPath.h>
#endif
#ifndef INCLUDED_phoenix_RenderState
#include <phoenix/RenderState.h>
#endif
#ifndef INCLUDED_phoenix_RenderTexture
#include <phoenix/RenderTexture.h>
#endif
#ifndef INCLUDED_phoenix_Renderer
#include <phoenix/Renderer.h>
#endif
#ifndef INCLUDED_phoenix_RendererStats
#include <phoenix/RendererStats.h>
#endif
#ifndef INCLUDED_phoenix_Shader
#include <phoenix/Shader.h>
#endif
#ifndef INCLUDED_phoenix_Texture
#include <phoenix/Texture.h>
#endif
#ifndef INCLUDED_phoenix_Vector
#include <phoenix/Vector.h>
#endif
#ifndef INCLUDED_phoenix_utils_Rendering
#include <phoenix/utils/Rendering.h>
#endif
#ifndef INCLUDED_snow_App
#include <snow/App.h>
#endif
#ifndef INCLUDED_snow_Snow
#include <snow/Snow.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_GLFBO
#include <snow/platform/native/render/opengl/GLFBO.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_GLRBO
#include <snow/platform/native/render/opengl/GLRBO.h>
#endif
#ifndef INCLUDED_snow_window_Window
#include <snow/window/Window.h>
#endif
#ifndef INCLUDED_snow_window_Windowing
#include <snow/window/Windowing.h>
#endif
namespace phoenix{

Void Renderer_obj::__construct(::luxe::Core _core)
{
HX_STACK_FRAME("phoenix.Renderer","new",0x1fe39014,"phoenix.Renderer.new","phoenix/Renderer.hx",34,0x3d4c7b7b)

HX_STACK_ARG(_core,"_core")
{
	HX_STACK_LINE(66)
	this->stop_count = (int)0;
	HX_STACK_LINE(65)
	this->stop = false;
	HX_STACK_LINE(64)
	this->should_clear = true;
	HX_STACK_LINE(73)
	this->core = _core;
	HX_STACK_LINE(78)
	{
		HX_STACK_LINE(78)
		Dynamic _id = ::snow::platform::native::render::opengl::GL_obj::getParameter((int)36006);		HX_STACK_VAR(_id,"_id");
		HX_STACK_LINE(78)
		{
			HX_STACK_LINE(78)
			int _id1 = ::Std_obj::_int(_id);		HX_STACK_VAR(_id1,"_id1");
			HX_STACK_LINE(78)
			this->default_fbo = ::snow::platform::native::render::opengl::GLFBO_obj::__new(_id1);
		}
	}
	HX_STACK_LINE(79)
	{
		HX_STACK_LINE(79)
		Dynamic _id = ::snow::platform::native::render::opengl::GL_obj::getParameter((int)36007);		HX_STACK_VAR(_id,"_id");
		HX_STACK_LINE(79)
		{
			HX_STACK_LINE(79)
			int _id1 = ::Std_obj::_int(_id);		HX_STACK_VAR(_id1,"_id1");
			HX_STACK_LINE(79)
			this->default_rbo = ::snow::platform::native::render::opengl::GLRBO_obj::__new(_id1);
		}
	}
	HX_STACK_LINE(138)
	Dynamic();
}
;
	return null();
}

//Renderer_obj::~Renderer_obj() { }

Dynamic Renderer_obj::__CreateEmpty() { return  new Renderer_obj; }
hx::ObjectPtr< Renderer_obj > Renderer_obj::__new(::luxe::Core _core)
{  hx::ObjectPtr< Renderer_obj > result = new Renderer_obj();
	result->__construct(_core);
	return result;}

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

Void Renderer_obj::init( ){
{
		HX_STACK_FRAME("phoenix.Renderer","init",0xc3f338dc,"phoenix.Renderer.init","phoenix/Renderer.hx",86,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_LINE(88)
		this->state = ::phoenix::RenderState_obj::__new(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(89)
		this->clear_color = ::phoenix::Color_obj::__new(null(),null(),null(),null())->rgb((int)1710618);
		HX_STACK_LINE(90)
		this->stats = ::phoenix::RendererStats_obj::__new();
		HX_STACK_LINE(92)
		this->resource_manager = ::luxe::resource::ResourceManager_obj::__new();
		HX_STACK_LINE(93)
		this->batchers = Array_obj< ::Dynamic >::__new();
		HX_STACK_LINE(96)
		::luxe::Screen _g = ::Luxe_obj::get_screen();		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(96)
		this->target_size = ::phoenix::Vector_obj::__new(_g->w,::Luxe_obj::get_screen()->h,null(),null());
		HX_STACK_LINE(97)
		this->camera = ::phoenix::Camera_obj::__new(null());
		HX_STACK_LINE(99)
		this->default_render_path = ::phoenix::RenderPath_obj::__new(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(101)
		this->render_path = this->default_render_path;
		HX_STACK_LINE(104)
		this->create_default_shaders();
		HX_STACK_LINE(107)
		this->batcher = ::phoenix::Batcher_obj::__new(hx::ObjectPtr<OBJ_>(this),HX_CSTRING("default batcher"));
		HX_STACK_LINE(108)
		this->batcher->set_layer((int)1);
		HX_STACK_LINE(109)
		this->add_batch(this->batcher);
		HX_STACK_LINE(113)
		this->create_default_font();
		HX_STACK_LINE(117)
		if (((this->core->app->window->config->__Field(HX_CSTRING("depth_bits"),true) > (int)0))){
			HX_STACK_LINE(119)
			::snow::platform::native::render::opengl::GL_obj::enable((int)2929);
			HX_STACK_LINE(121)
			::snow::platform::native::render::opengl::GL_obj::depthFunc((int)515);
			HX_STACK_LINE(123)
			::snow::platform::native::render::opengl::GL_obj::clearDepth(1.0);
		}
		HX_STACK_LINE(127)
		::snow::platform::native::render::opengl::GL_obj::enable((int)3042);
		HX_STACK_LINE(128)
		::snow::platform::native::render::opengl::GL_obj::blendFunc((int)770,(int)771);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Renderer_obj,init,(void))

Void Renderer_obj::destroy( ){
{
		HX_STACK_FRAME("phoenix.Renderer","destroy",0xe481d6ae,"phoenix.Renderer.destroy","phoenix/Renderer.hx",139,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_LINE(139)
		this->clear(::phoenix::Color_obj::__new(null(),null(),null(),null())->rgb((int)16729099));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Renderer_obj,destroy,(void))

int Renderer_obj::sort_batchers( ::phoenix::Batcher a,::phoenix::Batcher b){
	HX_STACK_FRAME("phoenix.Renderer","sort_batchers",0x489f0ce1,"phoenix.Renderer.sort_batchers","phoenix/Renderer.hx",143,0x3d4c7b7b)
	HX_STACK_THIS(this)
	HX_STACK_ARG(a,"a")
	HX_STACK_ARG(b,"b")
	HX_STACK_LINE(144)
	if (((a->layer < b->layer))){
		HX_STACK_LINE(144)
		return (int)-1;
	}
	HX_STACK_LINE(145)
	if (((a->layer >= b->layer))){
		HX_STACK_LINE(145)
		return (int)1;
	}
	HX_STACK_LINE(146)
	return (int)1;
}


HX_DEFINE_DYNAMIC_FUNC2(Renderer_obj,sort_batchers,return )

Void Renderer_obj::add_batch( ::phoenix::Batcher batch){
{
		HX_STACK_FRAME("phoenix.Renderer","add_batch",0xa2b26e90,"phoenix.Renderer.add_batch","phoenix/Renderer.hx",149,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_ARG(batch,"batch")
		HX_STACK_LINE(151)
		this->batchers->push(batch);
		HX_STACK_LINE(152)
		this->batchers->sort(this->sort_batchers_dyn());
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Renderer_obj,add_batch,(void))

Void Renderer_obj::remove_batch( ::phoenix::Batcher batch){
{
		HX_STACK_FRAME("phoenix.Renderer","remove_batch",0x9e98000b,"phoenix.Renderer.remove_batch","phoenix/Renderer.hx",158,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_ARG(batch,"batch")
		HX_STACK_LINE(158)
		this->batchers->remove(batch);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Renderer_obj,remove_batch,(void))

::phoenix::Batcher Renderer_obj::create_batcher( Dynamic options){
	HX_STACK_FRAME("phoenix.Renderer","create_batcher",0xfc84f3f0,"phoenix.Renderer.create_batcher","phoenix/Renderer.hx",163,0x3d4c7b7b)
	HX_STACK_THIS(this)
	HX_STACK_ARG(options,"options")
	HX_STACK_LINE(165)
	int _new_batcher_layer = (int)2;		HX_STACK_VAR(_new_batcher_layer,"_new_batcher_layer");
	HX_STACK_LINE(167)
	if (((options != null()))){
		HX_STACK_LINE(169)
		if (((options->__Field(HX_CSTRING("name"),true) == null()))){
			HX_STACK_LINE(170)
			options->__FieldRef(HX_CSTRING("name")) = HX_CSTRING("batcher");
		}
		HX_STACK_LINE(172)
		if (((options->__Field(HX_CSTRING("layer"),true) == null()))){
			HX_STACK_LINE(173)
			options->__FieldRef(HX_CSTRING("layer")) = _new_batcher_layer;
		}
		HX_STACK_LINE(175)
		if (((options->__Field(HX_CSTRING("camera"),true) == null()))){
			HX_STACK_LINE(176)
			options->__FieldRef(HX_CSTRING("camera")) = ::phoenix::Camera_obj::__new(null());
		}
	}
	else{
		struct _Function_2_1{
			inline static Dynamic Block( int &_new_batcher_layer){
				HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","phoenix/Renderer.hx",180,0x3d4c7b7b)
				{
					hx::Anon __result = hx::Anon_obj::Create();
					__result->Add(HX_CSTRING("name") , HX_CSTRING("batcher"),false);
					__result->Add(HX_CSTRING("camera") , ::phoenix::Camera_obj::__new(null()),false);
					__result->Add(HX_CSTRING("layer") , _new_batcher_layer,false);
					return __result;
				}
				return null();
			}
		};
		HX_STACK_LINE(180)
		options = _Function_2_1::Block(_new_batcher_layer);
	}
	HX_STACK_LINE(187)
	::phoenix::Batcher _batcher = ::phoenix::Batcher_obj::__new(hx::ObjectPtr<OBJ_>(this),options->__Field(HX_CSTRING("name"),true));		HX_STACK_VAR(_batcher,"_batcher");
	HX_STACK_LINE(188)
	_batcher->view = options->__Field(HX_CSTRING("camera"),true);
	HX_STACK_LINE(189)
	_batcher->set_layer(options->__Field(HX_CSTRING("layer"),true));
	HX_STACK_LINE(191)
	if (((bool((options->__Field(HX_CSTRING("no_add"),true) == null())) || bool((options->__Field(HX_CSTRING("no_add"),true) == false))))){
		HX_STACK_LINE(192)
		this->add_batch(_batcher);
	}
	HX_STACK_LINE(195)
	return _batcher;
}


HX_DEFINE_DYNAMIC_FUNC1(Renderer_obj,create_batcher,return )

Void Renderer_obj::clear( ::phoenix::Color _color){
{
		HX_STACK_FRAME("phoenix.Renderer","clear",0x3b218641,"phoenix.Renderer.clear","phoenix/Renderer.hx",200,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_color,"_color")
		HX_STACK_LINE(202)
		if (((_color == null()))){
			HX_STACK_LINE(203)
			_color = this->clear_color;
		}
		HX_STACK_LINE(206)
		::snow::platform::native::render::opengl::GL_obj::clearColor(_color->r,_color->g,_color->b,_color->a);
		HX_STACK_LINE(208)
		if (((this->core->app->window->config->__Field(HX_CSTRING("depth_bits"),true) > (int)0))){
			HX_STACK_LINE(209)
			::snow::platform::native::render::opengl::GL_obj::clear((int)16640);
			HX_STACK_LINE(210)
			::snow::platform::native::render::opengl::GL_obj::clearDepth(1.0);
		}
		else{
			HX_STACK_LINE(212)
			::snow::platform::native::render::opengl::GL_obj::clear((int)16384);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Renderer_obj,clear,(void))

Void Renderer_obj::blend_mode( ::phoenix::BlendMode _src_mode,::phoenix::BlendMode _dst_mode){
{
		HX_STACK_FRAME("phoenix.Renderer","blend_mode",0x5b8aa01d,"phoenix.Renderer.blend_mode","phoenix/Renderer.hx",218,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_src_mode,"_src_mode")
		HX_STACK_ARG(_dst_mode,"_dst_mode")
		HX_STACK_LINE(220)
		if (((_src_mode == null()))){
			HX_STACK_LINE(220)
			_src_mode = ::phoenix::BlendMode_obj::src_alpha;
		}
		HX_STACK_LINE(221)
		if (((_dst_mode == null()))){
			HX_STACK_LINE(221)
			_dst_mode = ::phoenix::BlendMode_obj::one_minus_src_alpha;
		}
		HX_STACK_LINE(223)
		int _src = ::phoenix::utils::Rendering_obj::gl_blend_mode_from_BlendMode(_src_mode);		HX_STACK_VAR(_src,"_src");
		HX_STACK_LINE(224)
		int _dest = ::phoenix::utils::Rendering_obj::gl_blend_mode_from_BlendMode(_dst_mode);		HX_STACK_VAR(_dest,"_dest");
		HX_STACK_LINE(226)
		::snow::platform::native::render::opengl::GL_obj::blendFunc(_src,_dest);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Renderer_obj,blend_mode,(void))

Void Renderer_obj::process( ){
{
		HX_STACK_FRAME("phoenix.Renderer","process",0xb1464c23,"phoenix.Renderer.process","phoenix/Renderer.hx",231,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_LINE(233)
		if ((this->stop)){
			HX_STACK_LINE(233)
			return null();
		}
		HX_STACK_LINE(235)
		if ((this->should_clear)){
			HX_STACK_LINE(236)
			this->clear(this->clear_color);
		}
		HX_STACK_LINE(239)
		this->stats->batchers = this->batchers->length;
		HX_STACK_LINE(240)
		this->stats->reset();
		HX_STACK_LINE(243)
		this->render_path->render(this->batchers,this->stats);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Renderer_obj,process,(void))

Void Renderer_obj::onresize( Dynamic e){
{
		HX_STACK_FRAME("phoenix.Renderer","onresize",0xefccb01f,"phoenix.Renderer.onresize","phoenix/Renderer.hx",252,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_ARG(e,"e")
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Renderer_obj,onresize,(void))

bool Renderer_obj::set_vsync( bool _vsync){
	HX_STACK_FRAME("phoenix.Renderer","set_vsync",0xda22f4e8,"phoenix.Renderer.set_vsync","phoenix/Renderer.hx",256,0x3d4c7b7b)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_vsync,"_vsync")
	HX_STACK_LINE(258)
	::Luxe_obj::core->app->windowing->enable_vsync(_vsync);
	HX_STACK_LINE(260)
	return this->vsync = _vsync;
}


HX_DEFINE_DYNAMIC_FUNC1(Renderer_obj,set_vsync,return )

bool Renderer_obj::get_vsync( ){
	HX_STACK_FRAME("phoenix.Renderer","get_vsync",0xf6d208dc,"phoenix.Renderer.get_vsync","phoenix/Renderer.hx",266,0x3d4c7b7b)
	HX_STACK_THIS(this)
	HX_STACK_LINE(266)
	return this->vsync;
}


HX_DEFINE_DYNAMIC_FUNC0(Renderer_obj,get_vsync,return )

::phoenix::RenderTexture Renderer_obj::get_target( ){
	HX_STACK_FRAME("phoenix.Renderer","get_target",0xd262c1e6,"phoenix.Renderer.get_target","phoenix/Renderer.hx",272,0x3d4c7b7b)
	HX_STACK_THIS(this)
	HX_STACK_LINE(272)
	return this->target;
}


HX_DEFINE_DYNAMIC_FUNC0(Renderer_obj,get_target,return )

::phoenix::RenderTexture Renderer_obj::set_target( ::phoenix::RenderTexture _target){
	HX_STACK_FRAME("phoenix.Renderer","set_target",0xd5e0605a,"phoenix.Renderer.set_target","phoenix/Renderer.hx",276,0x3d4c7b7b)
	HX_STACK_THIS(this)
	HX_STACK_ARG(_target,"_target")
	HX_STACK_LINE(278)
	if (((_target != null()))){
		HX_STACK_LINE(280)
		this->target_size->set_x(_target->width);
		HX_STACK_LINE(281)
		this->target_size->set_y(_target->height);
		HX_STACK_LINE(283)
		this->state->bindFramebuffer(_target->fbo);
	}
	else{
		HX_STACK_LINE(287)
		this->target_size->set_x(::Luxe_obj::get_screen()->w);
		HX_STACK_LINE(288)
		this->target_size->set_y(::Luxe_obj::get_screen()->h);
		HX_STACK_LINE(290)
		this->state->bindFramebuffer(null());
	}
	HX_STACK_LINE(294)
	return this->target = _target;
}


HX_DEFINE_DYNAMIC_FUNC1(Renderer_obj,set_target,return )

Void Renderer_obj::create_default_shaders( ){
{
		HX_STACK_FRAME("phoenix.Renderer","create_default_shaders",0xf69f9f39,"phoenix.Renderer.create_default_shaders","phoenix/Renderer.hx",298,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_LINE(302)
		this->default_vert_source = ::haxe::Resource_obj::getString(HX_CSTRING("default.vert.glsl"));
		HX_STACK_LINE(303)
		this->default_frag_source = ::haxe::Resource_obj::getString(HX_CSTRING("default.frag.glsl"));
		HX_STACK_LINE(304)
		this->default_frag_textured_source = ::haxe::Resource_obj::getString(HX_CSTRING("default.frag.textured.glsl"));
		HX_STACK_LINE(313)
		this->default_shader = ::phoenix::Shader_obj::__new(this->resource_manager);
		HX_STACK_LINE(314)
		this->default_shader->id = HX_CSTRING("default_shader");
		HX_STACK_LINE(316)
		this->default_shader_textured = ::phoenix::Shader_obj::__new(this->resource_manager);
		HX_STACK_LINE(317)
		this->default_shader_textured->id = HX_CSTRING("default_shader_textured");
		HX_STACK_LINE(319)
		this->default_shader->from_string(this->default_vert_source,this->default_frag_source,null(),null(),false);
		HX_STACK_LINE(320)
		this->default_shader_textured->from_string(this->default_vert_source,this->default_frag_textured_source,null(),null(),false);
		HX_STACK_LINE(138)
		Dynamic();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Renderer_obj,create_default_shaders,(void))

Void Renderer_obj::create_default_font( ){
{
		HX_STACK_FRAME("phoenix.Renderer","create_default_font",0xfe822b64,"phoenix.Renderer.create_default_font","phoenix/Renderer.hx",326,0x3d4c7b7b)
		HX_STACK_THIS(this)
		HX_STACK_LINE(330)
		this->font = ::phoenix::BitmapFont_obj::__new(this->resource_manager);
		HX_STACK_LINE(333)
		::phoenix::Texture _font_texture = ::phoenix::Texture_obj::load_from_resource(HX_CSTRING("cabin.png"),(int)512,(int)256,null());		HX_STACK_VAR(_font_texture,"_font_texture");
		HX_STACK_LINE(334)
		_font_texture->set_filter_min(::phoenix::FilterType_obj::linear);
		HX_STACK_LINE(337)
		::String _g = ::haxe::Resource_obj::getString(HX_CSTRING("cabin.fnt"));		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(337)
		this->font->from_string(_g,HX_CSTRING("luxe.font"),null(),Array_obj< ::Dynamic >::__new().Add(_font_texture));
		HX_STACK_LINE(138)
		Dynamic();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Renderer_obj,create_default_font,(void))


Renderer_obj::Renderer_obj()
{
}

void Renderer_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(Renderer);
	HX_MARK_MEMBER_NAME(resource_manager,"resource_manager");
	HX_MARK_MEMBER_NAME(batchers,"batchers");
	HX_MARK_MEMBER_NAME(core,"core");
	HX_MARK_MEMBER_NAME(state,"state");
	HX_MARK_MEMBER_NAME(default_fbo,"default_fbo");
	HX_MARK_MEMBER_NAME(default_rbo,"default_rbo");
	HX_MARK_MEMBER_NAME(default_shader,"default_shader");
	HX_MARK_MEMBER_NAME(default_shader_textured,"default_shader_textured");
	HX_MARK_MEMBER_NAME(default_vert_source,"default_vert_source");
	HX_MARK_MEMBER_NAME(default_frag_source,"default_frag_source");
	HX_MARK_MEMBER_NAME(default_frag_textured_source,"default_frag_textured_source");
	HX_MARK_MEMBER_NAME(batcher,"batcher");
	HX_MARK_MEMBER_NAME(camera,"camera");
	HX_MARK_MEMBER_NAME(font,"font");
	HX_MARK_MEMBER_NAME(render_path,"render_path");
	HX_MARK_MEMBER_NAME(default_render_path,"default_render_path");
	HX_MARK_MEMBER_NAME(vsync,"vsync");
	HX_MARK_MEMBER_NAME(target,"target");
	HX_MARK_MEMBER_NAME(target_size,"target_size");
	HX_MARK_MEMBER_NAME(should_clear,"should_clear");
	HX_MARK_MEMBER_NAME(stop,"stop");
	HX_MARK_MEMBER_NAME(stop_count,"stop_count");
	HX_MARK_MEMBER_NAME(clear_color,"clear_color");
	HX_MARK_MEMBER_NAME(stats,"stats");
	HX_MARK_END_CLASS();
}

void Renderer_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(resource_manager,"resource_manager");
	HX_VISIT_MEMBER_NAME(batchers,"batchers");
	HX_VISIT_MEMBER_NAME(core,"core");
	HX_VISIT_MEMBER_NAME(state,"state");
	HX_VISIT_MEMBER_NAME(default_fbo,"default_fbo");
	HX_VISIT_MEMBER_NAME(default_rbo,"default_rbo");
	HX_VISIT_MEMBER_NAME(default_shader,"default_shader");
	HX_VISIT_MEMBER_NAME(default_shader_textured,"default_shader_textured");
	HX_VISIT_MEMBER_NAME(default_vert_source,"default_vert_source");
	HX_VISIT_MEMBER_NAME(default_frag_source,"default_frag_source");
	HX_VISIT_MEMBER_NAME(default_frag_textured_source,"default_frag_textured_source");
	HX_VISIT_MEMBER_NAME(batcher,"batcher");
	HX_VISIT_MEMBER_NAME(camera,"camera");
	HX_VISIT_MEMBER_NAME(font,"font");
	HX_VISIT_MEMBER_NAME(render_path,"render_path");
	HX_VISIT_MEMBER_NAME(default_render_path,"default_render_path");
	HX_VISIT_MEMBER_NAME(vsync,"vsync");
	HX_VISIT_MEMBER_NAME(target,"target");
	HX_VISIT_MEMBER_NAME(target_size,"target_size");
	HX_VISIT_MEMBER_NAME(should_clear,"should_clear");
	HX_VISIT_MEMBER_NAME(stop,"stop");
	HX_VISIT_MEMBER_NAME(stop_count,"stop_count");
	HX_VISIT_MEMBER_NAME(clear_color,"clear_color");
	HX_VISIT_MEMBER_NAME(stats,"stats");
}

Dynamic Renderer_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"core") ) { return core; }
		if (HX_FIELD_EQ(inName,"font") ) { return font; }
		if (HX_FIELD_EQ(inName,"stop") ) { return stop; }
		if (HX_FIELD_EQ(inName,"init") ) { return init_dyn(); }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"state") ) { return state; }
		if (HX_FIELD_EQ(inName,"vsync") ) { return inCallProp ? get_vsync() : vsync; }
		if (HX_FIELD_EQ(inName,"stats") ) { return stats; }
		if (HX_FIELD_EQ(inName,"clear") ) { return clear_dyn(); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"camera") ) { return camera; }
		if (HX_FIELD_EQ(inName,"target") ) { return inCallProp ? get_target() : target; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"batcher") ) { return batcher; }
		if (HX_FIELD_EQ(inName,"destroy") ) { return destroy_dyn(); }
		if (HX_FIELD_EQ(inName,"process") ) { return process_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"batchers") ) { return batchers; }
		if (HX_FIELD_EQ(inName,"onresize") ) { return onresize_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"add_batch") ) { return add_batch_dyn(); }
		if (HX_FIELD_EQ(inName,"set_vsync") ) { return set_vsync_dyn(); }
		if (HX_FIELD_EQ(inName,"get_vsync") ) { return get_vsync_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"stop_count") ) { return stop_count; }
		if (HX_FIELD_EQ(inName,"blend_mode") ) { return blend_mode_dyn(); }
		if (HX_FIELD_EQ(inName,"get_target") ) { return get_target_dyn(); }
		if (HX_FIELD_EQ(inName,"set_target") ) { return set_target_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"default_fbo") ) { return default_fbo; }
		if (HX_FIELD_EQ(inName,"default_rbo") ) { return default_rbo; }
		if (HX_FIELD_EQ(inName,"render_path") ) { return render_path; }
		if (HX_FIELD_EQ(inName,"target_size") ) { return target_size; }
		if (HX_FIELD_EQ(inName,"clear_color") ) { return clear_color; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"should_clear") ) { return should_clear; }
		if (HX_FIELD_EQ(inName,"remove_batch") ) { return remove_batch_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"sort_batchers") ) { return sort_batchers_dyn(); }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"default_shader") ) { return default_shader; }
		if (HX_FIELD_EQ(inName,"create_batcher") ) { return create_batcher_dyn(); }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"resource_manager") ) { return resource_manager; }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"default_vert_source") ) { return default_vert_source; }
		if (HX_FIELD_EQ(inName,"default_frag_source") ) { return default_frag_source; }
		if (HX_FIELD_EQ(inName,"default_render_path") ) { return default_render_path; }
		if (HX_FIELD_EQ(inName,"create_default_font") ) { return create_default_font_dyn(); }
		break;
	case 22:
		if (HX_FIELD_EQ(inName,"create_default_shaders") ) { return create_default_shaders_dyn(); }
		break;
	case 23:
		if (HX_FIELD_EQ(inName,"default_shader_textured") ) { return default_shader_textured; }
		break;
	case 28:
		if (HX_FIELD_EQ(inName,"default_frag_textured_source") ) { return default_frag_textured_source; }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic Renderer_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"core") ) { core=inValue.Cast< ::luxe::Core >(); return inValue; }
		if (HX_FIELD_EQ(inName,"font") ) { font=inValue.Cast< ::phoenix::BitmapFont >(); return inValue; }
		if (HX_FIELD_EQ(inName,"stop") ) { stop=inValue.Cast< bool >(); return inValue; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"state") ) { state=inValue.Cast< ::phoenix::RenderState >(); return inValue; }
		if (HX_FIELD_EQ(inName,"vsync") ) { if (inCallProp) return set_vsync(inValue);vsync=inValue.Cast< bool >(); return inValue; }
		if (HX_FIELD_EQ(inName,"stats") ) { stats=inValue.Cast< ::phoenix::RendererStats >(); return inValue; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"camera") ) { camera=inValue.Cast< ::phoenix::Camera >(); return inValue; }
		if (HX_FIELD_EQ(inName,"target") ) { if (inCallProp) return set_target(inValue);target=inValue.Cast< ::phoenix::RenderTexture >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"batcher") ) { batcher=inValue.Cast< ::phoenix::Batcher >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"batchers") ) { batchers=inValue.Cast< Array< ::Dynamic > >(); return inValue; }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"stop_count") ) { stop_count=inValue.Cast< int >(); return inValue; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"default_fbo") ) { default_fbo=inValue.Cast< ::snow::platform::native::render::opengl::GLFBO >(); return inValue; }
		if (HX_FIELD_EQ(inName,"default_rbo") ) { default_rbo=inValue.Cast< ::snow::platform::native::render::opengl::GLRBO >(); return inValue; }
		if (HX_FIELD_EQ(inName,"render_path") ) { render_path=inValue.Cast< ::phoenix::RenderPath >(); return inValue; }
		if (HX_FIELD_EQ(inName,"target_size") ) { target_size=inValue.Cast< ::phoenix::Vector >(); return inValue; }
		if (HX_FIELD_EQ(inName,"clear_color") ) { clear_color=inValue.Cast< ::phoenix::Color >(); return inValue; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"should_clear") ) { should_clear=inValue.Cast< bool >(); return inValue; }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"default_shader") ) { default_shader=inValue.Cast< ::phoenix::Shader >(); return inValue; }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"resource_manager") ) { resource_manager=inValue.Cast< ::luxe::resource::ResourceManager >(); return inValue; }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"default_vert_source") ) { default_vert_source=inValue.Cast< ::String >(); return inValue; }
		if (HX_FIELD_EQ(inName,"default_frag_source") ) { default_frag_source=inValue.Cast< ::String >(); return inValue; }
		if (HX_FIELD_EQ(inName,"default_render_path") ) { default_render_path=inValue.Cast< ::phoenix::RenderPath >(); return inValue; }
		break;
	case 23:
		if (HX_FIELD_EQ(inName,"default_shader_textured") ) { default_shader_textured=inValue.Cast< ::phoenix::Shader >(); return inValue; }
		break;
	case 28:
		if (HX_FIELD_EQ(inName,"default_frag_textured_source") ) { default_frag_textured_source=inValue.Cast< ::String >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void Renderer_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("resource_manager"));
	outFields->push(HX_CSTRING("batchers"));
	outFields->push(HX_CSTRING("core"));
	outFields->push(HX_CSTRING("state"));
	outFields->push(HX_CSTRING("default_fbo"));
	outFields->push(HX_CSTRING("default_rbo"));
	outFields->push(HX_CSTRING("default_shader"));
	outFields->push(HX_CSTRING("default_shader_textured"));
	outFields->push(HX_CSTRING("default_vert_source"));
	outFields->push(HX_CSTRING("default_frag_source"));
	outFields->push(HX_CSTRING("default_frag_textured_source"));
	outFields->push(HX_CSTRING("batcher"));
	outFields->push(HX_CSTRING("camera"));
	outFields->push(HX_CSTRING("font"));
	outFields->push(HX_CSTRING("render_path"));
	outFields->push(HX_CSTRING("default_render_path"));
	outFields->push(HX_CSTRING("vsync"));
	outFields->push(HX_CSTRING("target"));
	outFields->push(HX_CSTRING("target_size"));
	outFields->push(HX_CSTRING("should_clear"));
	outFields->push(HX_CSTRING("stop"));
	outFields->push(HX_CSTRING("stop_count"));
	outFields->push(HX_CSTRING("clear_color"));
	outFields->push(HX_CSTRING("stats"));
	super::__GetFields(outFields);
};

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

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsObject /*::luxe::resource::ResourceManager*/ ,(int)offsetof(Renderer_obj,resource_manager),HX_CSTRING("resource_manager")},
	{hx::fsObject /*Array< ::Dynamic >*/ ,(int)offsetof(Renderer_obj,batchers),HX_CSTRING("batchers")},
	{hx::fsObject /*::luxe::Core*/ ,(int)offsetof(Renderer_obj,core),HX_CSTRING("core")},
	{hx::fsObject /*::phoenix::RenderState*/ ,(int)offsetof(Renderer_obj,state),HX_CSTRING("state")},
	{hx::fsObject /*::snow::platform::native::render::opengl::GLFBO*/ ,(int)offsetof(Renderer_obj,default_fbo),HX_CSTRING("default_fbo")},
	{hx::fsObject /*::snow::platform::native::render::opengl::GLRBO*/ ,(int)offsetof(Renderer_obj,default_rbo),HX_CSTRING("default_rbo")},
	{hx::fsObject /*::phoenix::Shader*/ ,(int)offsetof(Renderer_obj,default_shader),HX_CSTRING("default_shader")},
	{hx::fsObject /*::phoenix::Shader*/ ,(int)offsetof(Renderer_obj,default_shader_textured),HX_CSTRING("default_shader_textured")},
	{hx::fsString,(int)offsetof(Renderer_obj,default_vert_source),HX_CSTRING("default_vert_source")},
	{hx::fsString,(int)offsetof(Renderer_obj,default_frag_source),HX_CSTRING("default_frag_source")},
	{hx::fsString,(int)offsetof(Renderer_obj,default_frag_textured_source),HX_CSTRING("default_frag_textured_source")},
	{hx::fsObject /*::phoenix::Batcher*/ ,(int)offsetof(Renderer_obj,batcher),HX_CSTRING("batcher")},
	{hx::fsObject /*::phoenix::Camera*/ ,(int)offsetof(Renderer_obj,camera),HX_CSTRING("camera")},
	{hx::fsObject /*::phoenix::BitmapFont*/ ,(int)offsetof(Renderer_obj,font),HX_CSTRING("font")},
	{hx::fsObject /*::phoenix::RenderPath*/ ,(int)offsetof(Renderer_obj,render_path),HX_CSTRING("render_path")},
	{hx::fsObject /*::phoenix::RenderPath*/ ,(int)offsetof(Renderer_obj,default_render_path),HX_CSTRING("default_render_path")},
	{hx::fsBool,(int)offsetof(Renderer_obj,vsync),HX_CSTRING("vsync")},
	{hx::fsObject /*::phoenix::RenderTexture*/ ,(int)offsetof(Renderer_obj,target),HX_CSTRING("target")},
	{hx::fsObject /*::phoenix::Vector*/ ,(int)offsetof(Renderer_obj,target_size),HX_CSTRING("target_size")},
	{hx::fsBool,(int)offsetof(Renderer_obj,should_clear),HX_CSTRING("should_clear")},
	{hx::fsBool,(int)offsetof(Renderer_obj,stop),HX_CSTRING("stop")},
	{hx::fsInt,(int)offsetof(Renderer_obj,stop_count),HX_CSTRING("stop_count")},
	{hx::fsObject /*::phoenix::Color*/ ,(int)offsetof(Renderer_obj,clear_color),HX_CSTRING("clear_color")},
	{hx::fsObject /*::phoenix::RendererStats*/ ,(int)offsetof(Renderer_obj,stats),HX_CSTRING("stats")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("resource_manager"),
	HX_CSTRING("batchers"),
	HX_CSTRING("core"),
	HX_CSTRING("state"),
	HX_CSTRING("default_fbo"),
	HX_CSTRING("default_rbo"),
	HX_CSTRING("default_shader"),
	HX_CSTRING("default_shader_textured"),
	HX_CSTRING("default_vert_source"),
	HX_CSTRING("default_frag_source"),
	HX_CSTRING("default_frag_textured_source"),
	HX_CSTRING("batcher"),
	HX_CSTRING("camera"),
	HX_CSTRING("font"),
	HX_CSTRING("render_path"),
	HX_CSTRING("default_render_path"),
	HX_CSTRING("vsync"),
	HX_CSTRING("target"),
	HX_CSTRING("target_size"),
	HX_CSTRING("should_clear"),
	HX_CSTRING("stop"),
	HX_CSTRING("stop_count"),
	HX_CSTRING("clear_color"),
	HX_CSTRING("stats"),
	HX_CSTRING("init"),
	HX_CSTRING("destroy"),
	HX_CSTRING("sort_batchers"),
	HX_CSTRING("add_batch"),
	HX_CSTRING("remove_batch"),
	HX_CSTRING("create_batcher"),
	HX_CSTRING("clear"),
	HX_CSTRING("blend_mode"),
	HX_CSTRING("process"),
	HX_CSTRING("onresize"),
	HX_CSTRING("set_vsync"),
	HX_CSTRING("get_vsync"),
	HX_CSTRING("get_target"),
	HX_CSTRING("set_target"),
	HX_CSTRING("create_default_shaders"),
	HX_CSTRING("create_default_font"),
	String(null()) };

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

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

#endif

Class Renderer_obj::__mClass;

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

void Renderer_obj::__boot()
{
}

} // end namespace phoenix
