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-05 23:40:20 +0000
committerStijn Buys <ingar@osirion.org>2008-02-05 23:40:20 +0000
commit00a039fffea099eb53d2bbe77d3300b3d7ea768f (patch)
tree2255960b8f4b9c782502e9caa00703ffc134a6db /src/client/client.cc
parent1ed2e8eb1f1909a35f6fc8d5d6065bcac37c27ea (diff)
make keyboard input actually work
Diffstat (limited to 'src/client/client.cc')
-rw-r--r--src/client/client.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/client/client.cc b/src/client/client.cc
index 993e849..8970dea 100644
--- a/src/client/client.cc
+++ b/src/client/client.cc
@@ -49,7 +49,12 @@ Client app;
extern "C" void func_r_restart(std::stringstream &args)
{
video::shutdown();
- video::init();
+ console::flush();
+
+ if (!video::init()) {
+ console::flush();
+ app.quit(1);
+ }
}
//--- public ------------------------------------------------------
@@ -85,15 +90,17 @@ void Client::init()
SDL_Init(0);
// Initialize the video subsystem
- if (!client::video::init())
+ if (!video::init()) {
+ console::flush();
quit(1);
+ }
// initialize console
console::init();
-
+
// initialize input
input::init();
-
+
// add engine functions
core::func::add("r_restart", func_r_restart);
}
@@ -115,13 +122,13 @@ void Client::run()
// run a core frame
float seconds = ((float)(current - chrono)) / 1000.0f;
core::Application::frame(seconds);
-
+
// run a video frame
video::frame(seconds);
-
+
// process input
input::frame(seconds);
-
+
// update the main loop chronometer
chrono = current;
}