Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ImGui DirectX11 Implementation#2409

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
marcb152 wants to merge5 commits intodotnet:main
base:main
Choose a base branch
Loading
frommarcb152:ImGui-DX11-Impl

Conversation

marcb152
Copy link

@marcb152marcb152 commentedJan 9, 2025
edited
Loading

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 projectsee
  • Create directory & project under/src/Lab/Experiments/ImGui_DX11/
  • CreateImGui_Impl_DX11.cs (C++ port) and the associatedImGuiDX11Controller.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
  • 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!

@marcb152
Copy link
Author

@dotnet-policy-service agree

@marcb152
Copy link
Author

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 toImGui_Impl_DX11.cs equivalent functions. Also assigned DirectXhwnd handle to ImGui (taken fromimgui_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 theREADME.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!⚠️

@Perksey
Copy link
Member

No worries. Is this ready for review? (it's still marked as draft :P)

@marcb152
Copy link
Author

Not yet, I've set aside my compilation issues and improved the code to support .NET 6.0 features (instead of the .NET 9.0 I created my prototype on).
So, the code needs at least C# 12 to compile, I'll push that ASAP (probably beginning of next week) then it'll be ready for review!

I've also made a minimal sample that works which I'll push soon afterwards.

…IntPtr conversion). csharp12 is required to pass readonly ref to dx wrapper. Still wasn't able to build inside the solution
@marcb152marcb152 marked this pull request as ready for reviewJanuary 21, 2025 19:24
@marcb152marcb152 requested a review froma team as acode ownerJanuary 21, 2025 19:24
Demo is heavily inspired by the DX11 Tutorial 1.2 - HelloQuad. I tried to reduce the sample to a minimal state to show off ImGui.
@marcb152
Copy link
Author

Hey, I think this PR is now ready for review (I provided a sample as well).

There are still work to do (tell me if you need comments/self-explanatory code anywhere, this won't bother me). Most TODOs are out of my knowledge, there's one to check out as it can cause issues later:
https://github.com/dotnet/Silk.NET/pull/2409/files#diff-8c4147963edd0bf7166adef79bb3a37e316e17b1d610f2591590f81e6acd4ab9R593
It's the part where we revert back the state of the whole pipeline, I still don't understand how the bindings work with pointers to retrieve/restore arrays of viewports.

And sorry for the long wait also.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
Status: Todo
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@marcb152@Perksey

[8]ページ先頭

©2009-2025 Movatter.jp