I have an OpenGL application written in C++, but I need the user interface for sharing data into the renderer. I am curious: can I, e.g create a dynamically linked library and connect it into some of the C#'s GUI frameworks (WinForms, WPF) and use my renderer in some context?
Asked
Active
Viewed 46 times
1
-
Hi, have you checked this link ? https://stackoverflow.com/questions/935664/possible-to-call-c-code-from-c – Issylin Jun 25 '22 at 17:08
-
Wpf and (I assume) winforms have allowed c++ as the development language for awhile now. Technically c++/cli, but….. – Taekahn Jun 25 '22 at 17:22
-
@Taekahn I think the problem is not the interop in this case (though I agree C++/cli is best for that), it is the C++ library generating graphical output. I see possibilities if the C++ only does calculations and the actual drawing is done from C#... or if there is a way to get a HWND (or HBITMAP) from C# to the opengl stuff in the dll (though I wouldn't know how). – Pepijn Kramer Jun 25 '22 at 17:26