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