views:

72

answers:

2

Hello,

I want to create a simple 3D editor program, and I kind of hate C++ windows programming. But I don't want to mess with managed code when using OpenGL, either. So, it is possible to create in native C++ a control which will host the OpenGL 3D drawing surface, with no other controls, and also with an interface (methods and properties), and use it as a control in a WinForms, or even better, WPF application?

If yes, I would be glad if you could provide some code.

Thanks

+1  A: 

Does it have to be OpenGL? Consider using XNA which would let you use C# and DirectX. Otherwise I suggest you find a C# wrapper for OpenGL. There are two wrappers listed here http://www.opengl.org/resources/bindings/.

Brian Ensink
I personally prefer OpenGL because I suck at, and I hate DirectX, and also I think XNA is a framework only for games. I wouldn't mind using an OpenGL wrapper for C# (I've used OpenTK, and it's cool), but I'm especially interested in performance, so I considered using native code instead of managed. If you can provide some links from which I can tell if it's worth the effort of using native C++ instead of managed C#, from a performance point of view, I would be very grateful. Thanks
Tiby
A: 

I dont really understand your intention. You said that you hate C++ programming, you dont want to mess with managed code when using OpenGL, you want opengl windows with no ui control but you want winform or wpf as you ui.

If you hate programming c++, you have to use managed code. If you dont want to mess with managed code when using OpenGL, you have to use c++ programming. if you want to create in native C++ a control which will host the OpenGL 3D drawing surface, with no other controls(which i assume UI controls), why consider winform or wpf?

Dont use WPF to create 3d heavy applications. wpf was meant as a ui. you will find a lot of limitation along the way. There is also limitation in hosting(WPF), which makes it useless to use opengl with wpf.

I think the best bet would be XNA or http://www.opentk.com/(if you must use OpenGL). Tao Framework is obsolete and is not worth the effort.

publicENEMY
I don't hate C++ programming, I hate only C++ WINDOWS programming. To be more explicit, I prefer programming in C++ only the OpenGL part, but I hate programming in C++ the UI. So that was my problem. Also, as I said before, XNA is not suitable for my app because XNA is meant to be used only for managed games. So my initial question (and the most suitable) was if I can use a C++ written OpenGL control (the viewport) for a WinForms app. If this is not possible, I have 2 options: program the whole app in C++ (probably using MFC), or using OpenTK in a managed app. Which do you think is best?
Tiby
If you absolutely need the latest and greatest, consider using native c++ and glut like framework(maybe glfw). if you need to have user interface (i think you do considering you are building 3d editor) and don't mind not having the latest and greatest opengl spec, consider winforms and opentk. just make sure the libraries that you need (im definitely sure you will need to use other support library) is available on the development platform that you chose.
publicENEMY