1313#include < vector>
1414#include < memory>
1515
16+ #include " Config.h"
1617#include " GameBoard.h"
1718#include " Player.h"
1819#include " GameView.h"
@@ -50,7 +51,6 @@ void updateViewport(int width, int height) {
5051 * Main. Initializes SDL and the model, view, and controller. Also has the main game loop.
5152 */
5253int main (int argc, char *argv[]) {
53- const int windowWidth = 900 , windowHeight = 800 ;
5454
5555 if (TTF_Init ()==-1 ) {
5656 std::cout << " Error in TTF_Init: " << TTF_GetError () << std::endl;
@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
6161 SDL_Window* displayWindow;
6262 SDL_Renderer* displayRenderer;
6363 SDL_RendererInfo displayRendererInfo;
64- SDL_CreateWindowAndRenderer (windowWidth, windowHeight , SDL_WINDOW_OPENGL, &displayWindow, &displayRenderer);
64+ SDL_CreateWindowAndRenderer (getGraphicsConfig ()[ " screen.width " ], getGraphicsConfig ()[ " screen.height " ] , SDL_WINDOW_OPENGL, &displayWindow, &displayRenderer);
6565 SDL_GetRendererInfo (displayRenderer, &displayRendererInfo);
6666 /* TODO: Check that we have OpenGL */
6767 if ((displayRendererInfo.flags & SDL_RENDERER_ACCELERATED) == 0 ||
@@ -74,7 +74,7 @@ int main(int argc, char *argv[]) {
7474
7575 initOpenGL ();
7676
77- updateViewport (windowWidth, windowHeight );
77+ updateViewport (getGraphicsConfig ()[ " screen.width " ], getGraphicsConfig ()[ " screen.height " ] );
7878
7979 GameBoard model ({" Player1" , " Player2" , " Player3" , " Player4" });
8080 GameView view (model);
0 commit comments