Changeset 1f25a71 in opengl-game for vulkan-ref.cpp
- Timestamp:
- Nov 10, 2019, 5:40:12 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 0ae182f
- Parents:
- cc4a8b5
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (11/10/19 17:39:32)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (11/10/19 17:40:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-ref.cpp
rcc4a8b5 r1f25a71 152 152 SDL_Renderer* gRenderer = nullptr; 153 153 SDL_Texture* uiOverlay = nullptr; 154 /*** END OF REFACTORED CODE ***/155 154 156 155 TTF_Font* gFont = nullptr; … … 158 157 SDL_Texture* uiImage = nullptr; 159 158 160 /*** START OF REFACTORED CODE ***/161 159 VkInstance instance; 162 160 VkDebugUtilsMessengerEXT debugMessenger; … … 264 262 cout << "Unable to set texture blend mode! SDL Error: " << SDL_GetError() << endl; 265 263 } 266 /*** END OF REFACTORED CODE ***/ 267 268 gFont = TTF_OpenFont("fonts/lazy.ttf", 28); 264 265 gFont = TTF_OpenFont("assets/fonts/lazy.ttf", 28); 269 266 if (gFont == nullptr) { 270 267 cout << "Failed to load lazy font! SDL_ttf Error: " << TTF_GetError() << endl; … … 272 269 } 273 270 274 SDL_Color textColor = { 0, 0, 0 }; 275 276 SDL_Surface* textSurface = TTF_RenderText_Solid(gFont, "Great sucess!", textColor); 271 SDL_Surface* textSurface = TTF_RenderText_Solid(gFont, "Great success!", { 255, 255, 255 }); 277 272 if (textSurface == nullptr) { 278 273 cout << "Unable to render text surface! SDL_ttf Error: " << TTF_GetError() << endl; … … 308 303 } 309 304 310 /*** START OF REFACTORED CODE ***/311 305 void initVulkan() { 312 306 createInstance(); … … 1851 1845 SDL_SetRenderDrawColor(gRenderer, 0x00, 0x00, 0x00, 0x00); 1852 1846 SDL_RenderClear(gRenderer); 1853 /*** END OF REFACTORED CODE ***/1854 1847 1855 1848 SDL_Rect rect; … … 1858 1851 SDL_SetRenderDrawColor(gRenderer, 0x00, 0xFF, 0x00, 0xFF); 1859 1852 SDL_RenderFillRect(gRenderer, &rect); 1860 SDL_SetRenderDrawColor(gRenderer, 0x00, 0x9F, 0x9F, 0xFF);1861 1853 1862 1854 rect = {10, 10, 0, 0}; … … 1868 1860 SDL_RenderCopy(gRenderer, uiImage, nullptr, &rect); 1869 1861 1870 /*** START OF REFACTORED CODE ***/1871 1862 SDL_SetRenderDrawColor(gRenderer, 0x00, 0x00, 0xFF, 0xFF); 1872 1863 SDL_RenderDrawLine(gRenderer, 50, 5, 150, 500); … … 1970 1961 uiOverlay = nullptr; 1971 1962 } 1972 /*** END OF REFACTORED CODE ***/1973 1963 1974 1964 TTF_CloseFont(gFont); 1975 1965 gFont = nullptr; 1976 1966 1977 1967 if (uiText != nullptr) { … … 1985 1975 } 1986 1976 1987 /*** START OF REFACTORED CODE ***/1988 1977 SDL_DestroyRenderer(gRenderer); 1989 1978 gRenderer = nullptr;
Note:
See TracChangeset
for help on using the changeset viewer.