/Reactive

Personal Vulkan Wrapper

Primary LanguageC++MIT LicenseMIT

Reactive

Personal Vulkan wrapper using

  • Vulkan
  • GLFW
  • glm
  • ImGui
  • glslang
  • SPIRV-Cross
  • tinyobjloader
  • spdlog

Sample

image

Features

  • Vulkan wrapper
  • Window creation
  • ImGui integration
  • GLSL Shader compile
  • Shader reflection

Requirement

  • Vulkan SDK
  • CMake
  • vcpkg

Run cmake

mkdir build
cd build

# change to your vcpkg path
cmake .. -D CMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake

Usage (in your project)

  1. Create project
mkdir project_name
cd project_name
git init
git submodule add https://github.com/yknishidate/Reactive.git
  1. Add main.cpp
project_name/
 - Reactive/
 - main.cpp
class HelloApp : public App {
public:
    HelloApp()
        : App({
              .width = 1280,
              .height = 720,
              .title = "HelloGraphics",
          }) {}
};

int main() {
    try {
        HelloApp app{};
        app.run();
    } catch (const std::exception& e) {
        spdlog::error(e.what());
    }
}
  1. Add CMakeLists.txt
project_name/
  - Reactive/
  - main.cpp
  - CMakeLists.txt
cmake_minimum_required(VERSION 3.16)

project(project_name LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)

set(REACTIVE_BUILD_SAMPLES OFF CACHE BOOL "" FORCE) # Remove samples
add_subdirectory(Reactive) # Add Reactive

add_executable(${PROJECT_NAME} main.cpp)

target_link_libraries(${PROJECT_NAME} PUBLIC 
    Reactive
)

target_include_directories(${PROJECT_NAME} PUBLIC
    ${PROJECT_SOURCE_DIR}
    Reactive/source
)
  1. Run cmake
# change to your vcpkg path
cmake . -B build -D CMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake