Changeset c8c6da8 in opengl-game for vulkan-game.cpp
- Timestamp:
- Aug 21, 2019, 8:19:09 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- e5d4aca
- Parents:
- ad31ec7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.