Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: OpenGL used in a subsection of an MFC CDialog

  1. #1
    Intern 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
    Advanced 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
    Junior 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •