Results 1 to 3 of 3

Thread: CWnd style using OpenGL

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    Vilnius, LT, Lithuania
    Posts
    6

    CWnd style using OpenGL

    Hello,
    I've got one more question.
    What style should have a window (derived from CWnd) in which the OpenGL technology is used?
    I place this window on a dialog using the standart CWnd::Create() function. So I should pass in the window style as an argument.
    I have found some information ragarding to the preferable style. It is worth using WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles plus starndart styles like WS_VISIBLE and WS_CHILD. However using mentioned styles together I met with a problem: sometimes the window stops responding. It occurs when the SetPixelFormat() is invoked. Without WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles it goes fine.
    Where is a problem?
    Thank you in advance,
    Condor
    Romanas Puisa

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Re: CWnd style using OpenGL

    You must use WS_CLIPCHILDREN and WS_CLIPSIBLINGS in an OpenGL window. If it is a child window you must use WS_CHILD. I think you need WS_VISIBLE or you wont see the window. If you get problems with SetPixelFormat() it should be something else. Are you using ChoosePixelFormat to make sure your are selecting the right pixel format?

    I understand there's a site dedicated to using OpenGL with MFC ( http://www.mfcogl.com ). This thread also had other links related to using MFC with OpenGL ( http://www.opengl.org/discussion_boa...ML/008303.html ).

  3. #3
    V-man
    Guest

    Re: CWnd style using OpenGL

    It depends if you are making a SDI or MDI window, If its SDI (one window) then you dont need clipchildren and so on. Also, you should plug in CS_OWNDC for the class style (for Win95/98/Me)


    V-man

Similar Threads

  1. C++ Style or C Style? Error on compiling...
    By DarkBrute in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-23-2005, 02:14 AM
  2. how to open an openGL window in MDI style?
    By liro_e in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-24-2002, 05:59 AM
  3. CWnd style using OpenGL
    By Condor in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-07-2002, 07:46 AM
  4. Window's style for OpenGL
    By wildbit in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-25-2001, 10:03 PM
  5. Bezier and OpenGL Big Willy Style
    By grady in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-07-2000, 09:54 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