source: opengl-game/docs/README.txt@ cb6fabb

feature/imgui-sdl
Last change on this file since cb6fabb was cb6fabb, checked in by Dmitry Portnoy <dportnoy@…>, 4 years ago

Update the build instructions and makefile to work with OSX again

  • Property mode set to 100644
File size: 5.3 KB
Line 
1--------------------
2VULKAN INSTRUCTIOS
3--------------------
4
5These are the most up-to-date instructions. Use these rather than the ones
6listed further down, which are for the old OpenGL version of the game
7
8Windows
9--------
10
11Create an include directory inside the opengl-game folder
12
13Download GLM and copy the glm folder into your include directory
14
15Download the 64bit pre-compiledbinaries of GLFW3
16 - Copy lib-vc2019/glfw3.lib into your lib directory
17 - Copy the whole include/GLFW directory into your include directory
18
19Download the SDL2 pre-built Windows binaries
20 - Copy the SDL2 include folder into /include and rename it SDL2
21 - Copy the contents of lib/x64 to lib
22
23Download the SDL2_image Visual C++ development libraries from https://www.libsdl.org/projects/SDL_image/
24Download the SDL2_ttf Visual C++ development libraries from https://www.libsdl.org/projects/SDL_ttf/
25(Might use SDL2_gfx later as well)
26
27Copy the 64-bit static libraries to the lib directory you created above
28
29TODO: Figure out how to do static compilation with SDL2
30
31Since I'm currently using dynamic SDL2 libraries for Windows, some DLLs from sdl2-ttf and sdl2-image
32
33Download the vulkan sdk
34 - Add the location of the Include folder to the VS2019 project properties under C/C++ -> General -> Addition Include DIrectories
35 - Add the location of the Lib folder to the VS2019 project properties under Linker -> General -> Addition Library DIrectories
36
37Linux:
38--------
39
40Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it)
41
42sudo apt-get install libxcb1-dev xorg-dev libglm-dev libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev
43
44source setup-env.sh into your current shell
45
46mActually, I think now this should work, after following the online instructions for installing Vulkan:
47sudo apt-get install vulkan-sdk libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libglm-dev
48(Follow the instructions at https://vulkan.lunarg.com/sdk/home#linux to add the latest Vulkan SDK version to apt-get)
49(Verify that installing libvulkan-1 is not required)
50
51make vulkangame && ./vulkangame
52
53For the sfml version: (these directions need verification)
54
55sudo apt-get install libglm-dev libsfml-dev
56
57Currently, the apt-get sfml package doesn't have Vulkan support, so need to install from source as follows:
58
59Build the library yourself by following the instructions at https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php
60
61sudo apt-get install libfreetype-dev libx11-dev libxrandr-dev libudev-dev libopengl-dev libflac-dev libogg-dev libvorbis-dev libopenal-dev libpthread-stubs0-dev
62
63sudo apt-get install cmake-qt-gui
64
65Clone the sfml repo
66
67OSX
68--------
69
70brew install cmake pkg-config glm sdl2 sdl2_image sdl2_ttf sdl2_gfx
71(cmake is needed for the python script mentioned below)
72
73Download the Vulkan SDK from https://vulkan.lunarg.com/sdk/home
74
75Install it by running this from inside the downloaded folder:
76sudo ./install_vulkan.py
77
78make shaders
79make vulkangame
80./vulkangame
81
82
83INSTRUCTIONS FOR THE SFML VERSION ()
84
85OLD INSTALL INSTRUCTIONS FOR THE OpenGL version (might no longer work)
86-----------------------------------------------------------------------
87
88Installation Instructions for Linux
89---------------------------------------
90
91sudo apt-get install xorg-dev libglew-dev libglm-dev libglfw3-dev
92
93make openglref && ./openglref
94
95(Old Linux instructions for compiling game.cpp)
96-sudo apt-get install cmake xorg-dev libglew-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
97
98-Compile GLFW3 from source
99 (cmake . && make && sudo make install)
100
101Installation Instructions for OSX
102---------------------------------------
103
104brew install glew
105brew install glfw --without-shared-library
106brew install glm
107
108This should place all necessary files (or possibly symlinks to them) in
109/usr/loca/include and /usr/local/lib.
110
111Run 'xcode-select --install'
112This should make g++ check for libraries in /usr/local/
113
114If the above command gives you the following error, you should be able to move on and compile the game.
115"xcode-select: error: command line tools are already installed, use "Software Update" to install updates"
116
117make newgame && ./newgame
118
119Installation Instructions for Windows
120---------------------------------------
121
122Create lib/ and include/ folders in the root opengl-game directory you cloned.
123
124Download the pre-compiled 64bit binaries of GLFW and GLEW.
125Copy the include/GL/ and include/GLFW/ folders into your include/ folder.
126
127For GLEW, copy lib/RELEASE/Win64/glew32s.lib into your lib folder.
128For GLFW, copy lib-vc2019/glfw3.lib into your lib folder.
129
130Download GLM and copy the glm folder (the one with all the .hpp files) into the include/ folder you made above.
131GLM is a header-only library, so there is nothing to copy into the lib/ folder.
132
133Open and run NewOpenGLGame.sln in Visual Studio 2017 and run it.
134
135
136
137REFERENCE
138----------
139
140UV coords 0 u 1 x, y, z -1 (untransformed z ranges from 0 to 1, glm::perspective seems to make the z range negative)
141 0 -------> ^
142 | |
143 v | -1 | 0 1
144 | <-----|----->
145 1 V /|
146 / |
147 1 v
148 1
149
150DEPLOYMENT
151-----------
152
153The deploy folder has an old Inno Setup script for deploying the game on Windows.
154
155I should check out IzPack. Seems to be a cross-platform solution.
Note: See TracBrowser for help on using the repository browser.