From 6f097a3171412b4852f32b4c08c0f421e6c3c100 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Mon, 7 Sep 2015 10:40:26 -0400 Subject: switched to 32 bits --- Makefile | 2 +- src/main.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 28effcc..51529c2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ FLAGS_LINUX = -lGL -lSDL_image FLAGS_WIN32 = -lopengl32 -lmingw32 -lSDL2_Image -FLAGS = -Wall -Werror -lSDL2main -lSDL2 +FLAGS = -m32 -Wall -Werror -lSDL2main -lSDL2 all: @g++ src/main.cpp -o main $(FLAGS_LINUX) $(FLAGS) diff --git a/src/main.cpp b/src/main.cpp index 94e4934..5407389 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -20,6 +21,7 @@ int main(int argc,char **argv){ if(SDL_Init(SDL_INIT_VIDEO) < 0){ std::cout << "SDL was not able to initialize! Error: " << SDL_GetError() << std::endl; }else{ + atexit(SDL_Quit); //Turn on double Buffering SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); //create the window @@ -41,7 +43,7 @@ int main(int argc,char **argv){ //set renderer gRenderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); if(gRenderer == NULL){ - std::cout << "The variable 'gRenderer' was not able to initialize! Error: " << SDL_GetError() << std::endl;\ + std::cout << "The variable 'gRenderer' was not able to initialize! Error: " << SDL_GetError() << std::endl; } //background white SDL_FillRect(renderSurface, NULL, SDL_MapRGB(renderSurface->format, 0xFF, 0xFF, 0xFF)); @@ -53,6 +55,5 @@ int main(int argc,char **argv){ //closes the window and frees resources SDL_GL_DeleteContext(mainGLContext); SDL_DestroyWindow(window); - SDL_Quit(); return 0; } -- cgit v1.2.3