diff --git a/include/AppCore.hpp b/include/AppCore.hpp index c2a2494..6d496b4 100644 --- a/include/AppCore.hpp +++ b/include/AppCore.hpp @@ -5,14 +5,13 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: AppCore.hpp,v 1.8 2005/07/19 05:45:22 cozman Exp $ +// $Id: AppCore.hpp,v 1.9 2005/08/02 23:07:51 cozman Exp $ #ifndef PHOTON_APPCORE_HPP #define PHOTON_APPCORE_HPP #include "types.hpp" #include "util/VersionInfo.hpp" -#include "util/Singleton.hpp" #include "Task.hpp" #include "InputListener.hpp" @@ -22,20 +21,21 @@ namespace photon { // Class: AppCore -// Photon's core for application behavior. Defines the interface -// through which all "application" related functions are performed. +// Photon's core for application behavior. Defines the interface through which +// all "application" related functions are performed. This means input, +// display creation, etc. // // AppCore is the Core that essentially represents the window management, // input, and timing systems. -// -// Parent: -// -class AppCore : public util::Singleton +class AppCore { public: AppCore(); ~AppCore(); + + void init(); + void shutdown(); // Group: Video public: diff --git a/include/Application.hpp b/include/Application.hpp index 9811a1d..38082e0 100644 --- a/include/Application.hpp +++ b/include/Application.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.hpp,v 1.9 2005/07/19 01:31:37 cozman Exp $ +// $Id: Application.hpp,v 1.10 2005/08/02 23:07:51 cozman Exp $ #ifndef PHOTON_APPLICATION_HPP #define PHOTON_APPLICATION_HPP @@ -18,6 +18,10 @@ #include "types.hpp" #include "util/VersionInfo.hpp" #include "Task.hpp" +#include "Kernel.hpp" +#include "AppCore.hpp" +#include "video/VideoCore.hpp" +#include "audio/AudioCore.hpp" namespace photon { @@ -55,6 +59,15 @@ public: // See Also: // virtual int main(const StrVec& args)=0; + +// Group: Core Access +public: + static Kernel& getKernel(); + static AppCore& getAppCore(); + static video::VideoCore& getVideoCore(); + static audio::AudioCore& getAudioCore(); + static void initVideoCore(uint width, uint height); + static void initAudioCore(const std::string& deviceName); // behind the scenes public: @@ -67,6 +80,12 @@ private: private: // version number for photon util::VersionInfo photonVer_; + + // Cores and Kernel + static Kernel kernel_; + static AppCore appCore_; + static std::auto_ptr videoCore_; + static std::auto_ptr audioCore_; static std::string arg0_; }; diff --git a/include/Kernel.hpp b/include/Kernel.hpp index 771cdcb..cf77314 100644 --- a/include/Kernel.hpp +++ b/include/Kernel.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Kernel.hpp,v 1.1 2005/03/15 19:22:07 cozman Exp $ +// $Id: Kernel.hpp,v 1.2 2005/08/02 23:07:52 cozman Exp $ #ifndef PHOTON_KERNEL_HPP #define PHOTON_KERNEL_HPP @@ -13,21 +13,20 @@ #include #include -#include "util/Singleton.hpp" #include "Task.hpp" namespace photon { // Class: Kernel -// Singleton Kernel class, maintains a list of and manages their -// status, including adding, deleting, pausing, and unpausing tasks. +// Kernel class, maintains a list of and manages their status, +// handles adding, deleting, pausing, and unpausing tasks. // // To use Kernel: // - (1) Add any tasks (should be derived from ) // - (2) call // - (3) in order to avoid running forever, all tasks should eventually die -class Kernel : public util::Singleton +class Kernel { // Group: (Con/De)structors diff --git a/include/Log.hpp b/include/Log.hpp index 4b5d34c..edb70dc 100644 --- a/include/Log.hpp +++ b/include/Log.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Log.hpp,v 1.7 2005/07/19 01:31:37 cozman Exp $ +// $Id: Log.hpp,v 1.8 2005/08/02 23:07:52 cozman Exp $ #ifndef PHOTON_LOG_HPP #define PHOTON_LOG_HPP @@ -14,7 +14,6 @@ #include #include -#include "util/Singleton.hpp" #include "LogSink.hpp" namespace photon diff --git a/include/audio/AudioCore.hpp b/include/audio/AudioCore.hpp index 687466e..5aaf329 100644 --- a/include/audio/AudioCore.hpp +++ b/include/audio/AudioCore.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: AudioCore.hpp,v 1.9 2005/07/19 05:56:08 cozman Exp $ +// $Id: AudioCore.hpp,v 1.10 2005/08/02 23:07:52 cozman Exp $ #ifdef PHOTON_USE_OPENAL @@ -24,20 +24,18 @@ namespace audio { // Class: AudioCore -// Photon's core for audio manipulation/control. Defines the -// interface through which all audio related functions are performed. -// -// Parent: -// -class AudioCore : public util::Singleton +// Photon's core for audio manipulation/control. Defines the interface through +// which all audio related functions are performed. +class AudioCore { // Group: (Con/De)structors public: // Function: AudioCore // Initialize underlying APIs and setup internals. + //AudioCore(); AudioCore(const std::string& deviceName); - + // Function: ~AudioCore // Shutdown underlying APIs. ~AudioCore(); diff --git a/include/video/VideoCore.hpp b/include/video/VideoCore.hpp index 8a899f0..4ebdf10 100644 --- a/include/video/VideoCore.hpp +++ b/include/video/VideoCore.hpp @@ -5,13 +5,12 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: VideoCore.hpp,v 1.4 2005/07/20 06:12:54 cozman Exp $ +// $Id: VideoCore.hpp,v 1.5 2005/08/02 23:07:52 cozman Exp $ #ifndef PHOTON_VIDEO_VIDEOCORE_HPP #define PHOTON_VIDEO_VIDEOCORE_HPP #include "types.hpp" -#include "util/Singleton.hpp" #include "Task.hpp" namespace photon @@ -20,24 +19,25 @@ namespace video { // Class: VideoCore -// Photon's core for graphics behavior. Defines the interface -// through which all graphics related functions are performed. +// Photon's core for graphics behavior. Defines the interface through which +// all graphics related functions are performed. // // VideoCore is the Core that interfaces with the actual drawing/updating of // the display. // // See Also: // -// -// Parent: -// -class VideoCore : public util::Singleton +class VideoCore { // Group: (Con/De)structors public: // Function: VideoCore // Initialize underlying APIs and setup internals. - VideoCore(); + // + // Parameters: + // width - Width of display. + // height - height of display + VideoCore(uint width, uint height); // Function: ~VideoCore // Shutdown underlying APIs. diff --git a/photon.mm b/photon.mm index e0a43e3..10f7c93 100644 --- a/photon.mm +++ b/photon.mm @@ -35,7 +35,9 @@ - + + + @@ -159,7 +161,7 @@ - + diff --git a/src/AppCore.cpp b/src/AppCore.cpp index 74a8d23..7cbe47f 100644 --- a/src/AppCore.cpp +++ b/src/AppCore.cpp @@ -5,13 +5,14 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: AppCore.cpp,v 1.13 2005/07/20 06:12:54 cozman Exp $ +// $Id: AppCore.cpp,v 1.14 2005/08/02 23:07:52 cozman Exp $ #include "AppCore.hpp" #include #include "GL/glfw.h" //This file depends on glfw +#include "Application.hpp" #include "Kernel.hpp" #include "exceptions.hpp" #include "video/VideoCore.hpp" @@ -26,19 +27,24 @@ std::vector AppCore::pressedKeys_; AppCore::AppCore() : dispWidth_(0), dispHeight_(0), task_(new UpdateTask()) +{ } + +AppCore::~AppCore() +{ +} + +void AppCore::init() { util::VersionInfo glfwReq(2,4,2); // requires GLFW 2.4.2 util::ensureVersion("GLFW", initGLFW(), glfwReq); - Kernel::getInstance().addTask(task_); // add updater task + Application::getKernel().addTask(task_); // add updater task } -AppCore::~AppCore() +void AppCore::shutdown() { - if(dispWidth_ && dispHeight_) { - video::VideoCore::destroy(); // destroy videocore glfwCloseWindow(); //close GLFW window } @@ -66,10 +72,9 @@ void AppCore::createDisplay(uint width, uint height, glfwSetMousePosCallback(AppCore::mouseMoveCallback); //glfwSetMouseWheelCallback(AppCore::mouseWheelCallback); + Application::initVideoCore(width, height); dispWidth_ = width; dispHeight_ = height; - new video::VideoCore; // _MUST_ create the VideoCore after the window! - video::VideoCore::getInstance().setDisplaySize(width,height); glfwSetWindowTitle(title.c_str()); // title is set separately } @@ -314,7 +319,7 @@ void AppCore::UpdateTask::update() ( (glfwGetKey(GLFW_KEY_LALT) || glfwGetKey(GLFW_KEY_RALT)) && (glfwGetKey(GLFW_KEY_F4) || glfwGetKey('X')) ) ) { - Kernel::getInstance().killAllTasks(); + Application::getKernel().killAllTasks(); } // hold active-state diff --git a/src/Application.cpp b/src/Application.cpp index 2d29f3c..a6e662f 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.cpp,v 1.13 2005/07/19 18:35:20 cozman Exp $ +// $Id: Application.cpp,v 1.14 2005/08/02 23:07:52 cozman Exp $ #include "Application.hpp" @@ -25,25 +25,84 @@ namespace photon { +Kernel Application::kernel_; +AppCore Application::appCore_; +std::auto_ptr Application::videoCore_; +std::auto_ptr Application::audioCore_; +std::string Application::arg0_; + Application::Application() : photonVer_(0,0,1) // this is the current version { util::VersionInfo physfsReq(1,0,0); // requires PhysFS 1.0.0 - - // create the singletons - new Kernel; - new AppCore; - util::ensureVersion("PhysFS", initPhysFS(), physfsReq); + + appCore_.init(); // init appcore } Application::~Application() { - PHYSFS_deinit(); //shutdown PhysFS + appCore_.shutdown(); // shutdown appcore + + PHYSFS_deinit(); // shutdown PhysFS +} - // destroy the singletons - AppCore::destroy(); - Kernel::destroy(); +Kernel& Application::getKernel() +{ + return kernel_; +} + +AppCore& Application::getAppCore() +{ + return appCore_; +} + +video::VideoCore& Application::getVideoCore() +{ + // return VideoCore if it has been created + if(videoCore_.get() == 0) + { + throw PreconditionException("call to Application::getVideoCore() before" + " Application::initAudioDevice"); + } + return *videoCore_; +} + +audio::AudioCore& Application::getAudioCore() +{ + // return AudioCore if it has been created + if(audioCore_.get() == 0) + { + throw PreconditionException("call to Application::getAudioCore() before" + " Application::initAudioDevice"); + } + return *audioCore_; +} + +void Application::initVideoCore(uint width, uint height) +{ + // create VideoCore, avoid double initializaiton + if(videoCore_.get() == 0) + { + videoCore_.reset(new video::VideoCore(width, height)); + } + else + { + throw PreconditionException("Attempt to double initialize VideoCore"); + } +} + +void Application::initAudioCore(const std::string& deviceName) +{ + // create AudioCore, avoid double initializaiton + if(audioCore_.get() == 0) + { + audioCore_.reset(new audio::AudioCore(deviceName)); + } + else + { + throw PreconditionException("Attempt to double initialize AudioCore"); + } } void Application::setInitOptions(const char* arg0) @@ -60,6 +119,4 @@ util::VersionInfo Application::initPhysFS() return util::VersionInfo(ver.major, ver.minor, ver.patch); } -std::string Application::arg0_; - } diff --git a/src/audio/AudioCore.cpp b/src/audio/AudioCore.cpp index 2576b21..7885529 100644 --- a/src/audio/AudioCore.cpp +++ b/src/audio/AudioCore.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: AudioCore.cpp,v 1.10 2005/07/19 18:35:20 cozman Exp $ +// $Id: AudioCore.cpp,v 1.11 2005/08/02 23:07:52 cozman Exp $ #ifdef PHOTON_USE_OPENAL @@ -19,12 +19,13 @@ namespace photon namespace audio { -AudioCore::AudioCore(const std::string& deviceName) -{ +//AudioCore::AudioCore() +AudioCore::AudioCore(const std::string& deviceName) +{ //util::VersionInfo oalReq(0,0,7); // requires OpenAL 1.0 (TODO: check?) //util::ensureVersion("OpenAL", initOpenAL(), oalReq); - initOpenAL(deviceName); // don't check version for now + initOpenAL(deviceName); // don't check version for now } AudioCore::~AudioCore() @@ -36,7 +37,7 @@ AudioCore::~AudioCore() // destroy context & device alcDestroyContext(context); alcCloseDevice(device); - + // set current context to null alcMakeContextCurrent(0); } @@ -147,7 +148,7 @@ util::VersionInfo AudioCore::initOpenAL(const std::string& deviceName) void AudioCore::initAudioDevice(const std::string& deviceName) { - new AudioCore(deviceName); + // new AudioCore(deviceName); } diff --git a/src/util/Timer.cpp b/src/util/Timer.cpp index ed2c42d..5bc640f 100644 --- a/src/util/Timer.cpp +++ b/src/util/Timer.cpp @@ -5,9 +5,10 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Timer.cpp,v 1.3 2005/07/18 06:18:50 cozman Exp $ +// $Id: Timer.cpp,v 1.4 2005/08/02 23:07:52 cozman Exp $ #include "util/Timer.hpp" +#include "Application.hpp" namespace photon { @@ -15,7 +16,7 @@ namespace util { Timer::Timer(bool appTimeLinked) : - appCore_(AppCore::getInstance()), + appCore_(Application::getAppCore()), appTimeLinked_(appTimeLinked) { reset(); //initializes other members diff --git a/src/video/VideoCore.cpp b/src/video/VideoCore.cpp index e8af6b3..c189945 100644 --- a/src/video/VideoCore.cpp +++ b/src/video/VideoCore.cpp @@ -5,35 +5,36 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: VideoCore.cpp,v 1.8 2005/07/20 06:12:54 cozman Exp $ +// $Id: VideoCore.cpp,v 1.9 2005/08/02 23:07:53 cozman Exp $ #include "video/VideoCore.hpp" +#include "Application.hpp" #include "Kernel.hpp" #include "exceptions.hpp" #include "GL/gl.h" #include "GL/glu.h" -#include + namespace photon { namespace video { -VideoCore::VideoCore() : - displayWidth_(0), displayHeight_(0), +VideoCore::VideoCore(uint width, uint height) : + displayWidth_(width), displayHeight_(height), viewportWidth_(0), viewportHeight_(0) { initOpenGL(); + setOrthoView(); //add updater task - Kernel::getInstance().addTask(shared_ptr(new UpdateTask())); + Application::getKernel().addTask(shared_ptr(new UpdateTask())); } VideoCore::~VideoCore() { } - void VideoCore::setOrthoView(int x, int y, int viewWidth, int viewHeight, scalar orthoWidth, scalar orthoHeight) { diff --git a/test/Audio_test.cpp b/test/Audio_test.cpp index a901723..8ea3107 100644 --- a/test/Audio_test.cpp +++ b/test/Audio_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Audio_test.cpp,v 1.7 2005/07/20 07:30:13 cozman Exp $ +// $Id: Audio_test.cpp,v 1.8 2005/08/02 23:07:53 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -23,7 +23,7 @@ class MainTask : public Task , public InputListener public: MainTask() : Task("MainTask"), - video(video::VideoCore::getInstance()) + video(Application::getVideoCore()) { video.setOrthoView(800,600); // setup view @@ -197,20 +197,17 @@ public: int main(const StrVec& args) { // create window - AppCore::getInstance().createDisplay(800,600,32,0,0,false); + Application::getAppCore().createDisplay(800,600,32,0,0,false); // create sound device - AudioCore::initAudioDevice("OSS"); + Application::initAudioCore("OSS"); // be sure to add FPSDisplayTask - Kernel::getInstance().addTask(TaskPtr(new FPSDisplayTask())); + Application::getKernel().addTask(TaskPtr(new FPSDisplayTask())); // add the main task to the Kernel - Kernel::getInstance().addTask(TaskPtr(new MainTask())); + Application::getKernel().addTask(TaskPtr(new MainTask())); // run Kernel until task finishes - Kernel::getInstance().run(); + Application::getKernel().run(); - // destroy AudioCore, shuts down audio system - AudioCore::destroy(); - return 0; } }; diff --git a/test/FPSDisplayTask.hpp b/test/FPSDisplayTask.hpp index 9065785..b582161 100644 --- a/test/FPSDisplayTask.hpp +++ b/test/FPSDisplayTask.hpp @@ -12,7 +12,7 @@ class FPSDisplayTask : public photon::Task public: FPSDisplayTask() : Task("FPSDisplayTask", 1000000), // extremely low priority - app(photon::AppCore::getInstance()), + app(photon::Application::getAppCore()), lastUpdate(0) { } diff --git a/test/Font_test.cpp b/test/Font_test.cpp index 802b1ea..b65fc36 100644 --- a/test/Font_test.cpp +++ b/test/Font_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Font_test.cpp,v 1.8 2005/07/20 07:30:13 cozman Exp $ +// $Id: Font_test.cpp,v 1.9 2005/08/02 23:07:53 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -17,8 +17,8 @@ class MainTask : public Task public: MainTask() : Task("MainTask"), - app(AppCore::getInstance()), - video(video::VideoCore::getInstance()) + app(Application::getAppCore()), + video(Application::getVideoCore()) { video.setOrthoView(800,600); @@ -59,13 +59,13 @@ public: int main(const StrVec& args) { - AppCore::getInstance().createDisplay(800,600,32,0,0,false); + Application::getAppCore().createDisplay(800,600,32,0,0,false); // be sure to add FPSDisplayTask - Kernel::getInstance().addTask(TaskPtr(new FPSDisplayTask())); - Kernel::getInstance().addTask(TaskPtr(new MainTask())); + Application::getKernel().addTask(TaskPtr(new FPSDisplayTask())); + Application::getKernel().addTask(TaskPtr(new MainTask())); - Kernel::getInstance().run(); + Application::getKernel().run(); return 0; } diff --git a/test/Image_test.cpp b/test/Image_test.cpp index ee35704..bb5df81 100644 --- a/test/Image_test.cpp +++ b/test/Image_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Image_test.cpp,v 1.7 2005/07/20 06:12:13 cozman Exp $ +// $Id: Image_test.cpp,v 1.8 2005/08/02 23:07:53 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -17,8 +17,8 @@ class MainTask : public Task public: MainTask() : Task("MainTask"), - app(AppCore::getInstance()), - video(video::VideoCore::getInstance()) + app(Application::getAppCore()), + video(Application::getVideoCore()) { video.setOrthoView(800,600); @@ -68,13 +68,13 @@ public: int main(const StrVec& args) { - AppCore::getInstance().createDisplay(800,600,32,0,0,false); + Application::getAppCore().createDisplay(800,600,32,0,0,false); // be sure to add FPSDisplayTask - Kernel::getInstance().addTask(TaskPtr(new FPSDisplayTask())); - Kernel::getInstance().addTask(TaskPtr(new MainTask())); - - Kernel::getInstance().run(); + Application::getKernel().addTask(TaskPtr(new FPSDisplayTask())); + Application::getKernel().addTask(TaskPtr(new MainTask())); + + Application::getKernel().run(); return 0; } diff --git a/test/Input_test.cpp b/test/Input_test.cpp index c3dd9bb..1f17c80 100644 --- a/test/Input_test.cpp +++ b/test/Input_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Input_test.cpp,v 1.5 2005/07/20 07:30:13 cozman Exp $ +// $Id: Input_test.cpp,v 1.6 2005/08/02 23:07:53 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -17,8 +17,8 @@ class MainTask : public Task, public InputListener public: MainTask() : Task("MainTask"), - app(AppCore::getInstance()), - video(video::VideoCore::getInstance()) + app(Application::getAppCore()), + video(Application::getVideoCore()) { video.setOrthoView(800,600); @@ -123,13 +123,13 @@ public: int main(const StrVec& args) { - AppCore::getInstance().createDisplay(800,600,32,0,0,false); + Application::getAppCore().createDisplay(800,600,32,0,0,false); // be sure to add FPSDisplayTask - Kernel::getInstance().addTask(TaskPtr(new FPSDisplayTask())); - Kernel::getInstance().addTask(TaskPtr(new MainTask())); + Application::getKernel().addTask(TaskPtr(new FPSDisplayTask())); + Application::getKernel().addTask(TaskPtr(new MainTask())); - Kernel::getInstance().run(); + Application::getKernel().run(); return 0; } diff --git a/test/Pen_test.cpp b/test/Pen_test.cpp index bd6ceb4..31c3aa9 100644 --- a/test/Pen_test.cpp +++ b/test/Pen_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Pen_test.cpp,v 1.5 2005/07/20 06:12:13 cozman Exp $ +// $Id: Pen_test.cpp,v 1.6 2005/08/02 23:07:53 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -17,8 +17,8 @@ class MainTask : public Task public: MainTask() : Task("MainTask"), - app(AppCore::getInstance()), - video(video::VideoCore::getInstance()) + app(Application::getAppCore()), + video(Application::getVideoCore()) { video.setOrthoView(800,600); @@ -83,13 +83,13 @@ public: int main(const StrVec& args) { - AppCore::getInstance().createDisplay(800,600,32,0,0,false); + Application::getAppCore().createDisplay(800,600,32,0,0,false); // be sure to add FPSDisplayTask - Kernel::getInstance().addTask(TaskPtr(new FPSDisplayTask())); - Kernel::getInstance().addTask(TaskPtr(new MainTask())); + Application::getKernel().addTask(TaskPtr(new FPSDisplayTask())); + Application::getKernel().addTask(TaskPtr(new MainTask())); - Kernel::getInstance().run(); + Application::getKernel().run(); return 0; } diff --git a/test/Texture_test.cpp b/test/Texture_test.cpp index 11ed492..267fc00 100644 --- a/test/Texture_test.cpp +++ b/test/Texture_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Texture_test.cpp,v 1.6 2005/07/20 06:12:13 cozman Exp $ +// $Id: Texture_test.cpp,v 1.7 2005/08/02 23:07:53 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -17,8 +17,8 @@ class MainTask : public Task public: MainTask() : Task("MainTask"), - app(AppCore::getInstance()), - video(video::VideoCore::getInstance()) + app(Application::getAppCore()), + video(Application::getVideoCore()) { video.setOrthoView(800,600); @@ -83,13 +83,13 @@ public: int main(const StrVec& args) { - AppCore::getInstance().createDisplay(800,600,32,0,0,false); + Application::getAppCore().createDisplay(800,600,32,0,0,false); // be sure to add FPSDisplayTask - Kernel::getInstance().addTask(TaskPtr(new FPSDisplayTask())); - Kernel::getInstance().addTask(TaskPtr(new MainTask())); + Application::getKernel().addTask(TaskPtr(new FPSDisplayTask())); + Application::getKernel().addTask(TaskPtr(new MainTask())); - Kernel::getInstance().run(); + Application::getKernel().run(); return 0; }