Results 1 to 6 of 6

Thread: OpenGl in Dialog

  1. #1
    Guest

    OpenGl in Dialog

    Hi
    I use OpenGL in MFC.
    Here I want to draw second OpenGL window in a opened dialog. How to do it?
    Anyone has examples?
    Thanks!

  2. #2
    Member Contributor
    Join Date
    Jul 2002
    Location
    Southampton, PA, USA
    Posts
    61

    Re: OpenGl in Dialog

    It's quite easy. Instead of using the dialog window itself as your DC, create a Picture Control and use it's DC (which you can find using GetDlgItem). This way you only render to a portion of the screen. Create a second Picture Control and do the same thing...call wglMakeCurrent to switch to the current context before doing any rendering.

  3. #3
    Guest

    Re: OpenGl in Dialog

    Is there any example code?
    Thanks!

  4. #4
    Guest

    Re: OpenGl in Dialog

    and now I setup the dialog for drawing.
    However, the openGL setting in the dialog will effect opengl in the main window.
    How to totally seperate them?

  5. #5
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Posts
    340

    Re: OpenGl in Dialog

    each rendering context has its own state

  6. #6
    Junior Member Newbie
    Join Date
    Aug 2002
    Location
    shanghai
    Posts
    5

    Re: OpenGl in Dialog

    There are a code: www.7forever.com/code.zip

    ,I write it for asking how the share texture in defferent opengl context.But i have a bad new:This is can not!

Similar Threads

  1. Problem : OpenGL with MFC Dialog.
    By kccc in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-23-2005, 12:30 AM
  2. Problem : OpenGL with MFC Dialog.
    By kccc in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-22-2005, 09:51 AM
  3. opengl and mfc-dialog
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-22-2003, 08:28 AM
  4. OpenGL Dialog Box?
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-25-2001, 02:27 PM
  5. openGL in dialog box
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-27-2001, 09:41 PM

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