-
Notifications
You must be signed in to change notification settings - Fork 2
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
MonoGame rendering #1
Comments
The screen shot you linked to is definitely my code running ported to c# and not using any ImGui bindings. The code is in ImGui.MonoGame.NET and the other projects in this repo were from when I was attempting to clean up the code and make it more C# based. To answer your question I'm not entirely sure what is going on, perhaps you haven't setup the Display size properly?
The block filled text also indicates that the texture isn't bound correctly to the shader and its rendering a pure white texture instead. That all being said I just recently started getting back in to this code base and looking at finishing it, its about 95% done if not more with one or 2 random bugs. |
First off I just ran your updated repo, and I works out of the box with one exception(the one you noted). When I tried to build it the target was set to x64, once I changed that it worked without a hitch. I am not surprised that my original approach(shown in the picture above) had some faults. Thank you for doing this! |
You can build for x64 or x86 if you manually edit the nuget package for SharpFont.Dependencies in |
@xposure, so I noticed that the load and save settings functions for the ini file were not implemented, and so I took the liberty to write them. Here is the code. There are some notes and issues concerning it:
I have tested it and it does indeed work, saving to disk and loading from it. Also, changing position and size values in the ini file does reflect change in game. Let me know your thoughts and possible changes about integration. |
Long story short it seemed like this wasn't a welcome addition over at the DearImGui repo so I stopped working on this code base for the public. The creator felt it made more sense to just use the bindings to C rather than a real port so that multiple code bases didn't have to be maintained. I tried to use the bindings on several occasions (2 different versions) and it felt incomplete and annoying to work with and P/Invoke overhead can add up. One thing I dislike is that its basically a singleton, the version I use for a closed source project has no singletons what-so-ever and I can have multiple instances running of DearImGui which helps when you are doing things like in-game editors (aka Unity style). I would welcome any PRs and if this does indeed seem to be something people are interested in, I could start maintaining it and keeping it up to date.
|
@xposure, I sorta got that feeling from what I read in the threads over there. However, it is under MIT license, and correct me if I am wrong but that means its open for any type of use. Having said that, I attempted at using the other as well and I wasn't successful, hence my first post here. I was not aware that there was an overhead associated with P/Invoke, granted I have only know about it for a few days, but that makes it more sensible to port it. Albeit, it maybe a little more work than just putting a wrapper around it. As, far as a pull request is concerned I would gladly submit one. I am just a student, but many of my buddies at school would probably love to know that this is available. I was aware that you wanted to stay true to the original code base as possible, and personally all I did was write the commented code as close that I could. Accessing the filestream was probably where I got off base a little bit, the rest of the 'major' deviations was just so that I could debug it. In fact I was hoping you had a better idea on how to get it back in line. |
P/Invoke has about 30-40 instruction overhead which can be reduced with some attributes like SuppressSecurity but then there is marshaling of data for types that aren't blitable. Its almost not even measurable if you are making 5 calls a second, but can start to add up if you make 100s or 1000s. I think what I will start to do is spend some time each night to bring the code base up to date and implement a few odds and ends I left out as well as add some additional renderers. |
Just a heads up, will take a look at save/loading in the next week or so. |
Hello @xposure,
I am really interested to know how you achieved this. I understand that you ported the Dear ImGui to C#, and I am not sure if you have completed this process.
I have been using ImGui.NET to get a hold of the data. However, I wasn't quite sure how to feed that information into MonoGame, and I have used your code as a guide on how to achieve it. Here it a shot of what it looked like.

It's something, but not what I am going for. Thanks for any help!
The text was updated successfully, but these errors were encountered: