]> Dogcows Code - chaz/yoink/blobdiff - src/Main.cc
further implementing runloop support
[chaz/yoink] / src / Main.cc
index e16803739ae6e809d5bf049040debbb3b75e93fd..070912e7ce1a0c7acb8fb7c3e1f75adf6cb151eb 100644 (file)
@@ -26,6 +26,7 @@ inline int isatty(int dummy) { return 0; }
 #include <stlplus/portability/file_system.hpp>
 #include <stlplus/portability/subprocesses.hpp>
 
+#include <moof/image.hh>
 #include <moof/log.hh>
 #include <moof/modal_dialog.hh>
 #include <moof/opengl.hh>
@@ -34,9 +35,7 @@ inline int isatty(int dummy) { return 0; }
 #include <moof/string.hh>
 #include <moof/video.hh>
 
-#include "GameLayer.hh"
 #include "Main.hh"
-#include "TitleLayer.hh"
 #include "version.h"
 
 
@@ -58,6 +57,7 @@ Main::Main(moof::settings& settings) :
 
 void Main::update(moof::scalar t, moof::scalar dt)
 {
+       yoink.update(t, dt);
 }
 
 void Main::draw(moof::scalar alpha) const
@@ -69,10 +69,14 @@ void Main::draw(moof::scalar alpha) const
 
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
+
+       yoink.draw(alpha);
 }
 
 void Main::handle_event(const moof::event& event)
 {
+       if (yoink.handle_event(event)) return;
+
        switch (event.type)
        {
                case SDL_KEYUP:
@@ -150,7 +154,7 @@ std::string Main::config_paths()
 
 void Main::setup_opengl()
 {
-       //glEnable(GL_TEXTURE_2D);
+       glEnable(GL_TEXTURE_2D);
        glEnable(GL_DEPTH_TEST);
        //glEnable(GL_CULL_FACE);
 
@@ -260,6 +264,11 @@ void Main::print_info(int argc, char* argv[])
 #else
        print_option("debug", false);
 #endif
+#if ENABLE_DOUBLE_PRECISION
+       print_option("double", true);
+#else
+       print_option("double", false);
+#endif
 #if WITH_GTK
        print_option("gtk", true);
 #else
@@ -359,6 +368,7 @@ int main(int argc, char* argv[])
 
                class moof::video::attributes attributes(settings);
                moof::video video(PACKAGE_STRING, attributes);
+               video.show_fps(true);
 
                Main app(settings);
                return app.run();
This page took 0.018966 seconds and 4 git commands to generate.