| 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 |
|
|---|
| 5 | Installation Instructions for Linux
|
|---|
| 6 | ---------------------------------------
|
|---|
| 7 |
|
|---|
| 8 | sudo apt-get install xorg-dev libglew-dev libglm-dev
|
|---|
| 9 |
|
|---|
| 10 | make newgame && ./newgame
|
|---|
| 11 |
|
|---|
| 12 | (Old Linux instructions for compiling game.cpp)
|
|---|
| 13 | -sudo apt-get install cmake xorg-dev libglew-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
|
|---|
| 14 |
|
|---|
| 15 | -Compile GLFW3 from source
|
|---|
| 16 | (cmake . && make && sudo make install)
|
|---|
| 17 |
|
|---|
| 18 | Installation Instructions for OSX
|
|---|
| 19 | ---------------------------------------
|
|---|
| 20 |
|
|---|
| 21 | brew install glew
|
|---|
| 22 | brew install glfw --without-shared-library
|
|---|
| 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.
|
|---|
| 27 |
|
|---|
| 28 | Run 'xcode-select --install'
|
|---|
| 29 | This should make g++ check for libraries in /usr/local/
|
|---|
| 30 |
|
|---|
| 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 |
|
|---|
| 34 | make newgame && ./newgame
|
|---|
| 35 |
|
|---|
| 36 | Installation Instructions for Windows
|
|---|
| 37 | ---------------------------------------
|
|---|
| 38 |
|
|---|
| 39 | Download the pre=compiled 32bit binaries of GLFW and GLEW. Create lib/ and
|
|---|
| 40 | include/ folders in the root opengl-game directory you cloned.
|
|---|
| 41 | Copy the include/GL/ and include/GLFW/ folders into your include/ folder.
|
|---|
| 42 |
|
|---|
| 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 |
|
|---|
| 49 | Open and run NewOpenGLGame.sln in Visual Studio 2017 and run it.
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | --------------------
|
|---|
| 53 | VULKAN INSTRUCTIOS
|
|---|
| 54 | --------------------
|
|---|
| 55 |
|
|---|
| 56 | Windows
|
|---|
| 57 | --------
|
|---|
| 58 |
|
|---|
| 59 | Create an include directory inside the opengl-game folder
|
|---|
| 60 |
|
|---|
| 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
|
|---|
| 66 |
|
|---|
| 67 | Download the SDL2 pre-built Windows binaries
|
|---|
| 68 | - Copy the SDL2 include folder into /include and rename it SDL2
|
|---|
| 69 | - Copy the contents of lib/x64 to lib
|
|---|
| 70 |
|
|---|
| 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)
|
|---|
| 74 |
|
|---|
| 75 | Copy the 64-bit static libraries to the lib directory you created above
|
|---|
| 76 |
|
|---|
| 77 | TODO: Figure out how to do static compilation with SDL2
|
|---|
| 78 |
|
|---|
| 79 | Since I'm currently using dynamic SDL2 libraries for Windows, some DLLs from sdl2-ttf and sdl2-image
|
|---|
| 80 |
|
|---|
| 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
|
|---|
| 84 |
|
|---|
| 85 | Linux:
|
|---|
| 86 | --------
|
|---|
| 87 |
|
|---|
| 88 | Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it)
|
|---|
| 89 |
|
|---|
| 90 | sudo apt-get install libxcb1-dev xorg-dev libsdl2-dev libglm-dev
|
|---|
| 91 |
|
|---|
| 92 | source setup-env.sh into your current shell
|
|---|
| 93 |
|
|---|
| 94 | make vulkangame && ./vulkangame
|
|---|
| 95 |
|
|---|
| 96 | OSX
|
|---|
| 97 | --------
|
|---|
| 98 |
|
|---|
| 99 | Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it)
|
|---|
| 100 |
|
|---|
| 101 | brew install sdl2 sdl2_image sdl2_ttf
|
|---|
| 102 |
|
|---|
| 103 | make vulkangame && ./vulkangame
|
|---|
| 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
|
|---|
| 116 | 1
|
|---|
| 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.
|
|---|