[cbe946d] | 1 | NOTE: NewOpenGLGame uses a 32-bit build, whule VulkanGame uses a 64-bit build.
|
---|
| 2 | Because of this, it's necessary to switch the glfw3 lib files when switching projects.
|
---|
| 3 | TODO: Make NewOpenGLGame work with a 64-bit build
|
---|
| 4 |
|
---|
[cfda3b2] | 5 | Installation Instructions for Linux
|
---|
| 6 | ---------------------------------------
|
---|
| 7 |
|
---|
[fe70cd3] | 8 | sudo apt-get install xorg-dev libglew-dev libglm-dev
|
---|
[cfda3b2] | 9 |
|
---|
[885f0bb] | 10 | make newgame && ./newgame
|
---|
[669c4e6] | 11 |
|
---|
[885f0bb] | 12 | (Old Linux instructions for compiling game.cpp)
|
---|
[fe70cd3] | 13 | -sudo apt-get install cmake xorg-dev libglew-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
|
---|
[03f4c64] | 14 |
|
---|
| 15 | -Compile GLFW3 from source
|
---|
| 16 | (cmake . && make && sudo make install)
|
---|
[cfda3b2] | 17 |
|
---|
[5a643d3] | 18 | Installation Instructions for OSX
|
---|
| 19 | ---------------------------------------
|
---|
| 20 |
|
---|
[fc424f6] | 21 | brew install glew
|
---|
[e6bc0f4] | 22 | brew install glfw --without-shared-library
|
---|
[fc424f6] | 23 | brew install glm
|
---|
| 24 |
|
---|
| 25 | This should place all necessary files (or possibly symlinks to them) in
|
---|
| 26 | /usr/loca/include and /usr/local/lib.
|
---|
[4d52702] | 27 |
|
---|
[5a643d3] | 28 | Run 'xcode-select --install'
|
---|
| 29 | This should make g++ check for libraries in /usr/local/
|
---|
| 30 |
|
---|
[58088c0] | 31 | If the above command gives you the following error, you should be able to move on and compile the game.
|
---|
| 32 | "xcode-select: error: command line tools are already installed, use "Software Update" to install updates"
|
---|
| 33 |
|
---|
[885f0bb] | 34 | make newgame && ./newgame
|
---|
| 35 |
|
---|
[cfda3b2] | 36 | Installation Instructions for Windows
|
---|
| 37 | ---------------------------------------
|
---|
[4d52702] | 38 |
|
---|
[cbe946d] | 39 | Download the pre=compiled 32bit binaries of GLFW and GLEW. Create lib/ and
|
---|
[dba67b2] | 40 | include/ folders in the root opengl-game directory you cloned.
|
---|
| 41 | Copy the include/GL/ and include/GLFW/ folders into your include/ folder.
|
---|
[21de283] | 42 |
|
---|
[dba67b2] | 43 | For GLEW, copy lib/RELEASE/Win32/glew32s.lib into your lib folder.
|
---|
| 44 | For GLFW, copy lib-vc2015/glfw3.lib into your lib folder.
|
---|
| 45 |
|
---|
| 46 | Download GLM and copy the glm folder (the one with all the .hpp files) into the include/ folder you made above.
|
---|
| 47 | GLM is a header-only library, so there is nothing to copy into the lib/ folder.
|
---|
| 48 |
|
---|
[58088c0] | 49 | Open and run NewOpenGLGame.sln in Visual Studio 2017 and run it.
|
---|
[03f4c64] | 50 |
|
---|
| 51 |
|
---|
| 52 | --------------------
|
---|
[ab65f84] | 53 | VULKAN INSTRUCTIOS
|
---|
| 54 | --------------------
|
---|
| 55 |
|
---|
| 56 | Windows
|
---|
| 57 | --------
|
---|
| 58 |
|
---|
[1c6cd5e] | 59 | Create an include directory inside the opengl-game folder
|
---|
| 60 |
|
---|
[cbe946d] | 61 | Download GLM and copy the glm folder into your include directory
|
---|
| 62 |
|
---|
| 63 | Download the 64bit pre-compiledbinaries of GLFW3
|
---|
| 64 | - Copy lib-vc2019/glfw3.lib into your lib directory
|
---|
| 65 | - Copy the whole include/GLFW directory into your include directory
|
---|
[5f3dba8] | 66 |
|
---|
[1c6cd5e] | 67 | Download the SDL2 pre-built Windows binaries
|
---|
| 68 | - Copy the SDL2 include folder into /include and rename it SDL2
|
---|
[5f3dba8] | 69 | - Copy the contents of lib/x64 to lib
|
---|
| 70 |
|
---|
[cbe946d] | 71 | Download the SDL2_image Visual C++ development libraries from https://www.libsdl.org/projects/SDL_image/
|
---|
| 72 | Download the SDL2_ttf Visual C++ development libraries from https://www.libsdl.org/projects/SDL_ttf/
|
---|
| 73 | (Might use SDL2_gfx later as well)
|
---|
[5f3dba8] | 74 |
|
---|
[cbe946d] | 75 | Copy the 64-bit static libraries to the lib directory you created above
|
---|
[5f3dba8] | 76 |
|
---|
| 77 | TODO: Figure out how to do static compilation with SDL2
|
---|
[1c6cd5e] | 78 |
|
---|
[cbe946d] | 79 | Since I'm currently using dynamic SDL2 libraries for Windows, some DLLs from sdl2-ttf and sdl2-image
|
---|
| 80 |
|
---|
[1c6cd5e] | 81 | Download the vulkan sdk
|
---|
| 82 | - Add the location of the Include folder to the VS2019 project properties under C/C++ -> General -> Addition Include DIrectories
|
---|
| 83 | - Add the location of the Lib folder to the VS2019 project properties under Linker -> General -> Addition Library DIrectories
|
---|
[03f4c64] | 84 |
|
---|
| 85 | Linux:
|
---|
[ab65f84] | 86 | --------
|
---|
[03f4c64] | 87 |
|
---|
[ab65f84] | 88 | Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it)
|
---|
[03f4c64] | 89 |
|
---|
[1c6cd5e] | 90 | sudo apt-get install libxcb1-dev xorg-dev libsdl2-dev libglm-dev
|
---|
| 91 |
|
---|
[b6127d2] | 92 | source setup-env.sh into your current shell
|
---|
| 93 |
|
---|
[1c6cd5e] | 94 | make vulkangame && ./vulkangame
|
---|
[f898c5f] | 95 |
|
---|
| 96 | OSX
|
---|
[ab65f84] | 97 | --------
|
---|
| 98 |
|
---|
| 99 | Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it)
|
---|
[f898c5f] | 100 |
|
---|
[c8c6da8] | 101 | brew install sdl2 sdl2_image sdl2_ttf
|
---|
[1c6cd5e] | 102 |
|
---|
| 103 | make vulkangame && ./vulkangame
|
---|
[fba08f2] | 104 |
|
---|
| 105 | REFERENCE
|
---|
| 106 | ----------
|
---|
| 107 |
|
---|
| 108 | UV coords 0 u 1 x, y, z -1 (untransformed z ranges from 0 to 1, glm::perspective seems to make the z range negative)
|
---|
| 109 | 0 -------> ^
|
---|
| 110 | | |
|
---|
| 111 | v | -1 | 0 1
|
---|
| 112 | | <-----|----->
|
---|
| 113 | 1 V /|
|
---|
| 114 | / |
|
---|
| 115 | 1 v
|
---|
[5f3dba8] | 116 | 1
|
---|
[e1a7f5a] | 117 |
|
---|
| 118 | DEPLOYMENT
|
---|
| 119 | -----------
|
---|
| 120 |
|
---|
| 121 | The deploy folder has an old Inno Setup script for deploying the game on Windows.
|
---|
| 122 |
|
---|
| 123 | I should check out IzPack. Seems to be a cross-platform solution.
|
---|