Changeset c8c6da8 in opengl-game
- Timestamp:
- Aug 21, 2019, 8:19:09 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- e5d4aca
- Parents:
- ad31ec7
- Files:
-
- 2 added
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
README.txt
rad31ec7 rc8c6da8 87 87 Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it) 88 88 89 brew install sdl2 90 brew install sdl2_image 91 brew install sdl2_ttf 89 brew install sdl2 sdl2_image sdl2_ttf 92 90 93 91 make vulkangame && ./vulkangame -
compile.sh
rad31ec7 rc8c6da8 12 12 echo $VULKAN_SDK_PATH 13 13 14 $VULKAN_SDK_PATH/bin/glslangValidator -V shader.vert 15 $VULKAN_SDK_PATH/bin/glslangValidator -V shader.frag 14 shopt -s nullglob 15 shopt -s extglob 16 17 FILES=./!(*.spv) 18 19 for f in $FILES 20 do 21 shaderName=$(echo $f | sed 's/\.\/\(.*\)\..*/\1/') 22 shaderType=$(echo $f | sed 's/\.\/.*\.\(.*\)/\1/') 23 fOut="$shaderName-$shaderType.spv" 24 25 $VULKAN_SDK_PATH/bin/glslangValidator -V $f -o $fOut 26 done -
makefile
rad31ec7 rc8c6da8 56 56 57 57 .PHONY: shaders 58 shaders: shaders/shader.vert shaders/shader.frag58 shaders: 59 59 cd shaders && ../compile.sh && cd .. 60 60 -
vulkan-game.cpp
rad31ec7 rc8c6da8 164 164 private: 165 165 GameGui* gui = new GameGui_SDL(); 166 SDL_version sdlVersion; 166 167 SDL_Window* window = nullptr; 167 168 … … 260 261 } 261 262 262 uiOverlay = SDL_CreateTexture(gRenderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, SCREEN_WIDTH, SCREEN_HEIGHT); 263 SDL_VERSION(&sdlVersion); 264 265 // In SDL 2.0.10 (currently, the latest), SDL_TEXTUREACCESS_TARGET is required to get a transparent overlay working 266 // However, the latest SDL version available through homebrew on Mac is 2.0.9, which requires SDL_TEXTUREACCESS_STREAMING 267 // I tried building sdl 2.0.10 (and sdl_image and sdl_ttf) from source on Mac, but had some issues, so this is easier 268 // until the homebrew recipe is updated 269 if (sdlVersion.major == 2 && sdlVersion.minor == 0 && sdlVersion.patch == 9) { 270 uiOverlay = SDL_CreateTexture(gRenderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, SCREEN_WIDTH, SCREEN_HEIGHT); 271 } else { 272 uiOverlay = SDL_CreateTexture(gRenderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, SCREEN_WIDTH, SCREEN_HEIGHT); 273 } 274 263 275 if (uiOverlay == nullptr) { 264 276 cout << "Unable to create blank texture! SDL Error: " << SDL_GetError() << endl; … … 1833 1845 createRenderPass(); 1834 1846 1835 createGraphicsPipeline("shaders/ vert.spv", "shaders/frag.spv", scenePipeline);1836 createGraphicsPipeline("shaders/ vert.spv", "shaders/frag.spv", overlayPipeline);1847 createGraphicsPipeline("shaders/scene-vert.spv", "shaders/scene-frag.spv", scenePipeline); 1848 createGraphicsPipeline("shaders/overlay-vert.spv", "shaders/overlay-frag.spv", overlayPipeline); 1837 1849 1838 1850 createDepthResources();
Note:
See TracChangeset
for help on using the changeset viewer.