1 #ifndef MSP_DEMOSCENE_LAUNCHER_H_
2 #define MSP_DEMOSCENE_LAUNCHER_H_
4 #include <msp/al/context.h>
5 #include <msp/al/device.h>
6 #include <msp/core/application.h>
7 #include <msp/graphics/display.h>
8 #include <msp/graphics/glcontext.h>
9 #include <msp/graphics/window.h>
10 #include <msp/input/keyboard.h>
11 #include <msp/io/base.h>
12 #include <msp/time/timedelta.h>
13 #include <msp/time/timestamp.h>
14 #include "resources.h"
24 Msp::Graphics::WindowOptions win_opts;
25 Msp::Graphics::WindowOptions fullscreen_opts;
27 std::string frame_dump_fn;
29 Msp::Time::TimeDelta seek;
33 Options(Msp::Graphics::Display &, int, char **);
35 static void parse_size(const std::string &, Msp::Graphics::WindowOptions &);
38 Msp::Graphics::Display display;
40 Msp::Graphics::Window window;
41 Msp::Graphics::GLContext gl_context;
42 Msp::Input::Keyboard keyboard;
43 Msp::AL::Device *al_device;
44 Msp::AL::Context *al_context;
46 LaunchScreen *launch_screen;
47 Msp::Time::TimeStamp timeout;
50 Msp::Time::TimeStamp next_frame;
51 Msp::IO::Base *frame_dump;
53 char *frame_dump_buffer;
56 LauncherBase(int, char **);
60 virtual Resources &get_resources() = 0;
61 virtual Demo *create_demo() = 0;
64 void tick_launch_screen();
65 virtual void tick_demo();
67 void start_demo(bool);
68 void key_press(unsigned);
70 virtual void exit(int) = 0;
74 class Launcher: public Msp::RegisteredApplication<T>, public LauncherBase
77 Launcher(int argc, char **argv): LauncherBase(argc, argv) { }
79 virtual int main() { start(); return Msp::Application::main(); }
80 virtual void tick() { LauncherBase::tick(); }
81 virtual void exit(int c) { Msp::Application::exit(c); }