-
Notifications
You must be signed in to change notification settings - Fork 0
/
instructions.txt
48 lines (38 loc) · 2.52 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
-------------------------------------------------PROJECT DEPENDENCIES AND FOLDER STRUCTURE-------------------------------------------------
This project has two major dependencies, SDL2 and stb_image.
As stb_image is a header only library, no need to do anything except get the include paths right. you can get the stb headers from https://github.com/nothings/stb.
In order to compile, you can either directly run the build.ps1/build.bat scripts or you can follow the given instructions to compile the project yourself.
The directories are structured in the following way:
parent directory (i.e. the root directory)
│
├── code
│ ├── headers
│ │ └── *.h
│ ├── extern
│ │ └── stb_image.h
│ └── *.cpp
├── data (assets)
├── libs (SDL files, either download it yourself or use build.bat to download it)
└── build (will be generated)
**NOTE: Make sure that the SDL2 includes are inside a folder called SDL2**
And the way the internal and external header files are included in the code,
we'll have to set three separate include paths one to (relative to the parent directory)
./code/extern/
./code/headers/
Where the .lib files (for msvc and clang) or .a (files for mingw) is up to your discretion and you can get the lib files for SDL2 from https://www.libsdl.org/
so you'll have to link against SDL2.lib and SDL2main.lib
and the windows only .lib files is Shell32.lib
meaning the total headers you'll have to link against is
- SDL2.lib
- SDL2main.lib
- Shell32.lib
Now onto the compilation,
**NOTE: YOU'LL NEED TO KNOW HOW TO SETUP MSVC WITH POWERSHELL OR HAVE CLANG INSTALLED**
You can directly run build.ps1 (through a x64 msvc setup powershell instance it is expected you know how to do so) or run .\build.bat.
Or you can compile it yourself by downloading the required .lib/.a files through the website.
-------------------------------------------------COMPILATION CODE-------------------------------------------------
if you're using msvc:
cl "code\*.cpp" -O2 -Fe"Undestined.exe" -I "libs\SDL2\SDL2-2.0.14" -I "code\headers\" -I "code\extern\" -nologo -EHsc -FC -link -LIBPATH:"libs\SDL2\SDL2-2.0.14\lib\x64" SDL2.lib SDL2main.lib shell32.lib -subsystem:windows
and if you're using clang:
clang -I"libs/SDL2/SDL2-2.0.14/" -I"code/extern/" -I"code/headers/" -L"libs/SDL2/SDL2-2.0.14/lib/x64/" -O2 code/*.cpp -o Undestined.exe -lSDL2main -lSDL2 -lShell32 -Xlinker -subsystem:windows
BE SURE TO PUT SDL2.dll from SDL2\SDL2-2.0.14\lib\x64 with the executable