Changeset 4eb4d0a in opengl-game


Ignore:
Timestamp:
Aug 30, 2019, 4:01:54 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
99d44b2
Parents:
0df3c9a
Message:

Rename vulkan-game.cpp to vulkan-ref.cpp and define the GAMEGUI_INCLUDE_VULKAN preprocessor directive to control whether the gui-game classes build with Vulkan support

Files:
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • .gitignore

    r0df3c9a r4eb4d0a  
    11spacegame
    2 vulkangame
    32newgame
     3vulkanref
    44
    55gl.log
  • game-gui-glfw.cpp

    r0df3c9a r4eb4d0a  
    2222}
    2323
     24#ifdef GAMEGUI_INCLUDE_VULKAN
     25
    2426bool GameGui_GLFW::CreateVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) {
    2527   return glfwCreateWindowSurface(instance, window, nullptr, surface) == VK_SUCCESS ?
    2628      RTWO_SUCCESS : RTWO_ERROR;
    2729}
     30
     31#endif
    2832
    2933vector<const char*> GameGui_GLFW::GetRequiredExtensions() {
  • game-gui-glfw.hpp

    r0df3c9a r4eb4d0a  
    44#include "game-gui.hpp"
    55
    6 #define GLFW_INCLUDE_VULKAN
     6#ifdef GAMEGUI_INCLUDE_VULKAN
     7   #define GLFW_INCLUDE_VULKAN
     8#endif
     9
    710#include <GLFW/glfw3.h>
    811
     
    1518      void DestroyWindow();
    1619
     20#ifdef GAMEGUI_INCLUDE_VULKAN
    1721      bool CreateVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
     22#endif
     23
    1824      vector<const char*> GetRequiredExtensions();
    1925      void GetWindowSize(int* width, int* height);
  • game-gui-sdl.cpp

    r0df3c9a r4eb4d0a  
    4747}
    4848
     49#ifdef GAMEGUI_INCLUDE_VULKAN
     50
    4951bool GameGui_SDL::CreateVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) {
    5052   return SDL_Vulkan_CreateSurface(window, instance, surface) ?
    5153      RTWO_SUCCESS : RTWO_ERROR;
    5254}
     55
     56#endif
    5357
    5458vector<const char*> GameGui_SDL::GetRequiredExtensions() {
  • game-gui-sdl.hpp

    r0df3c9a r4eb4d0a  
    1717      void DestroyWindow();
    1818
     19#ifdef GAMEGUI_INCLUDE_VULKAN
    1920      bool CreateVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
     21#endif
     22
    2023      vector<const char*> GetRequiredExtensions();
    2124      void GetWindowSize(int* width, int* height);
  • game-gui.hpp

    r0df3c9a r4eb4d0a  
    22#define _GAME_GUI_H
    33
    4 #include <vulkan/vulkan.h>
     4#ifdef GAMEGUI_INCLUDE_VULKAN
     5   #include <vulkan/vulkan.h>
     6#endif
    57
    68#include <string>
     
    2224      virtual void DestroyWindow() = 0;
    2325
     26#ifdef GAMEGUI_INCLUDE_VULKAN
    2427      virtual bool CreateVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) = 0;
     28#endif
     29
    2530      virtual vector<const char*> GetRequiredExtensions() = 0;
    2631      virtual void GetWindowSize(int* width, int* height) = 0;
  • makefile

    r0df3c9a r4eb4d0a  
    5353LIB_FLAGS = $(LIB_PATHS) $(LIBS)
    5454
    55 vulkangame: vulkan-game.cpp game-gui-sdl.cpp
    56         $(CC) $(CXX_FLAGS) -o $@ $^ $(LIB_FLAGS)
     55vulkanref: vulkan-ref.cpp game-gui-sdl.cpp
     56        $(CC) $(CXX_FLAGS) -o $@ $^ $(LIB_FLAGS) -DGAMEGUI_INCLUDE_VULKAN
    5757
    5858spacegame: main.cpp space-game.cpp game-gui-sdl.cpp
     
    6565clean:
    6666        rm -f newgame
    67         rm -f vulkangame
     67        rm -f vulkanref
    6868        rm -f spacegame
    6969        rm -f shaders/*.spv
Note: See TracChangeset for help on using the changeset viewer.