From a96b108a9b74baaa63cb84da212d725808b91d88 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 21 Oct 2007 15:13:19 +0000 Subject: Initial commit --- src/server/main.cc | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/server/main.cc (limited to 'src/server/main.cc') diff --git a/src/server/main.cc b/src/server/main.cc new file mode 100644 index 0000000..3ce5197 --- /dev/null +++ b/src/server/main.cc @@ -0,0 +1,40 @@ +/* server/main.cc + This file is part of the Osirion project and is distributed under + the terms and conditions of the GNU General Public License version 2 +*/ + +// C++ headers +#include + +// project headers +#include "osirion.h" + +#include "game/game.h" +#include "timer.h" + +void quit(int status) +{ + exit(status); +} + +int main( int argc, char *argv[] ) +{ + const float server_framerate = 1.0f / 20.0f; + std::cout << "The Osirion project " << OSIRION_VERSION << std::endl; + Timer timer; + + // initialize game + game::init(); + timer.mark(); + + while(game::initialized) { + float elapsed = timer.elapsed(); + game::update(elapsed); + timer.sleep(server_framerate - elapsed); + timer.mark(); + } + // shutdown + game::shutdown(); + + quit(0); +} -- cgit v1.2.3