Jump to content
  • Advertisement
Sign in to follow this  
raydog

OpenGL OnDrawItem()

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

How do you use OpenGL in an owner draw control? Looking for an example that uses MFC's OnDrawItem() or Win32's WM_DRAWITEM and OpenGL.

Share this post


Link to post
Share on other sites
Advertisement
quick google resulted in this

Quote:

11. Adapt OnDraw:

// Useful in multidoc templates
HWND hWnd = GetSafeHwnd();
HDC hDC = ::GetDC(hWnd);
wglMakeCurrent(hDC,m_hglrc);
DrawGLScene(); // do all OpenGL drawing here
SwapBuffers(m_hgldc);


hth

Share this post


Link to post
Share on other sites
I think that is referring to MFC's CView function OnDraw(), which is different.
Usually, you only have to setup OpenGL once for it.

OnDrawItem() refers to an owner drawn control item, like in a dialog window.
I would like to know the proper way to setup OpenGL for it, render something simple,
then shut it down.

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!