diff options
author | Stijn Buys <ingar@osirion.org> | 2007-10-21 15:13:19 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2007-10-21 15:13:19 +0000 |
commit | a96b108a9b74baaa63cb84da212d725808b91d88 (patch) | |
tree | 82b9adc7ab326f1eb8cccf79be6c871da988604f /src/server/main.cc | |
parent | f7f66525dcf08015af4f5c1b0eb9d3cec94d886d (diff) |
Initial commit
Diffstat (limited to 'src/server/main.cc')
-rw-r--r-- | src/server/main.cc | 40 |
1 files changed, 40 insertions, 0 deletions
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 <iostream> + +// 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); +} |