Changeset 99d44b2 in opengl-game
- Timestamp:
- Aug 30, 2019, 4:12:23 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- d02c25f
- Parents:
- 4eb4d0a
- Files:
-
- 2 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r4eb4d0a r99d44b2 1 spacegame2 1 newgame 3 2 vulkanref 3 vulkangame 4 4 5 5 gl.log -
main-vulkan.cpp
r4eb4d0a r99d44b2 1 #include " space-game.hpp"1 #include "vulkan-game.hpp" 2 2 3 3 #include <iostream> … … 13 13 #endif 14 14 15 cout << "Starting SpaceGame..." << endl;15 cout << "Starting Vulkan Game..." << endl; 16 16 17 SpaceGame game;17 VulkanGame game; 18 18 19 19 try { -
makefile
r4eb4d0a r99d44b2 56 56 $(CC) $(CXX_FLAGS) -o $@ $^ $(LIB_FLAGS) -DGAMEGUI_INCLUDE_VULKAN 57 57 58 spacegame: main.cpp space-game.cpp game-gui-sdl.cpp58 vulkangame: main-vulkan.cpp vulkan-game.cpp game-gui-sdl.cpp 59 59 $(CC) $(CXX_FLAGS) -o $@ $^ $(LIB_FLAGS) 60 60 … … 66 66 rm -f newgame 67 67 rm -f vulkanref 68 rm -f spacegame68 rm -f vulkangame 69 69 rm -f shaders/*.spv -
vulkan-game.cpp
r4eb4d0a r99d44b2 1 #include " space-game.hpp"1 #include "vulkan-game.hpp" 2 2 3 3 #include <iostream> 4 4 5 #define GAMEGUI_INCLUDE_VULKAN 5 6 #include "game-gui-sdl.hpp" 6 7 7 8 using namespace std; 8 9 9 SpaceGame::SpaceGame() {10 VulkanGame::VulkanGame() { 10 11 gui = nullptr; 11 12 window = nullptr; 12 13 } 13 14 14 SpaceGame::~SpaceGame() {15 VulkanGame::~VulkanGame() { 15 16 } 16 17 17 void SpaceGame::run() {18 void VulkanGame::run() { 18 19 if (initWindow() == RTWO_ERROR) { 19 20 return; … … 24 25 } 25 26 26 bool SpaceGame::initWindow() {27 bool VulkanGame::initWindow() { 27 28 gui = new GameGui_SDL(); 28 29 … … 43 44 } 44 45 45 void SpaceGame::initVulkan() {46 void VulkanGame::initVulkan() { 46 47 } 47 48 48 void SpaceGame::mainLoop() {49 void VulkanGame::mainLoop() { 49 50 SDL_Event e; 50 51 bool quit = false; … … 65 66 } 66 67 67 void SpaceGame::cleanup() {68 void VulkanGame::cleanup() { 68 69 gui->DestroyWindow(); 69 70 gui->Shutdown(); -
vulkan-game.hpp
r4eb4d0a r99d44b2 1 #ifndef _ SPACE_GAME_H2 #define _ SPACE_GAME_H1 #ifndef _VULKAN_GAME_H 2 #define _VULKAN_GAME_H 3 3 4 4 #include "game-gui-sdl.hpp" … … 7 7 const int SCREEN_HEIGHT = 600; 8 8 9 class SpaceGame {9 class VulkanGame { 10 10 public: 11 SpaceGame();12 ~ SpaceGame();11 VulkanGame(); 12 ~VulkanGame(); 13 13 14 14 void run(); … … 24 24 }; 25 25 26 #endif // _ SPACE_GAME_H26 #endif // _VULKAN_GAME_H
Note:
See TracChangeset
for help on using the changeset viewer.