| 1 | --------------------
|
|---|
| 2 | CONTROLS
|
|---|
| 3 | --------------------
|
|---|
| 4 |
|
|---|
| 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)
|
|---|
| 7 |
|
|---|
| 8 | --------------------
|
|---|
| 9 | VULKAN INSTRUCTIOS
|
|---|
| 10 | --------------------
|
|---|
| 11 |
|
|---|
| 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 |
|
|---|
| 15 | Windows
|
|---|
| 16 | --------
|
|---|
| 17 |
|
|---|
| 18 | Create an include directory inside the opengl-game folder
|
|---|
| 19 |
|
|---|
| 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
|
|---|
| 25 |
|
|---|
| 26 | Download the SDL2 pre-built Windows binaries
|
|---|
| 27 | - Copy the SDL2 include folder into /include and rename it SDL2
|
|---|
| 28 | - Copy the contents of lib/x64 to lib
|
|---|
| 29 |
|
|---|
| 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)
|
|---|
| 33 |
|
|---|
| 34 | Copy the 64-bit static libraries to the lib directory you created above
|
|---|
| 35 |
|
|---|
| 36 | TODO: Figure out how to do static compilation with SDL2
|
|---|
| 37 |
|
|---|
| 38 | Since I'm currently using dynamic SDL2 libraries for Windows, some DLLs from sdl2-ttf and sdl2-image
|
|---|
| 39 |
|
|---|
| 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
|
|---|
| 43 |
|
|---|
| 44 | Linux:
|
|---|
| 45 | --------
|
|---|
| 46 |
|
|---|
| 47 | Add the Vulkan SDK repo to apt
|
|---|
| 48 |
|
|---|
| 49 | sudo apt install build-essential vulkan-sdk libglm-dev libsdl2-dev
|
|---|
| 50 |
|
|---|
| 51 | make vulkangame && ./vulkangame
|
|---|
| 52 |
|
|---|
| 53 | For the sfml version: (these directions need verification)
|
|---|
| 54 |
|
|---|
| 55 | sudo apt install libglm-dev libsfml-dev
|
|---|
| 56 |
|
|---|
| 57 | Currently, the apt sfml package doesn't have Vulkan support, so need to install from source as follows:
|
|---|
| 58 |
|
|---|
| 59 | Build the library yourself by following the instructions at https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php
|
|---|
| 60 |
|
|---|
| 61 | sudo apt install libfreetype-dev libx11-dev libxrandr-dev libudev-dev libopengl-dev libflac-dev libogg-dev libvorbis-dev libopenal-dev libpthread-stubs0-dev
|
|---|
| 62 |
|
|---|
| 63 | sudo apt install cmake-qt-gui
|
|---|
| 64 |
|
|---|
| 65 | Clone the sfml repo
|
|---|
| 66 |
|
|---|
| 67 | OSX
|
|---|
| 68 | --------
|
|---|
| 69 |
|
|---|
| 70 | brew install cmake pkg-config glm sdl2 sdl2_image sdl2_ttf sdl2_gfx
|
|---|
| 71 | (cmake is needed for the python script mentioned below)
|
|---|
| 72 |
|
|---|
| 73 | Download the Vulkan SDK from https://vulkan.lunarg.com/sdk/home
|
|---|
| 74 |
|
|---|
| 75 | Install it by running this from inside the downloaded folder:
|
|---|
| 76 | sudo ./install_vulkan.py
|
|---|
| 77 |
|
|---|
| 78 | make shaders
|
|---|
| 79 | make vulkangame
|
|---|
| 80 | ./vulkangame
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 | INSTRUCTIONS FOR THE SFML VERSION ()
|
|---|
| 84 |
|
|---|
| 85 | OLD INSTALL INSTRUCTIONS FOR THE OpenGL version (might no longer work)
|
|---|
| 86 | -----------------------------------------------------------------------
|
|---|
| 87 |
|
|---|
| 88 | Installation Instructions for Linux
|
|---|
| 89 | ---------------------------------------
|
|---|
| 90 |
|
|---|
| 91 | sudo apt install xorg-dev libglew-dev libglm-dev libglfw3-dev
|
|---|
| 92 |
|
|---|
| 93 | make openglref && ./openglref
|
|---|
| 94 |
|
|---|
| 95 | (Old Linux instructions for compiling game.cpp)
|
|---|
| 96 | -sudo apt 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 |
|
|---|
| 101 | Installation Instructions for OSX
|
|---|
| 102 | ---------------------------------------
|
|---|
| 103 |
|
|---|
| 104 | brew install glew
|
|---|
| 105 | brew install glfw --without-shared-library
|
|---|
| 106 | brew install glm
|
|---|
| 107 |
|
|---|
| 108 | This should place all necessary files (or possibly symlinks to them) in
|
|---|
| 109 | /usr/loca/include and /usr/local/lib.
|
|---|
| 110 |
|
|---|
| 111 | Run 'xcode-select --install'
|
|---|
| 112 | This should make g++ check for libraries in /usr/local/
|
|---|
| 113 |
|
|---|
| 114 | If 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 |
|
|---|
| 117 | make newgame && ./newgame
|
|---|
| 118 |
|
|---|
| 119 | Installation Instructions for Windows
|
|---|
| 120 | ---------------------------------------
|
|---|
| 121 |
|
|---|
| 122 | Create lib/ and include/ folders in the root opengl-game directory you cloned.
|
|---|
| 123 |
|
|---|
| 124 | Download the pre-compiled 64bit binaries of GLFW and GLEW.
|
|---|
| 125 | Copy the include/GL/ and include/GLFW/ folders into your include/ folder.
|
|---|
| 126 |
|
|---|
| 127 | For GLEW, copy lib/RELEASE/Win64/glew32s.lib into your lib folder.
|
|---|
| 128 | For GLFW, copy lib-vc2019/glfw3.lib into your lib folder.
|
|---|
| 129 |
|
|---|
| 130 | Download GLM and copy the glm folder (the one with all the .hpp files) into the include/ folder you made above.
|
|---|
| 131 | GLM is a header-only library, so there is nothing to copy into the lib/ folder.
|
|---|
| 132 |
|
|---|
| 133 | Open and run NewOpenGLGame.sln in Visual Studio 2017 and run it.
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 | REFERENCE
|
|---|
| 138 | ----------
|
|---|
| 139 |
|
|---|
| 140 | 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)
|
|---|
| 141 | 0 -------> ^
|
|---|
| 142 | | |
|
|---|
| 143 | v | -1 | 0 1
|
|---|
| 144 | | <-----|----->
|
|---|
| 145 | 1 V /|
|
|---|
| 146 | / |
|
|---|
| 147 | 1 v
|
|---|
| 148 | 1
|
|---|
| 149 |
|
|---|
| 150 | DEPLOYMENT
|
|---|
| 151 | -----------
|
|---|
| 152 |
|
|---|
| 153 | The deploy folder has an old Inno Setup script for deploying the game on Windows.
|
|---|
| 154 |
|
|---|
| 155 | I should check out IzPack. Seems to be a cross-platform solution.
|
|---|