Jump to content
  • Advertisement
Sign in to follow this  
MAS

OpenGL MFC/OpenGL/GDI

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

Hi, I realise that there's a lot of resources and code samples out there on MFC and OpenGL - http://www.codeproject.com/opengl/ and so forth. I've been developing a commercial CAD package for the textile industry. However, I need to give the users an option to visualise structures in 3D. I use MFC, GDI and class CScrollView. Is it possible to display my 2D GDI (CAD) output and the 3D visualisation by mixing GDI and OpenGL? I'm guessing that maybe I'll have to render the 2D GDI stuff as normal in CView::OnDraw() and then set-up OpenGL ->render 3D data ->tear-down OpenGL and revert back to CView::OnDraw() for the 2D (GDI) CAD output. Any thoughts? I've committed a lot of effort to the MFC/GDI/Scrollbars (the scrollbars are essential) approach. I just don't know how to support switching between to MFC/GDI and MFC/OpenGL modes in the runtime. Eek. Regards, Martin.

Share this post


Link to post
Share on other sites
Advertisement
As I just found out yesterday, you can render directly to a DIB through OpenGL if you use the PFD_DRAW_TO_BITMAP flag when you create your pixel format.

There's a sample on MSDN about it too (a tad old, though). :)

Share this post


Link to post
Share on other sites
Hi,

I shouldn't have been too impatient to post. It turned out to be simple to render the OpenGL output to a Dialog.

Cheers,

Martin.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!