1680388189
- Integrate SDL2 GUI rendering into the Game class - Update World::getSurfaceLevel to correctly identify surface height - Improve ASSERT_EQ macro to avoid multiple evaluation of arguments - Fix typo in main_gui.cpp include - Update CMakeLists.txt to include Threads package
24 lines
545 B
C++
24 lines
545 B
C++
#include "include/Game.h"
|
|
#include "include/Renderer.h"
|
|
|
|
#include <exception>
|
|
#include <iostream>
|
|
|
|
int main() {
|
|
try {
|
|
Renderer renderer;
|
|
if ( !renderer.init() ) {
|
|
std::cerr << "Could not initialize SDL2 renderer.\n";
|
|
return 1;
|
|
}
|
|
renderer.setAutoAdvanceMs( 900 );
|
|
Game game;
|
|
game.setRenderer( &renderer );
|
|
game.run();
|
|
return 0;
|
|
} catch ( const std::exception& e ) {
|
|
std::cerr << "Fatal error: " << e.what() << "\n";
|
|
return 1;
|
|
}
|
|
}
|