source: opengl-game/docs/README.txt@ 85b5fec

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

Add a makefile recipe for SDLGame

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