Skip to content
Snippets Groups Projects
Select Git revision
  • develop default
  • master protected
2 results

typed-graphics

  • Clone with SSH
  • Clone with HTTPS
  • Name Last commit Last update
    src/tg
    .clang-format
    CMakeLists.txt
    README.md

    typed-graphics

    Graphics library with strongly typed interfaces.

    Usage / Example

    #include <tg/typed-graphics.hh>
    
    // TODO

    Dependencies

    typed-graphics expects dependencies as CMake targets.

    Required

    • ???

    Backend Dependencies

    • lava Vulkan library
    • glow OpenGL library

    Optional

    • typed-math math library
    • glm math library
    • polymesh mesh library
    • imgui UI library
    • aion profiling library

    CMake Usage

    cmake_minimum_required(VERSION 3.8)
    project(MyProject)
    
    
    # ===============================================
    # Global settings
    
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    set_property(GLOBAL PROPERTY USE_FOLDERS ON)
    set(BUILD_SHARED_LIBS ON) # required by some dependencies
    
    
    # ===============================================
    # Dependencies
    
    # math library
    add_subdirectory(extern/typed-math)
    
    # graphics library
    add_subdirectory(extern/typed-graphics)
    
    # mesh library
    add_subdirectory(extern/polymesh)
    
    
    # ===============================================
    # Create target
    
    file(GLOB_RECURSE SOURCES
        "src/*.cc"
        "src/*.hh"
    )
    
    source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES})
    
    add_executable(MyProject ${SOURCES})
    
    target_include_directories(MyProject PUBLIC "src")
    
    target_link_libraries(MyProject PUBLIC
        typed-math
        typed-graphics
        polymesh
    )
    
    
    # ===============================================
    # Compile flags
    
    if (MSVC)
        target_compile_options(MyProject PUBLIC 
            /MP
        )
    else()
        target_compile_options(MyProject PUBLIC 
            -Wall
            -Wno-unused-variable
        )
    endif()