Results 1 to 3 of 3

Thread: OpenGL used in a subsection of an MFC CDialog

  1. #1
    Member Newbie
    Join Date
    Feb 2000
    Location
    Kingston, Ontario Canada
    Posts
    47

    OpenGL used in a subsection of an MFC CDialog

    I am trying to create a dialog using Visual C++ that has a small OpenGL "window" embedded inside it.

    I have succeeded in enabling OpenGL to draw to the entire window but I want to confine it to a small subsection (so that MFC controls most of the dialog's background).

    Is there a simple way of doing this?
    Is ActiveX the answer?

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    880

    Re: OpenGL used in a subsection of an MFC CDialog

    OK, that can be tricky....

    You should create a new class and use it as a custom control in your dialog box....

    Concerning this new class you would create, you then have to put all your OpenGL inits in this class instead of in the CDialog-derived class of your application...

    I know that can sound a bit messy but I assumed there that you are familiar with MFC and class-derivation...

    Of course, you can also create an ActiveX control for this purpose but this is REALLY tricky (I have just finished one for my viewer...).

    Eric

  3. #3
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    211

    Re: OpenGL used in a subsection of an MFC CDialog

    Make any control-element with an own DC.
    You are able to render to all "elements" with an own DC in it. Modify the size of the DC, to the size you want.
    DJSnow

Similar Threads

  1. Replies: 2
    Last Post: 03-04-2018, 12:26 PM
  2. How to render to a subsection of a cubemap array?
    By Makogan in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-23-2018, 12:15 PM
  3. Strange CDialog behavior
    By brightbird in forum OpenGL: Windows
    Replies: 0
    Last Post: 03-29-2005, 09:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean