Jump to content
  • Advertisement
Sign in to follow this  
jm_hewitt

OpenGL Java wgl: hwnd, hdc, hglrc passing question

This topic is 4969 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

I am using JNI to interface my company's Java components with the rendering engine I've written. It was going relatively smooth until implementing the function that moves the canvas that everything was rendering on from one Java frame to another. We've been hunting through the Java3d code and the limited documentation on msdn, but are having trouble doing this. I have some windows questiosn I hope someone can answer: Can you pass from one window to another an OpenGL context? I.e. I loaded all my textures, vbos, etc when my hglrc, hdc and hwnd was all set on one window. Can I later with a differn hwnd, use all that data loaded? Is there a tutorial or documentiaotn that deal with this? ANy helpe or anything would be a huge help.

Share this post


Link to post
Share on other sites
Advertisement
Assuming that segment is written in C/C++, you'll find it in 'wingdi.h', it'll look like this:

BOOL WINAPI wglCopyContext(HGLRC,HGLRC,UINT);

That should give you the results you're looking for.

Share this post


Link to post
Share on other sites
thanks, i eventually found a simliar command wglShareLists( GLRC, GLRC ) that solved my problem. i will read up on your method too so i can know more of what wgl code is out there.

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!