Giter Site home page Giter Site logo

navyenzo / crosswindow-imgui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alaingalvan/crosswindow-imgui

0.0 1.0 0.0 59 KB

๐Ÿ–Œ๏ธ An optional library wrapping ImGui and providing bindings for CrossWindow events.

C++ 95.96% C 0.49% CMake 2.84% HLSL 0.70%

crosswindow-imgui's Introduction

CrossWindow-ImGui

cmake-img License

An optional library to simplify integrating ImGui with a renderer that uses CrossWindow by providing a forked ImGui backend with simplified defaults and bindings for CrossWindow events.

Note - Don't install ImGui if you're using this library, CrossWindow-Imgui wraps ImGui and includes a copy.

Supports

  • โŽ DirectX 12.x
  • โšช OpenGL

With more graphics APIs supported in future updates.

Installation

First add the repo as a submodule in your dependencies folder such as external/:

cd external
git submodule add https://github.com/alaingalvan/crosswindow-imgui.git

Then in your CMakeLists.txt file, include the following:

add_subdirectory(external/crosswindow-imgui)

target_link_libraries(
    CrossWindowImGui
    CrossWindowGraphics
    CrossWindow
)

add_dependencies(
    CrossWindowImGui
    CrossWindowGraphics
    CrossWindow
    
)

target_link_libraries(
    ${PROJECT_NAME}
    CrossWindowImGui
)

Usage

#include "CrossWindow/CrossWindow.h"
#include "CrossWindow/ImGui.h"
#include "CrossWindow/Graphics.h"

void xmain(int argc, char** argv)
{
  // ๐Ÿ–ผ๏ธ Create your xwin::Window...
  xwin::Window window;
  
  // ๐Ÿ–Œ๏ธ Create your renderer...

#if defined(XGFX_DIRECTX12)
  
  // โŽ DirectX 12.x
  xgfx::D3D12ImGuiManager manager;
  manager.init(device, numFramesInFlight, rtvFormat, cbvSrvHeap, fontCpuDescHandle, fontGpuDeschandle);

#elif defined(XGFX_OPENGL)

  // โšช OpenGL
  xgfx::OpenGLImGuiManager manager;
  manager.init();

#endif
}

Preprocessor Definitions

CMake Options Description
XGFX_API The graphics API you're targeting, defaults to VULKAN, can be can be VULKAN, OPENGL, DIRECTX12, METAL, or NONE.

Alternatively you can set the following preprocessor definitions manually:

Definition Description
XGFX_VULKAN Vulkan
XGFX_OPENGL OpenGL / OpenGL ES / WebGL
XGFX_DIRECTX12 DirectX 12.x
XGFX_DIRECTX11 DirectX 11.x
XGFX_METAL Metal

License

CrossWindow-ImGui is licensed as either MIT or Apache-2.0, whichever you would prefer.

crosswindow-imgui's People

Contributors

alaingalvan avatar navyenzo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.