Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGui DirectX11 Implementation #2409

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

marcb152
Copy link

@marcb152 marcb152 commented Jan 9, 2025

Summary of the PR

This PR introduces initial support for ImGui with DirectX11 in Silk.NET. It includes:

Related issues, Discord discussions, or proposals

Current progress

  • Working prototype in my own project see
  • Create directory & project under /src/Lab/Experiments/ImGui_DX11/
  • Create ImGui_Impl_DX11.cs (C++ port) and the associated ImGuiDX11Controller.cs
    • Not sure if I should keep those 2 files separated though? I am sticking to the original C++ file as DX11 code is a bit verbose and the controller would reach +1k lines very fast.
  • Create another directory and a sample minimal project to demonstrate (where?)
  • Solve TODOs and clean up the code

Further Comments

The changes should not introduce any breaking API or behavioral changes: they will extend the functionality of Silk.NET.

Tested on

  • Silk.NET v2.22.0
  • ImGui.NET v1.91.6.1

Remarks

This is actually my first PR to such a large open-source repo. Any help, constructive criticism, remarks, suggestions, improvements and feedback are greatly appreciated!

…mpl_DX11 ported from Cpp file. WARNING: never compiled inside Silk.NET solution
@marcb152
Copy link
Author

marcb152 commented Jan 9, 2025

@dotnet-policy-service agree

@marcb152
Copy link
Author

marcb152 commented Jan 9, 2025

I have pushed my prototype code all in one. My apologize for the long files!

As a recap:

  • ImGuiDX11Controller.cs is mostly a copy paste from the existing OpenGL controller implementation, I replaced OpenGL calls by calls to ImGui_Impl_DX11.cs equivalent functions. Also assigned DirectX hwnd handle to ImGui (taken from imgui_impl_win32.cpp). Not a lot of changes there.
  • ImGui_Impl_DX11.cs is the full port of the original C++ and header (linked in the README.txt)
  • ImGuiFontConfig.cs imported from the OpenGL impl, no changes at all.
  • I created the .csproj file linking the necessary dependencies inside Silk.NET repo ⚠️never compiled yet!⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant