/* * Copyright (c) 2012-2015 Daniele Bartolini and individual contributors. * License: https://github.com/taylor001/crown/blob/master/LICENSE */ #include "crown.h" #include "memory.h" #include "console_server.h" #include "bundle_compiler.h" #include "device.h" #include "command_line.h" #include "json_parser.h" #include "main.h" #include "audio.h" #include "physics.h" #include "disk_filesystem.h" #include "config.h" #include "math_utils.h" #include "profiler.h" #include "temp_allocator.h" #include namespace crown { static void help(const char* msg = NULL) { if (msg) { printf("Error: %s\n", msg); } printf( "Usage: crown [options]\n" "Options:\n\n" " -h --help Show this help.\n" " -v --version Show version informations.\n" " --bundle-dir Use as the source directory for compiled resources.\n" " --console-port Set port of the console.\n" " --parent-window Set the parent window of the main window.\n" " Used only by tools.\n" "\nAvailable only in debug and development builds:\n\n" " --source-dir Use as the source directory for resource compilation.\n" " --project Start the project .\n" " --compile Do a full compile of the resources.\n" " --platform Compile resources for the given .\n" " Possible values for are:\n" " linux\n" " windows\n" " android\n" " --continue Continue the execution after the resource compilation step.\n" " --wait-console Wait for a console connection before starting up.\n" ); } bool init(const DeviceOptions& opts, Filesystem& fs) { profiler_globals::init(); audio_globals::init(); physics_globals::init(); bgfx::init(); device_globals::init(opts, fs); return true; } void update() { while (!process_events() && device()->is_running()) { profiler_globals::clear(); console_server_globals::update(); device()->update(); bgfx::frame(); profiler_globals::flush(); } } void shutdown() { device_globals::shutdown(); bgfx::shutdown(); physics_globals::shutdown(); audio_globals::shutdown(); profiler_globals::shutdown(); } } // namespace crown