1 #ifndef DESERTPILLARS_H_
2 #define DESERTPILLARS_H_
5 #include <msp/core/application.h>
6 #include <msp/datafile/directorysource.h>
7 #include <msp/gl/camera.h>
8 #include <msp/gl/environmentmap.h>
9 #include <msp/gl/objectinstance.h>
10 #include <msp/gl/orderedscene.h>
11 #include <msp/gl/resourcemanager.h>
12 #include <msp/gl/resources.h>
13 #include <msp/gl/sequence.h>
14 #include <msp/gl/shadowmap.h>
15 #include <msp/gl/sky.h>
16 #include <msp/gl/technique.h>
17 #include <msp/gl/windowview.h>
18 #include <msp/graphics/display.h>
19 #include <msp/graphics/glcontext.h>
20 #include <msp/graphics/window.h>
21 #include <msp/input/keyboard.h>
22 #include <msp/time/timestamp.h>
24 class DesertPillars: public Msp::RegisteredApplication<DesertPillars>
29 Msp::Graphics::WindowOptions wnd_opts;
30 Msp::Graphics::GLOptions gl_opts;
35 class Resources: public Msp::GL::Resources
38 Msp::DataFile::DirectorySource source;
44 class MorphSphere: public Msp::GL::ObjectInstance
47 Msp::GL::ProgramData shdata;
50 MorphSphere(const Msp::GL::Object &o): ObjectInstance(o) { }
52 void set_morph(float);
54 virtual void setup_render(Msp::GL::Renderer &, Msp::GL::Tag) const;
57 class LightFlare: public Msp::GL::ObjectInstance
60 Msp::GL::ProgramData shdata;
63 LightFlare(const Msp::GL::Object &, unsigned);
65 virtual void setup_render(Msp::GL::Renderer &, Msp::GL::Tag) const;
68 Msp::Graphics::Display display;
70 Msp::Graphics::Window window;
71 Msp::Graphics::GLContext gl_ctx;
72 Msp::Input::Keyboard keyboard;
75 Msp::GL::WindowView view;
76 std::unique_ptr<Msp::GL::Sequence> sequence;
77 Msp::GL::Camera camera;
78 const Msp::GL::Lighting &lighting;
80 std::unique_ptr<Msp::GL::Sequence> env_seq;
81 std::unique_ptr<Msp::GL::EnvironmentMap> env_map;
82 Msp::GL::OrderedScene content;
89 Msp::GL::DirectionalLight &sun;
90 Msp::GL::Vector3 sun_node;
91 Msp::GL::Vector3 sun_axis;
92 Msp::Geometry::Angle<float> sun_angle;
94 Msp::GL::PointLight &wisp;
95 Msp::GL::Color wisp_base_color;
96 Msp::Geometry::Angle<float> wisp_angle;
99 float camera_distance;
100 Msp::Geometry::Angle<float> camera_base_height;
101 Msp::Geometry::Angle<float> camera_angle;
102 Msp::Geometry::Angle<float> sphere_angle;
104 Msp::Time::TimeStamp last_tick;
107 DesertPillars(int, char **);
113 void key_press(unsigned);