Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-02-04 18:42:05 +0000
committerStijn Buys <ingar@osirion.org>2008-02-04 18:42:05 +0000
commit151a2ac2434f4b4c23c107d9c21e4a18dd1a3c68 (patch)
tree18154b52b44327de28d82ff187f25c8369ddc5d9 /src/client/application.cc
parent09fb43f3d36847977ac202c10c5a11f34af03a43 (diff)
converted client:: singleton classes to namespaces
Diffstat (limited to 'src/client/application.cc')
-rw-r--r--src/client/application.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/client/application.cc b/src/client/application.cc
index 7a88155..c8eaab4 100644
--- a/src/client/application.cc
+++ b/src/client/application.cc
@@ -31,26 +31,25 @@ void Application::quit(int status)
void Application::init()
{
+ con_print << "Initializing client..." << std::endl;
// initialize core
core::ApplicationInterface::init();
- con_print << "Initializing client..." << std::endl;
-
// Initialize the video subsystem
- video.init();
- if (!video.initialized) {
+ if (!client::video::init())
quit(1);
- }
// initialize input
- input.init();
+ input::init();
// register our engine functions
- core::func_register("con_toggle", func_con_toggle);
+ core::func::add("con_toggle", func_con_toggle);
}
void Application::run()
{
+ con_print << "Running client..." << std::endl;
+
Uint32 chrono = SDL_GetTicks();
while (true) {
@@ -61,19 +60,19 @@ void Application::run()
chrono = current;
}
- // update the core chronometer
+ // run a core frame
float seconds = ((float)(current - chrono)) / 1000.0f;
frame(seconds);
- // update the video chronometers and draw
- video.frame(seconds);
+ // run a video frame
+ video::frame(seconds);
if (seconds > 0)
current_fps = floorf(1/seconds);
else
current_fps = 9999;
// process input
- input.frame();
+ input::frame(seconds);
// update the main loop chronometer
chrono = current;
@@ -83,13 +82,13 @@ void Application::run()
void Application::shutdown()
{
- con_debug << "Shutting down client..." << std::endl;
+ con_print << "Shutting down client..." << std::endl;
console.flush();
- input.shutdown();
+ input::shutdown();
console.flush();
- video.shutdown();
+ video::shutdown();
console.flush();
core::ApplicationInterface::shutdown();
@@ -98,4 +97,5 @@ void Application::shutdown()
quit(0);
}
-}
+} // namespace client
+