简体   繁体   English

如何在C#GUI中嵌入C OpenGL应用程序?

[英]How to embed C OpenGL application in C# GUI?

I have 3D OpenGL application written in C for Unix-like systems, it is working fine in Linux, but lacks GUI and is only controllable via keyboard. 我有一个用C语言编写的3D OpenGL应用程序,用于类似Unix的系统,它在Linux上运行良好,但是缺少GUI,只能通过键盘控制。 As far as I know C# GUI is the simplest and nicest and cutest to create and it's very easy to create nice gui in C# in Microsoft Visual Studio 2010 Ultimate. 据我所知,C#GUI是最简单,最漂亮,最可爱的创建方式,在Microsoft Visual Studio 2010 Ultimate中用C#创建漂亮的gui很容易。

SO I decided I want to embed graphical application written in C OpenGL in C# application GUI, just something like this: http://img854.imageshack.us/img854/2773/qoyz.jpg 所以我决定我想在C#应用程序GUI中嵌入用C OpenGL编写的图形应用程序,就像这样: http : //img854.imageshack.us/img854/2773/qoyz.jpg

Of course I want to control C application from my C# GUI. 当然,我想通过C#GUI控制C应用程序。 It could be done any possible way I was thinking maybe about some dll file compiled from C OpenGL code? 可以用任何我可能正在考虑的一些用C OpenGL代码编译的dll文件来完成?

I dont have any experience with that kind of stuff, so give me clear answers:) 我没有这类经验,所以给我清楚的答案:)

You are probably going to need to create a managed code wrapper for your C project so that it can be accessed from C#. 您可能需要为C项目创建一个托管代码包装程序,以便可以从C#中对其进行访问。

See this previously asked question: Porting (unmanaged) C++ to C# vs. using the C++ as a DLL in a C# application 请参见以下先前提出的问题:将C ++移植(非托管)到C#,而在C#应用程序中将C ++用作DLL

Have you tried Qt SDK ? 您是否尝试过Qt SDK With it you can create not less "cutest, nicest " GUI which is also c++ and cross platform, contrary to MS WinForms or WPF. 使用它,您可以创建不少于“最可爱,最漂亮”的GUI,它也是c ++和跨平台的,与MS WinForms或WPF相反。 In fact,many GUI based programs, like Maya or Aftereffects, use Qt 实际上,许多基于GUI的程序(例如Maya或Aftereffects)都使用Qt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM