From cfed6d4cd8cd195d0f287f81eb1b650de0d8e09d Mon Sep 17 00:00:00 2001 From: Raydelto Hernandez Date: Sat, 9 Mar 2019 02:26:34 -0400 Subject: [PATCH] Fixing MAC build --- .vscode/settings.json | 5 +++++ .vscode/tasks.json | 16 ++++++++++++++++ Makefile | 27 +++++++++++++-------------- src/main.cpp | 8 ++++++-- src/sound.cpp | 2 +- src/texture.cpp | 2 +- src/worlds.cpp | 2 +- 7 files changed, 43 insertions(+), 19 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0cba2e6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "iostream": "cpp" + } +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..65f4d2b --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,16 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "cd ~/git/polly-b-gone/&&make&&cd obj/Polly-B-Gone.app/&&./Contents/MacOS/Polly-B-Gone", + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index 5ff2ae9..f8b57bb 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,19 @@ -CXXFLAGS = \ - -O2 \ - -I/System/Library/Frameworks/GLUT.framework/Headers \ - -I/System/Library/Frameworks/OpenGL.framework/Headers \ - -I/System/Library/Frameworks/SDL.framework/Headers \ - -I/System/Library/Frameworks/SDL_image.framework/Headers \ - -I/System/Library/Frameworks/SDL_mixer.framework/Headers \ - -I/System/Library/Frameworks/TinyXML.framework/Headers +CXXFLAGS = -L/System/Library/Frameworks LDFLAGS = \ + -L/System/Library/Frameworks \ + -I/usr/local/Cellar/tinyxml/2.6.2/include \ + -I/Library/Frameworks/SDL.framework/Headers \ + -I/Library/Frameworks/SDL_image.framework/Headers \ + -F/Library/Frameworks \ -framework Cocoa \ -framework GLUT \ -framework OpenGL \ - -framework SDL \ + -framework SDL\ -framework SDL_image \ -framework SDL_mixer \ - -framework TinyXML + -L/usr/local/Cellar/tinyxml/2.6.2/lib \ + -ltinyxml RESOURCES = \ resources/Polly.icns \ @@ -87,10 +86,10 @@ obj/Polly-B-Gone.app : obj/main.out $(RESOURCES) resources/Info.plist Makefile cp resources/Info.plist $@/Contents cp $(RESOURCES) $@/Contents/Resources mkdir -p $@/Contents/Frameworks - cp -R /System/Library/Frameworks/SDL.framework $@/Contents/Frameworks - cp -R /System/Library/Frameworks/SDL_image.framework $@/Contents/Frameworks - cp -R /System/Library/Frameworks/SDL_mixer.framework $@/Contents/Frameworks - cp -R /System/Library/Frameworks/TinyXML.framework $@/Contents/Frameworks + cp -R /Library/Frameworks/SDL.framework $@/Contents/Frameworks + cp -R /Library/Frameworks/SDL_image.framework $@/Contents/Frameworks + cp -R /Library/Frameworks/SDL_mixer.framework $@/Contents/Frameworks + cp /usr/local/Cellar/tinyxml/2.6.2/lib/libtinyxml.dylib $@/Contents/Resources find $@/Contents/Frameworks -name Headers | xargs rm -r # ln -sf ../../../../resources/world.xml $@/Contents/Resources/world.xml diff --git a/src/main.cpp b/src/main.cpp index ef4966a..54b232c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include "room.h" #include "shader.h" @@ -25,7 +25,7 @@ static const int defaultY = 50; static const float kd = .060f; // frame-rate dependent static bool run = true; -static bool fullScreen = false; +static bool fullScreen = true; static World* world = NULL; static bool wireframe = false; @@ -194,6 +194,10 @@ static void eventLoop() { int main(int argc, char** argv) { SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO); + + SDL_PumpEvents(); + + SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); diff --git a/src/sound.cpp b/src/sound.cpp index 1ebf1fe..366173e 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- #include -#include +#include #include #include #include diff --git a/src/texture.cpp b/src/texture.cpp index 4331f32..b51d073 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/worlds.cpp b/src/worlds.cpp index e10443e..93f62de 100644 --- a/src/worlds.cpp +++ b/src/worlds.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include