#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_Sys
#include <Sys.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
#ifndef INCLUDED_haxe_crypto_Md5
#include <haxe/crypto/Md5.h>
#endif
#ifndef INCLUDED_haxe_format_JsonParser
#include <haxe/format/JsonParser.h>
#endif
#ifndef INCLUDED_haxe_io_Bytes
#include <haxe/io/Bytes.h>
#endif
#ifndef INCLUDED_haxe_io_Path
#include <haxe/io/Path.h>
#endif
#ifndef INCLUDED_hxMath
#include <hxMath.h>
#endif
#ifndef INCLUDED_snow_App
#include <snow/App.h>
#endif
#ifndef INCLUDED_snow_CoreBinding
#include <snow/CoreBinding.h>
#endif
#ifndef INCLUDED_snow_Snow
#include <snow/Snow.h>
#endif
#ifndef INCLUDED_snow_assets_Asset
#include <snow/assets/Asset.h>
#endif
#ifndef INCLUDED_snow_assets_AssetText
#include <snow/assets/AssetText.h>
#endif
#ifndef INCLUDED_snow_assets_Assets
#include <snow/assets/Assets.h>
#endif
#ifndef INCLUDED_snow_audio_Audio
#include <snow/audio/Audio.h>
#endif
#ifndef INCLUDED_snow_input_Input
#include <snow/input/Input.h>
#endif
#ifndef INCLUDED_snow_io_IO
#include <snow/io/IO.h>
#endif
#ifndef INCLUDED_snow_platform_native_Core
#include <snow/platform/native/Core.h>
#endif
#ifndef INCLUDED_snow_platform_native_utils_ByteArray
#include <snow/platform/native/utils/ByteArray.h>
#endif
#ifndef INCLUDED_snow_types_SystemEventType
#include <snow/types/SystemEventType.h>
#endif
#ifndef INCLUDED_snow_types_SystemEvents
#include <snow/types/SystemEvents.h>
#endif
#ifndef INCLUDED_snow_utils_AbstractClass
#include <snow/utils/AbstractClass.h>
#endif
#ifndef INCLUDED_snow_utils_IDataInput
#include <snow/utils/IDataInput.h>
#endif
#ifndef INCLUDED_snow_utils_IMemoryRange
#include <snow/utils/IMemoryRange.h>
#endif
#ifndef INCLUDED_snow_utils_Libs
#include <snow/utils/Libs.h>
#endif
#ifndef INCLUDED_snow_utils_Timer
#include <snow/utils/Timer.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 snow{

Void Snow_obj::__construct()
{
HX_STACK_FRAME("snow.Snow","new",0x2ec45060,"snow.Snow.new","snow/Snow.hx",24,0x86524d2f)
{
	HX_STACK_LINE(68)
	this->is_ready = false;
	HX_STACK_LINE(66)
	this->was_ready = false;
	HX_STACK_LINE(59)
	this->has_shutdown = false;
	HX_STACK_LINE(57)
	this->shutting_down = false;
	HX_STACK_LINE(76)
	::snow::Snow_obj::core = ::snow::platform::native::Core_obj::__new(hx::ObjectPtr<OBJ_>(this));
	HX_STACK_LINE(77)
	::snow::Snow_obj::next_list = Dynamic( Array_obj<Dynamic>::__new());
}
;
	return null();
}

//Snow_obj::~Snow_obj() { }

Dynamic Snow_obj::__CreateEmpty() { return  new Snow_obj; }
hx::ObjectPtr< Snow_obj > Snow_obj::__new()
{  hx::ObjectPtr< Snow_obj > result = new Snow_obj();
	result->__construct();
	return result;}

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

