X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=demos%2Fdesertpillars%2Fsource%2Fdesertpillars.h;fp=demos%2Fdesertpillars%2Fsource%2Fdesertpillars.h;h=aac5862e166607633a6a2b434d5e6bb316874490;hb=8033bd7822b4f24d86be186c47ba7e6d69931eeb;hp=0000000000000000000000000000000000000000;hpb=57232117bfab90f5dd80131daa47d2f184de9ae2;p=libs%2Fgl.git diff --git a/demos/desertpillars/source/desertpillars.h b/demos/desertpillars/source/desertpillars.h new file mode 100644 index 00000000..aac5862e --- /dev/null +++ b/demos/desertpillars/source/desertpillars.h @@ -0,0 +1,97 @@ +#ifndef DESERTPILLARS_H_ +#define DESERTPILLARS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class DesertPillars: public Msp::RegisteredApplication +{ +private: + struct Options + { + Msp::Graphics::WindowOptions wnd_opts; + Msp::Graphics::GLOptions gl_opts; + + Options(); + }; + + class Resources: public Msp::GL::Resources + { + private: + Msp::DataFile::DirectorySource source; + + public: + Resources(); + }; + + class MorphSphere: public Msp::GL::ObjectInstance + { + private: + Msp::GL::ProgramData shdata; + + public: + MorphSphere(const Msp::GL::Object &o): ObjectInstance(o) { } + + void set_morph(float); + + virtual void setup_render(Msp::GL::Renderer &, Msp::GL::Tag) const; + }; + + Msp::Graphics::Display display; + Options opts; + Msp::Graphics::Window window; + Msp::Graphics::GLContext gl_ctx; + Msp::Input::Keyboard keyboard; + Resources resources; + + Msp::GL::WindowView view; + std::unique_ptr sequence; + Msp::GL::Camera camera; + + std::unique_ptr sky; + std::unique_ptr shadow_seq; + std::unique_ptr shadow_map; + std::unique_ptr env_seq; + std::unique_ptr env_map; + Msp::GL::OrderedScene content; + + MorphSphere sphere; + float sphere_morph; + bool sphere_frozen; + bool sphere_stopped; + + float camera_distance; + Msp::Geometry::Angle camera_base_height; + Msp::Geometry::Angle camera_angle; + Msp::Geometry::Angle sphere_angle; + bool camera_stopped; + Msp::Time::TimeStamp last_tick; + +public: + DesertPillars(int, char **); + + virtual int main(); +private: + virtual void tick(); + + void key_press(unsigned); +}; + +#endif