Jump to content
  • Advertisement
Sign in to follow this  
UAV

[.net] OpenGL, C++, WinForms

This topic is 5007 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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..

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
¬_¬ 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

Share this post


Link to post
Share on other sites
Thanks a lot for the replies. I'm sorry that I didn't find the already posted issues.

Nevertheless, thanks again..
ciao..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!