diff --git a/build.sh b/build.sh index 8e82686..f01729d 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/sh mkdir -p build -pushd build +pushd build > /dev/null rm -rf sdl_platform.dSYM # Plugin library @@ -9,5 +9,7 @@ c++ -shared -o librt_weekend.so librt_weekend.o rm librt_weekend.o # Platform layer host application -c++ -Wall -std=c++11 -g ../code/sdl_platform.cpp -o sdl_platform `sdl2-config --libs --cflags` -popd +c++ -Wall -std=c++11 -g ../code/platforms/sdl_platform.cpp -o sdl_platform \ +`sdl2-config --libs --cflags` + +popd > /dev/null diff --git a/code/sdl_platform.cpp b/code/platforms/sdl_platform.cpp similarity index 98% rename from code/sdl_platform.cpp rename to code/platforms/sdl_platform.cpp index 65ee7ec..10893dd 100644 --- a/code/sdl_platform.cpp +++ b/code/platforms/sdl_platform.cpp @@ -1,6 +1,6 @@ -#include "rt_weekend.h" +#include "../rt_weekend.h" -#include +#include #include #include #include @@ -14,8 +14,8 @@ const char *WindowTitle = "Ray Tracing in a Weekend"; const uint32_t TARGET_FRAME_RATE = 10; const uint32_t TICKS_PER_FRAME = 1000 / TARGET_FRAME_RATE; -const uint32_t WINDOW_WIDTH = 1000; -const uint32_t WINDOW_HEIGHT = 500; +const uint32_t WINDOW_WIDTH = 500; +const uint32_t WINDOW_HEIGHT = 250; global_variable bool Running = true; global_variable sdl_offscreen_buffer GlobalBackbuffer; diff --git a/code/sdl_platform.h b/code/platforms/sdl_platform.h similarity index 100% rename from code/sdl_platform.h rename to code/platforms/sdl_platform.h diff --git a/code/win32_platform.cpp b/code/platforms/win32_platform.cpp similarity index 99% rename from code/win32_platform.cpp rename to code/platforms/win32_platform.cpp index 852098f..8b2b4c9 100644 --- a/code/win32_platform.cpp +++ b/code/platforms/win32_platform.cpp @@ -1,6 +1,6 @@ #define _CRT_SECURE_NO_WARNINGS 1 #define SDL_MAIN_HANDLED -#include "rt_weekend.h" +#include "../rt_weekend.h" #include #include diff --git a/code/win32_platform.h b/code/platforms/win32_platform.h similarity index 100% rename from code/win32_platform.h rename to code/platforms/win32_platform.h diff --git a/code/win32_platform.sln b/win32_platform.sln similarity index 100% rename from code/win32_platform.sln rename to win32_platform.sln