/* client/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 */ // SDL headers #include // C++ headers #include // project headers #include "osirion.h" #include "game/game.h" #include "input.h" #include "video.h" void quit(int status) { SDL_Quit(); exit(status); } int main( int argc, char *argv[] ) { std::cout << "Project::OSiRiON " << OSIRION_VERSION << std::endl; // Initialize the video subsystem client::Video::init(); if (!client::Video::initialized) { quit(1); } // initialize input client::Input::init(); // initialize game game::init(); Uint32 startup = SDL_GetTicks(); while(game::initialized) { Uint32 chrono = SDL_GetTicks(); // overflow protection ~49 days if (chrono < startup) { startup = chrono; } // update the game chronometers float elapsed = (float) ( chrono - startup) / 1000.0f; game::update(elapsed); // update the video chronometers and draw client::Video::draw(elapsed); startup = chrono; // process input client::Input::process(); } client::Video::shutdown(); quit(0); }