Moved platform specific code to its own directory.

This commit is contained in:
Michael Smith 2019-07-15 00:43:17 +02:00
parent 60c77b2777
commit 21d6524c0c
6 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
mkdir -p build mkdir -p build
pushd build pushd build > /dev/null
rm -rf sdl_platform.dSYM rm -rf sdl_platform.dSYM
# Plugin library # Plugin library
@ -9,5 +9,7 @@ c++ -shared -o librt_weekend.so librt_weekend.o
rm librt_weekend.o rm librt_weekend.o
# Platform layer host application # Platform layer host application
c++ -Wall -std=c++11 -g ../code/sdl_platform.cpp -o sdl_platform `sdl2-config --libs --cflags` c++ -Wall -std=c++11 -g ../code/platforms/sdl_platform.cpp -o sdl_platform \
popd `sdl2-config --libs --cflags`
popd > /dev/null

View File

@ -1,6 +1,6 @@
#include "rt_weekend.h" #include "../rt_weekend.h"
#include <SDL.h> #include <SDL2/SDL.h>
#include <stdio.h> #include <stdio.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <stdbool.h> #include <stdbool.h>
@ -14,8 +14,8 @@ const char *WindowTitle = "Ray Tracing in a Weekend";
const uint32_t TARGET_FRAME_RATE = 10; const uint32_t TARGET_FRAME_RATE = 10;
const uint32_t TICKS_PER_FRAME = 1000 / TARGET_FRAME_RATE; const uint32_t TICKS_PER_FRAME = 1000 / TARGET_FRAME_RATE;
const uint32_t WINDOW_WIDTH = 1000; const uint32_t WINDOW_WIDTH = 500;
const uint32_t WINDOW_HEIGHT = 500; const uint32_t WINDOW_HEIGHT = 250;
global_variable bool Running = true; global_variable bool Running = true;
global_variable sdl_offscreen_buffer GlobalBackbuffer; global_variable sdl_offscreen_buffer GlobalBackbuffer;

View File

@ -1,6 +1,6 @@
#define _CRT_SECURE_NO_WARNINGS 1 #define _CRT_SECURE_NO_WARNINGS 1
#define SDL_MAIN_HANDLED #define SDL_MAIN_HANDLED
#include "rt_weekend.h" #include "../rt_weekend.h"
#include <windows.h> #include <windows.h>
#include <SDL.h> #include <SDL.h>