Tetris/main.cpp
2014-11-07 20:47:50 +01:00

45 lines
532 B
C++

#include <iostream>
#include <ctime>
#include <cstdlib>
#include <SDL/SDL.h>
#include "resource.hpp"
#include "global.hpp"
#include "game.hpp"
#include "states.hpp"
using namespace std;
int main ( int argc, char ** argv )
{
srand ( time ( NULL ) );
game Game;
if ( !Game.Init() )
{
return 0;
}
Game.ChangeState ( MenuState::Instance() );
while ( Game.Running() )
{
Game.SetStart ( SDL_GetTicks() );
Game.HandleEvents();
Game.Update();
Game.Draw();
Game.ReduceFPS();
}
Game.Clean();
return 0;
}