Void Snow_obj::init( Dynamic _snow_config,::snow::App _host){
{
		HX_STACK_FRAME("snow.Snow","init",0xb9babb10,"snow.Snow.init","snow/Snow.hx",83,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_snow_config,"_snow_config")
		HX_STACK_ARG(_host,"_host")
		HX_STACK_LINE(85)
		this->snow_config = _snow_config;
		struct _Function_1_1{
			inline static Dynamic Block( ){
				HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","snow/Snow.hx",89,0x86524d2f)
				{
					hx::Anon __result = hx::Anon_obj::Create();
					return __result;
				}
				return null();
			}
		};
		HX_STACK_LINE(89)
		Dynamic _g = _Function_1_1::Block();		HX_STACK_VAR(_g,"_g");
		HX_STACK_LINE(91)
		Dynamic _g1 = Dynamic( Array_obj<Dynamic>::__new());		HX_STACK_VAR(_g1,"_g1");
		struct _Function_1_2{
			inline static Dynamic Block( ){
				HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","snow/Snow.hx",92,0x86524d2f)
				{
					hx::Anon __result = hx::Anon_obj::Create();
					__result->Add(HX_CSTRING("no_context_menu") , true,false);
					return __result;
				}
				return null();
			}
		};
		HX_STACK_LINE(92)
		Dynamic _g2 = _Function_1_2::Block();		HX_STACK_VAR(_g2,"_g2");
		struct _Function_1_3{
			inline static Dynamic Block( Dynamic &_g1,Dynamic &_g,Dynamic &_g2){
				HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","snow/Snow.hx",87,0x86524d2f)
				{
					hx::Anon __result = hx::Anon_obj::Create();
					__result->Add(HX_CSTRING("has_window") , true,false);
					__result->Add(HX_CSTRING("runtime") , _g,false);
					__result->Add(HX_CSTRING("window") , null(),false);
					__result->Add(HX_CSTRING("assets") , _g1,false);
					__result->Add(HX_CSTRING("web") , _g2,false);
					struct _Function_2_1{
						inline static Dynamic Block( ){
							HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","snow/Snow.hx",95,0x86524d2f)
							{
								hx::Anon __result = hx::Anon_obj::Create();
								__result->Add(HX_CSTRING("audio_buffer_length") , (int)176400,false);
								__result->Add(HX_CSTRING("audio_buffer_count") , (int)4,false);
								return __result;
							}
							return null();
						}
					};
					__result->Add(HX_CSTRING("native") , _Function_2_1::Block(),false);
					return __result;
				}
				return null();
			}
		};
		HX_STACK_LINE(87)
		this->config = _Function_1_3::Block(_g1,_g,_g2);
		HX_STACK_LINE(101)
		this->host = _host;
		HX_STACK_LINE(102)
		this->host->app = hx::ObjectPtr<OBJ_>(this);
		HX_STACK_LINE(104)
		::snow::Snow_obj::core->init(this->on_event_dyn());
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC2(Snow_obj,init,(void))

Void Snow_obj::shutdown( ){
{
		HX_STACK_FRAME("snow.Snow","shutdown",0x94cb7c96,"snow.Snow.shutdown","snow/Snow.hx",109,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_LINE(111)
		this->shutting_down = true;
		HX_STACK_LINE(113)
		this->host->ondestroy();
		HX_STACK_LINE(114)
		this->io->destroy();
		HX_STACK_LINE(115)
		this->audio->destroy();
		HX_STACK_LINE(116)
		this->input->destroy();
		HX_STACK_LINE(117)
		this->windowing->destroy();
		HX_STACK_LINE(119)
		::snow::Snow_obj::core->shutdown();
		HX_STACK_LINE(121)
		this->has_shutdown = true;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,shutdown,(void))

Float Snow_obj::get_time( ){
	HX_STACK_FRAME("snow.Snow","get_time",0xf6770796,"snow.Snow.get_time","snow/Snow.hx",127,0x86524d2f)
	HX_STACK_THIS(this)
	HX_STACK_LINE(127)
	return ::snow::Snow_obj::core->timestamp();
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,get_time,return )

Void Snow_obj::on_snow_init( ){
{
		HX_STACK_FRAME("snow.Snow","on_snow_init",0xe7e6932c,"snow.Snow.on_snow_init","snow/Snow.hx",131,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_LINE(139)
		::String app_path = ::snow::Snow_obj::core->app_path();		HX_STACK_VAR(app_path,"app_path");
		HX_STACK_LINE(143)
		::Sys_obj::setCwd(app_path);
		HX_STACK_LINE(147)
		::snow::Snow_obj::core->pref_path(HX_CSTRING("snow"),HX_CSTRING("default"));
		HX_STACK_LINE(155)
		this->host->on_internal_init();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,on_snow_init,(void))

Void Snow_obj::on_snow_ready( ){
{
		HX_STACK_FRAME("snow.Snow","on_snow_ready",0x2a7c60c7,"snow.Snow.on_snow_ready","snow/Snow.hx",159,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_LINE(161)
		if ((this->was_ready)){
			HX_STACK_LINE(162)
			::haxe::Log_obj::trace(HX_CSTRING("     i / snow / firing ready event repeatedly is not ideal..."),hx::SourceInfo(HX_CSTRING("Snow.hx"),162,HX_CSTRING("snow.Snow"),HX_CSTRING("on_snow_ready")));
			HX_STACK_LINE(163)
			return null();
		}
		HX_STACK_LINE(171)
		this->io = ::snow::io::IO_obj::__new(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(172)
		this->input = ::snow::input::Input_obj::__new(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(173)
		this->audio = ::snow::audio::Audio_obj::__new(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(174)
		this->assets = ::snow::assets::Assets_obj::__new(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(175)
		this->windowing = ::snow::window::Windowing_obj::__new(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(178)
		if ((!(this->snow_config->__Field(HX_CSTRING("config_custom_assets"),true)))){
			HX_STACK_LINE(181)
			this->assets->manifest_path = this->snow_config->__Field(HX_CSTRING("config_assets_path"),true);
			HX_STACK_LINE(187)
			this->config->__FieldRef(HX_CSTRING("assets")) = this->default_asset_list();
			HX_STACK_LINE(189)
			this->assets->add(this->config->__Field(HX_CSTRING("assets"),true));
		}
		HX_STACK_LINE(193)
		if ((!(this->snow_config->__Field(HX_CSTRING("config_custom_runtime"),true)))){
			HX_STACK_LINE(195)
			this->config->__FieldRef(HX_CSTRING("runtime")) = this->default_runtime_config();
		}
		HX_STACK_LINE(198)
		this->config->__FieldRef(HX_CSTRING("window")) = this->default_window_config();
		HX_STACK_LINE(203)
		this->config = this->host->config(this->config);
		HX_STACK_LINE(206)
		this->was_ready = true;
		HX_STACK_LINE(211)
		if (((this->config->__Field(HX_CSTRING("has_window"),true) == true))){
			HX_STACK_LINE(213)
			this->window = this->windowing->create(this->config->__Field(HX_CSTRING("window"),true));
			HX_STACK_LINE(216)
			if (((this->window->handle == null()))){
				HX_STACK_LINE(217)
				HX_STACK_DO_THROW(HX_CSTRING("requested default window cannot be created. Cannot continue."));
			}
		}
		HX_STACK_LINE(223)
		this->is_ready = true;
		HX_STACK_LINE(226)
		this->host->ready();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,on_snow_ready,(void))

Void Snow_obj::do_internal_update( Float dt){
{
		HX_STACK_FRAME("snow.Snow","do_internal_update",0xda766217,"snow.Snow.do_internal_update","snow/Snow.hx",230,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_ARG(dt,"dt")
		HX_STACK_LINE(232)
		this->io->update();
		HX_STACK_LINE(233)
		this->input->update();
		HX_STACK_LINE(234)
		this->audio->update();
		HX_STACK_LINE(235)
		this->host->update(dt);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Snow_obj,do_internal_update,(void))

Void Snow_obj::render( ){
{
		HX_STACK_FRAME("snow.Snow","render",0x1808eb56,"snow.Snow.render","snow/Snow.hx",242,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_LINE(242)
		this->windowing->update();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,render,(void))

Void Snow_obj::on_snow_update( ){
{
		HX_STACK_FRAME("snow.Snow","on_snow_update",0x8ccc1d25,"snow.Snow.on_snow_update","snow/Snow.hx",246,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_LINE(248)
		if ((!(this->is_ready))){
			HX_STACK_LINE(249)
			return null();
		}
		HX_STACK_LINE(253)
		::snow::utils::Timer_obj::update();
		HX_STACK_LINE(256)
		if (((::snow::Snow_obj::next_list->__Field(HX_CSTRING("length"),true) > (int)0))){
			HX_STACK_LINE(259)
			int _pre_next_length = ::snow::Snow_obj::next_list->__Field(HX_CSTRING("length"),true);		HX_STACK_VAR(_pre_next_length,"_pre_next_length");
			HX_STACK_LINE(262)
			{
				HX_STACK_LINE(262)
				int _g1 = (int)0;		HX_STACK_VAR(_g1,"_g1");
				HX_STACK_LINE(262)
				int _g = ::snow::Snow_obj::next_list->__Field(HX_CSTRING("length"),true);		HX_STACK_VAR(_g,"_g");
				HX_STACK_LINE(262)
				while(((_g1 < _g))){
					HX_STACK_LINE(262)
					int i = (_g1)++;		HX_STACK_VAR(i,"i");
					HX_STACK_LINE(263)
					::snow::Snow_obj::next_list->__GetItem(i)().Cast< Void >();
				}
			}
			HX_STACK_LINE(266)
			::snow::Snow_obj::next_list->__Field(HX_CSTRING("splice"),true)((int)0,_pre_next_length);
		}
		HX_STACK_LINE(271)
		this->host->on_internal_update();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,on_snow_update,(void))

Void Snow_obj::dispatch_system_event( Dynamic _event){
{
		HX_STACK_FRAME("snow.Snow","dispatch_system_event",0x61ee1b6f,"snow.Snow.dispatch_system_event","snow/Snow.hx",277,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_event,"_event")
		HX_STACK_LINE(277)
		this->on_event(_event);
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Snow_obj,dispatch_system_event,(void))

Void Snow_obj::on_event( Dynamic _event){
{
		HX_STACK_FRAME("snow.Snow","on_event",0x468411ba,"snow.Snow.on_event","snow/Snow.hx",281,0x86524d2f)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_event,"_event")
		HX_STACK_LINE(283)
		if ((::Std_obj::is(_event->__Field(HX_CSTRING("type"),true),hx::ClassOf< ::Int >()))){
			HX_STACK_LINE(284)
			_event->__FieldRef(HX_CSTRING("type")) = ::snow::types::SystemEvents_obj::typed(_event->__Field(HX_CSTRING("type"),true));
		}
		HX_STACK_LINE(287)
		if (((bool((bool((bool((_event->__Field(HX_CSTRING("type"),true) != ::snow::types::SystemEventType_obj::update)) && bool((_event->__Field(HX_CSTRING("type"),true) != ::snow::types::SystemEventType_obj::unknown)))) && bool((_event->__Field(HX_CSTRING("type"),true) != ::snow::types::SystemEventType_obj::window)))) && bool((_event->__Field(HX_CSTRING("type"),true) != ::snow::types::SystemEventType_obj::input))))){
			HX_STACK_LINE(136)
			Dynamic();
		}
		HX_STACK_LINE(296)
		if (((_event->__Field(HX_CSTRING("type"),true) != ::snow::types::SystemEventType_obj::update))){
			HX_STACK_LINE(202)
			Dynamic();
		}
		HX_STACK_LINE(302)
		if ((this->is_ready)){
			HX_STACK_LINE(303)
			this->io->on_event(_event);
			HX_STACK_LINE(304)
			this->audio->on_event(_event);
			HX_STACK_LINE(305)
			this->windowing->on_event(_event);
			HX_STACK_LINE(306)
			this->input->on_event(_event);
			HX_STACK_LINE(307)
			this->host->onevent(_event);
		}
		HX_STACK_LINE(310)
		{
			HX_STACK_LINE(310)
			::snow::types::SystemEventType _g = _event->__Field(HX_CSTRING("type"),true);		HX_STACK_VAR(_g,"_g");
			HX_STACK_LINE(310)
			switch( (int)(_g->__Index())){
				case (int)1: {
					HX_STACK_LINE(313)
					this->on_snow_init();
				}
				;break;
				case (int)2: {
					HX_STACK_LINE(317)
					this->on_snow_ready();
				}
				;break;
				case (int)3: {
					HX_STACK_LINE(321)
					this->on_snow_update();
				}
				;break;
				case (int)7: case (int)8: {
					HX_STACK_LINE(325)
					this->shutdown();
				}
				;break;
				case (int)4: {
					HX_STACK_LINE(329)
					::haxe::Log_obj::trace(HX_CSTRING("     i / snow / Goodbye."),hx::SourceInfo(HX_CSTRING("Snow.hx"),329,HX_CSTRING("snow.Snow"),HX_CSTRING("on_event")));
				}
				;break;
				default: {
				}
			}
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Snow_obj,on_event,(void))

Dynamic Snow_obj::default_runtime_config( ){
	HX_STACK_FRAME("snow.Snow","default_runtime_config",0xc6956f87,"snow.Snow.default_runtime_config","snow/Snow.hx",344,0x86524d2f)
	HX_STACK_THIS(this)
	HX_STACK_LINE(347)
	::snow::assets::AssetText config_data = this->assets->text(this->snow_config->__Field(HX_CSTRING("config_runtime_path"),true),null());		HX_STACK_VAR(config_data,"config_data");
	HX_STACK_LINE(350)
	if (((bool((config_data != null())) && bool((config_data->text != null()))))){
		HX_STACK_LINE(352)
		try
		{
		HX_STACK_CATCHABLE(Dynamic, 0);
		{
			HX_STACK_LINE(354)
			Dynamic json = ::haxe::format::JsonParser_obj::__new(config_data->text)->parseRec();		HX_STACK_VAR(json,"json");
			HX_STACK_LINE(358)
			return json;
		}
		}
		catch(Dynamic __e){
			{
				HX_STACK_BEGIN_CATCH
				Dynamic e = __e;{
					HX_STACK_LINE(362)
					::haxe::Log_obj::trace(HX_CSTRING("     i / snow / config / failed / default runtime config failed to parse as JSON. cannot recover."),hx::SourceInfo(HX_CSTRING("Snow.hx"),362,HX_CSTRING("snow.Snow"),HX_CSTRING("default_runtime_config")));
					HX_STACK_LINE(363)
					HX_STACK_DO_THROW(e);
				}
			}
		}
	}
	struct _Function_1_1{
		inline static Dynamic Block( ){
			HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","snow/Snow.hx",368,0x86524d2f)
			{
				hx::Anon __result = hx::Anon_obj::Create();
				return __result;
			}
			return null();
		}
	};
	HX_STACK_LINE(368)
	return _Function_1_1::Block();
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,default_runtime_config,return )

Dynamic Snow_obj::default_asset_list( ){
	HX_STACK_FRAME("snow.Snow","default_asset_list",0x660ae24b,"snow.Snow.default_asset_list","snow/Snow.hx",373,0x86524d2f)
	HX_STACK_THIS(this)
	HX_STACK_LINE(375)
	Dynamic asset_list = Dynamic( Array_obj<Dynamic>::__new());		HX_STACK_VAR(asset_list,"asset_list");
	HX_STACK_LINE(376)
	::snow::platform::native::utils::ByteArray manifest_data = ::snow::platform::native::utils::ByteArray_obj::readFile((this->assets->assets_root + this->assets->manifest_path),false,null());		HX_STACK_VAR(manifest_data,"manifest_data");
	HX_STACK_LINE(378)
	if (((bool((manifest_data != null())) && bool((manifest_data->length != (int)0))))){
		HX_STACK_LINE(380)
		Array< ::String > _list;		HX_STACK_VAR(_list,"_list");
		HX_STACK_LINE(380)
		{
			HX_STACK_LINE(380)
			::String text = manifest_data->toString();		HX_STACK_VAR(text,"text");
			HX_STACK_LINE(380)
			_list = ::haxe::format::JsonParser_obj::__new(text)->parseRec();
		}
		HX_STACK_LINE(382)
		{
			HX_STACK_LINE(382)
			int _g = (int)0;		HX_STACK_VAR(_g,"_g");
			HX_STACK_LINE(382)
			while(((_g < _list->length))){
				HX_STACK_LINE(382)
				::String asset = _list->__get(_g);		HX_STACK_VAR(asset,"asset");
				HX_STACK_LINE(382)
				++(_g);
				HX_STACK_LINE(386)
				::String _g1 = ::haxe::io::Path_obj::join(Array_obj< ::String >::__new().Add(this->assets->assets_root).Add(asset));		HX_STACK_VAR(_g1,"_g1");
				HX_STACK_LINE(387)
				::String _g11 = ::haxe::io::Path_obj::extension(asset);		HX_STACK_VAR(_g11,"_g11");
				struct _Function_4_1{
					inline static Dynamic Block( ::String &_g1,::String &_g11,::String &asset){
						HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","snow/Snow.hx",384,0x86524d2f)
						{
							hx::Anon __result = hx::Anon_obj::Create();
							__result->Add(HX_CSTRING("id") , asset,false);
							__result->Add(HX_CSTRING("path") , _g1,false);
							__result->Add(HX_CSTRING("type") , _g11,false);
							__result->Add(HX_CSTRING("ext") , ::haxe::io::Path_obj::extension(asset),false);
							return __result;
						}
						return null();
					}
				};
				HX_STACK_LINE(384)
				asset_list->__Field(HX_CSTRING("push"),true)(_Function_4_1::Block(_g1,_g11,asset));
			}
		}
		HX_STACK_LINE(136)
		Dynamic();
	}
	else{
		HX_STACK_LINE(397)
		::haxe::Log_obj::trace(HX_CSTRING("     i / snow / config / failed / default asset manifest not found, or length was zero"),hx::SourceInfo(HX_CSTRING("Snow.hx"),397,HX_CSTRING("snow.Snow"),HX_CSTRING("default_asset_list")));
	}
	HX_STACK_LINE(401)
	return asset_list;
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,default_asset_list,return )

Dynamic Snow_obj::default_window_config( ){
	HX_STACK_FRAME("snow.Snow","default_window_config",0xa273eb33,"snow.Snow.default_window_config","snow/Snow.hx",409,0x86524d2f)
	HX_STACK_THIS(this)
	struct _Function_1_1{
		inline static Dynamic Block( ){
			HX_STACK_FRAME("*","closure",0x5bdab937,"*.closure","snow/Snow.hx",409,0x86524d2f)
			{
				hx::Anon __result = hx::Anon_obj::Create();
				__result->Add(HX_CSTRING("fullscreen") , false,false);
				__result->Add(HX_CSTRING("resizable") , true,false);
				__result->Add(HX_CSTRING("borderless") , false,false);
				__result->Add(HX_CSTRING("antialiasing") , (int)0,false);
				__result->Add(HX_CSTRING("red_bits") , (int)2,false);
				__result->Add(HX_CSTRING("green_bits") , (int)2,false);
				__result->Add(HX_CSTRING("blue_bits") , (int)2,false);
				__result->Add(HX_CSTRING("alpha_bits") , (int)8,false);
				__result->Add(HX_CSTRING("depth_bits") , (int)0,false);
				__result->Add(HX_CSTRING("stencil_bits") , (int)0,false);
				__result->Add(HX_CSTRING("x") , (int)536805376,false);
				__result->Add(HX_CSTRING("y") , (int)536805376,false);
				__result->Add(HX_CSTRING("width") , (int)960,false);
				__result->Add(HX_CSTRING("height") , (int)640,false);
				__result->Add(HX_CSTRING("title") , HX_CSTRING("snow app"),false);
				return __result;
			}
			return null();
		}
	};
	HX_STACK_LINE(409)
	return _Function_1_1::Block();
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,default_window_config,return )

::String Snow_obj::get_uniqueid( ){
	HX_STACK_FRAME("snow.Snow","get_uniqueid",0xd043c935,"snow.Snow.get_uniqueid","snow/Snow.hx",441,0x86524d2f)
	HX_STACK_THIS(this)
	HX_STACK_LINE(443)
	Float _g = ::snow::Snow_obj::core->timestamp();		HX_STACK_VAR(_g,"_g");
	HX_STACK_LINE(443)
	return ::haxe::crypto::Md5_obj::encode(::Std_obj::string((_g * ::Math_obj::random())));
}


HX_DEFINE_DYNAMIC_FUNC0(Snow_obj,get_uniqueid,return )

::snow::platform::native::Core Snow_obj::core;

Dynamic Snow_obj::load( ::String library,::String method,hx::Null< int >  __o_args){
int args = __o_args.Default(0);
	HX_STACK_FRAME("snow.Snow","load",0xbbb71a26,"snow.Snow.load","snow/Snow.hx",450,0x86524d2f)
	HX_STACK_ARG(library,"library")
	HX_STACK_ARG(method,"method")
	HX_STACK_ARG(args,"args")
{
		HX_STACK_LINE(450)
		return ::snow::utils::Libs_obj::load(library,method,args);
	}
}


STATIC_HX_DEFINE_DYNAMIC_FUNC3(Snow_obj,load,return )

Dynamic Snow_obj::next_list;

Void Snow_obj::next( Dynamic func){
{
		HX_STACK_FRAME("snow.Snow","next",0xbd0204f3,"snow.Snow.next","snow/Snow.hx",460,0x86524d2f)
		HX_STACK_ARG(func,"func")
		HX_STACK_LINE(460)
		if (((func != null()))){
			HX_STACK_LINE(461)
			::snow::Snow_obj::next_list->__Field(HX_CSTRING("push"),true)(func);
		}
	}
return null();
}


STATIC_HX_DEFINE_DYNAMIC_FUNC1(Snow_obj,next,(void))


Snow_obj::Snow_obj()
{
}

void Snow_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(Snow);
	HX_MARK_MEMBER_NAME(host,"host");
	HX_MARK_MEMBER_NAME(config,"config");
	HX_MARK_MEMBER_NAME(snow_config,"snow_config");
	HX_MARK_MEMBER_NAME(io,"io");
	HX_MARK_MEMBER_NAME(input,"input");
	HX_MARK_MEMBER_NAME(assets,"assets");
	HX_MARK_MEMBER_NAME(audio,"audio");
	HX_MARK_MEMBER_NAME(windowing,"windowing");
	HX_MARK_MEMBER_NAME(shutting_down,"shutting_down");
	HX_MARK_MEMBER_NAME(has_shutdown,"has_shutdown");
	HX_MARK_MEMBER_NAME(window,"window");
	HX_MARK_MEMBER_NAME(was_ready,"was_ready");
	HX_MARK_MEMBER_NAME(is_ready,"is_ready");
	HX_MARK_END_CLASS();
}

void Snow_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(host,"host");
	HX_VISIT_MEMBER_NAME(config,"config");
	HX_VISIT_MEMBER_NAME(snow_config,"snow_config");
	HX_VISIT_MEMBER_NAME(io,"io");
	HX_VISIT_MEMBER_NAME(input,"input");
	HX_VISIT_MEMBER_NAME(assets,"assets");
	HX_VISIT_MEMBER_NAME(audio,"audio");
	HX_VISIT_MEMBER_NAME(windowing,"windowing");
	HX_VISIT_MEMBER_NAME(shutting_down,"shutting_down");
	HX_VISIT_MEMBER_NAME(has_shutdown,"has_shutdown");
	HX_VISIT_MEMBER_NAME(window,"window");
	HX_VISIT_MEMBER_NAME(was_ready,"was_ready");
	HX_VISIT_MEMBER_NAME(is_ready,"is_ready");
}

Dynamic Snow_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 2:
		if (HX_FIELD_EQ(inName,"io") ) { return io; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"core") ) { return core; }
		if (HX_FIELD_EQ(inName,"load") ) { return load_dyn(); }
		if (HX_FIELD_EQ(inName,"next") ) { return next_dyn(); }
		if (HX_FIELD_EQ(inName,"time") ) { return get_time(); }
		if (HX_FIELD_EQ(inName,"host") ) { return host; }
		if (HX_FIELD_EQ(inName,"init") ) { return init_dyn(); }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"input") ) { return input; }
		if (HX_FIELD_EQ(inName,"audio") ) { return audio; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"config") ) { return config; }
		if (HX_FIELD_EQ(inName,"assets") ) { return assets; }
		if (HX_FIELD_EQ(inName,"window") ) { return window; }
		if (HX_FIELD_EQ(inName,"render") ) { return render_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"uniqueid") ) { return get_uniqueid(); }
		if (HX_FIELD_EQ(inName,"is_ready") ) { return is_ready; }
		if (HX_FIELD_EQ(inName,"shutdown") ) { return shutdown_dyn(); }
		if (HX_FIELD_EQ(inName,"get_time") ) { return get_time_dyn(); }
		if (HX_FIELD_EQ(inName,"on_event") ) { return on_event_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"next_list") ) { return next_list; }
		if (HX_FIELD_EQ(inName,"windowing") ) { return windowing; }
		if (HX_FIELD_EQ(inName,"was_ready") ) { return was_ready; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"snow_config") ) { return snow_config; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"has_shutdown") ) { return has_shutdown; }
		if (HX_FIELD_EQ(inName,"on_snow_init") ) { return on_snow_init_dyn(); }
		if (HX_FIELD_EQ(inName,"get_uniqueid") ) { return get_uniqueid_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"shutting_down") ) { return shutting_down; }
		if (HX_FIELD_EQ(inName,"on_snow_ready") ) { return on_snow_ready_dyn(); }
		break;
	case 14:
		if (HX_FIELD_EQ(inName,"on_snow_update") ) { return on_snow_update_dyn(); }
		break;
	case 18:
		if (HX_FIELD_EQ(inName,"do_internal_update") ) { return do_internal_update_dyn(); }
		if (HX_FIELD_EQ(inName,"default_asset_list") ) { return default_asset_list_dyn(); }
		break;
	case 21:
		if (HX_FIELD_EQ(inName,"dispatch_system_event") ) { return dispatch_system_event_dyn(); }
		if (HX_FIELD_EQ(inName,"default_window_config") ) { return default_window_config_dyn(); }
		break;
	case 22:
		if (HX_FIELD_EQ(inName,"default_runtime_config") ) { return default_runtime_config_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic Snow_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 2:
		if (HX_FIELD_EQ(inName,"io") ) { io=inValue.Cast< ::snow::io::IO >(); return inValue; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"core") ) { core=inValue.Cast< ::snow::platform::native::Core >(); return inValue; }
		if (HX_FIELD_EQ(inName,"host") ) { host=inValue.Cast< ::snow::App >(); return inValue; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"input") ) { input=inValue.Cast< ::snow::input::Input >(); return inValue; }
		if (HX_FIELD_EQ(inName,"audio") ) { audio=inValue.Cast< ::snow::audio::Audio >(); return inValue; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"config") ) { config=inValue.Cast< Dynamic >(); return inValue; }
		if (HX_FIELD_EQ(inName,"assets") ) { assets=inValue.Cast< ::snow::assets::Assets >(); return inValue; }
		if (HX_FIELD_EQ(inName,"window") ) { window=inValue.Cast< ::snow::window::Window >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"is_ready") ) { is_ready=inValue.Cast< bool >(); return inValue; }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"next_list") ) { next_list=inValue.Cast< Dynamic >(); return inValue; }
		if (HX_FIELD_EQ(inName,"windowing") ) { windowing=inValue.Cast< ::snow::window::Windowing >(); return inValue; }
		if (HX_FIELD_EQ(inName,"was_ready") ) { was_ready=inValue.Cast< bool >(); return inValue; }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"snow_config") ) { snow_config=inValue.Cast< Dynamic >(); return inValue; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"has_shutdown") ) { has_shutdown=inValue.Cast< bool >(); return inValue; }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"shutting_down") ) { shutting_down=inValue.Cast< bool >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void Snow_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("time"));
	outFields->push(HX_CSTRING("uniqueid"));
	outFields->push(HX_CSTRING("host"));
	outFields->push(HX_CSTRING("config"));
	outFields->push(HX_CSTRING("snow_config"));
	outFields->push(HX_CSTRING("io"));
	outFields->push(HX_CSTRING("input"));
	outFields->push(HX_CSTRING("assets"));
	outFields->push(HX_CSTRING("audio"));
	outFields->push(HX_CSTRING("windowing"));
	outFields->push(HX_CSTRING("shutting_down"));
	outFields->push(HX_CSTRING("has_shutdown"));
	outFields->push(HX_CSTRING("window"));
	outFields->push(HX_CSTRING("was_ready"));
	outFields->push(HX_CSTRING("is_ready"));
	super::__GetFields(outFields);
};

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

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsObject /*::snow::App*/ ,(int)offsetof(Snow_obj,host),HX_CSTRING("host")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(Snow_obj,config),HX_CSTRING("config")},
	{hx::fsObject /*Dynamic*/ ,(int)offsetof(Snow_obj,snow_config),HX_CSTRING("snow_config")},
	{hx::fsObject /*::snow::io::IO*/ ,(int)offsetof(Snow_obj,io),HX_CSTRING("io")},
	{hx::fsObject /*::snow::input::Input*/ ,(int)offsetof(Snow_obj,input),HX_CSTRING("input")},
	{hx::fsObject /*::snow::assets::Assets*/ ,(int)offsetof(Snow_obj,assets),HX_CSTRING("assets")},
	{hx::fsObject /*::snow::audio::Audio*/ ,(int)offsetof(Snow_obj,audio),HX_CSTRING("audio")},
	{hx::fsObject /*::snow::window::Windowing*/ ,(int)offsetof(Snow_obj,windowing),HX_CSTRING("windowing")},
	{hx::fsBool,(int)offsetof(Snow_obj,shutting_down),HX_CSTRING("shutting_down")},
	{hx::fsBool,(int)offsetof(Snow_obj,has_shutdown),HX_CSTRING("has_shutdown")},
	{hx::fsObject /*::snow::window::Window*/ ,(int)offsetof(Snow_obj,window),HX_CSTRING("window")},
	{hx::fsBool,(int)offsetof(Snow_obj,was_ready),HX_CSTRING("was_ready")},
	{hx::fsBool,(int)offsetof(Snow_obj,is_ready),HX_CSTRING("is_ready")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("host"),
	HX_CSTRING("config"),
	HX_CSTRING("snow_config"),
	HX_CSTRING("io"),
	HX_CSTRING("input"),
	HX_CSTRING("assets"),
	HX_CSTRING("audio"),
	HX_CSTRING("windowing"),
	HX_CSTRING("shutting_down"),
	HX_CSTRING("has_shutdown"),
	HX_CSTRING("window"),
	HX_CSTRING("was_ready"),
	HX_CSTRING("is_ready"),
	HX_CSTRING("init"),
	HX_CSTRING("shutdown"),
	HX_CSTRING("get_time"),
	HX_CSTRING("on_snow_init"),
	HX_CSTRING("on_snow_ready"),
	HX_CSTRING("do_internal_update"),
	HX_CSTRING("render"),
	HX_CSTRING("on_snow_update"),
	HX_CSTRING("dispatch_system_event"),
	HX_CSTRING("on_event"),
	HX_CSTRING("default_runtime_config"),
	HX_CSTRING("default_asset_list"),
	HX_CSTRING("default_window_config"),
	HX_CSTRING("get_uniqueid"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(Snow_obj::__mClass,"__mClass");
	HX_MARK_MEMBER_NAME(Snow_obj::core,"core");
	HX_MARK_MEMBER_NAME(Snow_obj::next_list,"next_list");
};

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

#endif

Class Snow_obj::__mClass;

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

void Snow_obj::__boot()
{
}

} // end namespace snow
