[.net] OpenGL, C++, WinForms
Hello..
I hope I'm right here. I have a problem, namely I would like to use WinForms and OpenGL. I know the TAO library for C# but I'm searching a way to display an OpenGL scene to a 'System::Forms::Panel' using C++. Do anyone knows how to do this?
One try could be (I think so..) to recieve the 'HWND' and create the rendering and device context like with MFC but how can I recieve this 'HWND' structure? (I'm familiar with method 'IntPtr get_Handle()' but the conversion 'IntPtr => HWND' perplexes me.. :-/)
Any suggestions?
Thanks in advance for your replies..
ciao..
Yeah I did just that and it worked fine with directX. I took the HWND from a panel and used it to initilized an a Direct3D device in unmanaged code (out of the C#/winforms code). Just try it, use the "get handle" of the panel you want to display the opengl stuff.
heh
HWND hWnd = dynamic_cast<HWND>(panel->Handle.ToPointer());
or even
HWND hWnd = (HWND)panel->Handle.ToPointer();
should be enough
[Edited by - RenZimE on January 2, 2005 6:09:15 PM]
HWND hWnd = dynamic_cast<HWND>(panel->Handle.ToPointer());
or even
HWND hWnd = (HWND)panel->Handle.ToPointer();
should be enough
[Edited by - RenZimE on January 2, 2005 6:09:15 PM]
I try to make that work a few weeks ago, but I could not make it :(
Please email me or post the code if you can make it work. Thanks!
Hints:
http://www.gamedev.net/community/forums/topic.asp?topic_id=280599
http://www.mcse.ms/message522687.html
Please email me or post the code if you can make it work. Thanks!
Hints:
http://www.gamedev.net/community/forums/topic.asp?topic_id=280599
http://www.mcse.ms/message522687.html
¬_¬ ok i made some modifications to an old OpenGl and winforms example i did for a friend a while ago. its in a vs.net2005 solution and uses old syntax.
its fairly ok but not one of the best programs in the world.
http://legendaire.info/renzime/misc/pictureboxrendertarget.zip
its fairly ok but not one of the best programs in the world.
http://legendaire.info/renzime/misc/pictureboxrendertarget.zip
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement