[cfda3b2] | 1 | Installation Instructions for Linux
|
---|
| 2 | ---------------------------------------
|
---|
| 3 |
|
---|
[78c3045] | 4 | sudo apt-get install xorg-dev libglew-dev libglm-dev libglfw3-dev
|
---|
[cfda3b2] | 5 |
|
---|
[78c3045] | 6 | make openglref && ./openglref
|
---|
[669c4e6] | 7 |
|
---|
[885f0bb] | 8 | (Old Linux instructions for compiling game.cpp)
|
---|
[fe70cd3] | 9 | -sudo apt-get install cmake xorg-dev libglew-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
|
---|
[03f4c64] | 10 |
|
---|
| 11 | -Compile GLFW3 from source
|
---|
| 12 | (cmake . && make && sudo make install)
|
---|
[cfda3b2] | 13 |
|
---|
[5a643d3] | 14 | Installation Instructions for OSX
|
---|
| 15 | ---------------------------------------
|
---|
| 16 |
|
---|
[fc424f6] | 17 | brew install glew
|
---|
[e6bc0f4] | 18 | brew install glfw --without-shared-library
|
---|
[fc424f6] | 19 | brew install glm
|
---|
| 20 |
|
---|
| 21 | This should place all necessary files (or possibly symlinks to them) in
|
---|
| 22 | /usr/loca/include and /usr/local/lib.
|
---|
[4d52702] | 23 |
|
---|
[5a643d3] | 24 | Run 'xcode-select --install'
|
---|
| 25 | This should make g++ check for libraries in /usr/local/
|
---|
| 26 |
|
---|
[58088c0] | 27 | If 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 |
|
---|
[885f0bb] | 30 | make newgame && ./newgame
|
---|
| 31 |
|
---|
[cfda3b2] | 32 | Installation Instructions for Windows
|
---|
| 33 | ---------------------------------------
|
---|
[4d52702] | 34 |
|
---|
[d53ef6a] | 35 | Create lib/ and include/ folders in the root opengl-game directory you cloned.
|
---|
| 36 |
|
---|
[681dbe8] | 37 | Download the pre-compiled 64bit binaries of GLFW and GLEW.
|
---|
[dba67b2] | 38 | Copy the include/GL/ and include/GLFW/ folders into your include/ folder.
|
---|
[21de283] | 39 |
|
---|
[d53ef6a] | 40 | For GLEW, copy lib/RELEASE/Win64/glew32s.lib into your lib folder.
|
---|
| 41 | For GLFW, copy lib-vc2019/glfw3.lib into your lib folder.
|
---|
[dba67b2] | 42 |
|
---|
| 43 | Download GLM and copy the glm folder (the one with all the .hpp files) into the include/ folder you made above.
|
---|
| 44 | GLM is a header-only library, so there is nothing to copy into the lib/ folder.
|
---|
| 45 |
|
---|
[58088c0] | 46 | Open and run NewOpenGLGame.sln in Visual Studio 2017 and run it.
|
---|
[03f4c64] | 47 |
|
---|
| 48 |
|
---|
| 49 | --------------------
|
---|
[ab65f84] | 50 | VULKAN INSTRUCTIOS
|
---|
| 51 | --------------------
|
---|
| 52 |
|
---|
| 53 | Windows
|
---|
| 54 | --------
|
---|
| 55 |
|
---|
[1c6cd5e] | 56 | Create an include directory inside the opengl-game folder
|
---|
| 57 |
|
---|
[cbe946d] | 58 | Download GLM and copy the glm folder into your include directory
|
---|
| 59 |
|
---|
| 60 | Download 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
|
---|
[5f3dba8] | 63 |
|
---|
[1c6cd5e] | 64 | Download the SDL2 pre-built Windows binaries
|
---|
| 65 | - Copy the SDL2 include folder into /include and rename it SDL2
|
---|
[5f3dba8] | 66 | - Copy the contents of lib/x64 to lib
|
---|
| 67 |
|
---|
[cbe946d] | 68 | Download the SDL2_image Visual C++ development libraries from https://www.libsdl.org/projects/SDL_image/
|
---|
| 69 | Download the SDL2_ttf Visual C++ development libraries from https://www.libsdl.org/projects/SDL_ttf/
|
---|
| 70 | (Might use SDL2_gfx later as well)
|
---|
[5f3dba8] | 71 |
|
---|
[cbe946d] | 72 | Copy the 64-bit static libraries to the lib directory you created above
|
---|
[5f3dba8] | 73 |
|
---|
| 74 | TODO: Figure out how to do static compilation with SDL2
|
---|
[1c6cd5e] | 75 |
|
---|
[cbe946d] | 76 | Since I'm currently using dynamic SDL2 libraries for Windows, some DLLs from sdl2-ttf and sdl2-image
|
---|
| 77 |
|
---|
[1c6cd5e] | 78 | Download 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
|
---|
[03f4c64] | 81 |
|
---|
| 82 | Linux:
|
---|
[ab65f84] | 83 | --------
|
---|
[03f4c64] | 84 |
|
---|
[ab65f84] | 85 | Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it)
|
---|
[03f4c64] | 86 |
|
---|
[17714b8] | 87 | sudo apt-get install libxcb1-dev xorg-dev libglm-dev libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev
|
---|
[1c6cd5e] | 88 |
|
---|
[b6127d2] | 89 | source setup-env.sh into your current shell
|
---|
| 90 |
|
---|
[db1b548] | 91 | Actually, I think now this should work, after following the online instructions for installing Vulkan:
|
---|
[7865c5b] | 92 | sudo apt-get install vulkan-sdk libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libglm-dev
|
---|
| 93 | (Follow the instructions at https://vulkan.lunarg.com/sdk/home#linux to add the latest Vulkan SDK version to apt-get)
|
---|
| 94 | (Verify that installing libvulkan-1 is not required)
|
---|
[db1b548] | 95 |
|
---|
[1c6cd5e] | 96 | make vulkangame && ./vulkangame
|
---|
[f898c5f] | 97 |
|
---|
[db1b548] | 98 | For the sfml version: (these directions need verification)
|
---|
| 99 |
|
---|
| 100 | sudo apt-get install libglm-dev libsfml-dev
|
---|
| 101 |
|
---|
| 102 | Currently, the apt-get package doesn't have Vulkan support, so need to install from source as follows:
|
---|
| 103 |
|
---|
| 104 | Build the library yourself by following the instructions at https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php
|
---|
| 105 |
|
---|
| 106 | sudo apt-get install libfreetype-dev libx11-dev libxrandr-dev libudev-dev libopengl-dev libflac-dev libogg-dev libvorbis-dev libopenal-dev libpthread-stubs0-dev
|
---|
| 107 |
|
---|
| 108 | sudo apt-get install cmake-qt-gui
|
---|
| 109 |
|
---|
| 110 | Clone the sfml repo
|
---|
| 111 |
|
---|
[f898c5f] | 112 | OSX
|
---|
[ab65f84] | 113 | --------
|
---|
| 114 |
|
---|
| 115 | Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it)
|
---|
[f898c5f] | 116 |
|
---|
[b8d4456] | 117 | brew install sdl2 sdl2_image sdl2_ttf sdl2_gfx
|
---|
[1c6cd5e] | 118 |
|
---|
| 119 | make vulkangame && ./vulkangame
|
---|
[fba08f2] | 120 |
|
---|
| 121 | REFERENCE
|
---|
| 122 | ----------
|
---|
| 123 |
|
---|
| 124 | 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)
|
---|
| 125 | 0 -------> ^
|
---|
| 126 | | |
|
---|
| 127 | v | -1 | 0 1
|
---|
| 128 | | <-----|----->
|
---|
| 129 | 1 V /|
|
---|
| 130 | / |
|
---|
| 131 | 1 v
|
---|
[5f3dba8] | 132 | 1
|
---|
[e1a7f5a] | 133 |
|
---|
| 134 | DEPLOYMENT
|
---|
| 135 | -----------
|
---|
| 136 |
|
---|
| 137 | The deploy folder has an old Inno Setup script for deploying the game on Windows.
|
---|
| 138 |
|
---|
| 139 | I should check out IzPack. Seems to be a cross-platform solution.
|
---|