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 6 of 6

Thread: Creating Context the "Modern" Way?

  1. #1
    Intern Contributor
    Join Date
    May 2012
    Posts
    98

    Creating Context the "Modern" Way?

    I'm trying to create a core profile context in a windowed application that uses a GUI toolkit. The toolkit creates the window and I just get a handle to it I pass to the context creation functions. However, as I understand it requires me to first create a dummy context the old way in order to access the new wgl extensions namely wglCreateContextAttribsARB, then I will have to destroy the window since I cannot use it with different pixel format. This is the problem, I don't own the window, it's created by the toolkit and passed to me. Is there a workaround to this problem?

    Thanks.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,718
    In general, any GUI toolkit worth using with OpenGL (outside of Win32 itself) will have an "OpenGL Widget" that takes care of all of this for you. What toolkit are you using that doesn't have one?

  3. #3
    Intern Contributor
    Join Date
    May 2012
    Posts
    98
    I'm using Qt, but I don't want to use their OpenGL widget since I implemented a different way to create 3D graphics-capable windows. I wanted the application to be decoupled from the rendering engine. This way I can have different rendering paths provided by different modules (dynamically loaded), one for a different version of OpenGL or even Direct3D. All I have to do is just passing the native window handle to the graphics engine, which then creates the rendering context and associate the window with it.

  4. #4
    Intern Contributor
    Join Date
    May 2012
    Posts
    98
    So if I'm not changing the pixel format, do I still need to destroy the window?

  5. #5
    Intern Contributor
    Join Date
    May 2012
    Posts
    98
    After further researching I call for a unified context management API. The way wglCRAP works is nonsense. It's ancient and cannot serve the job anymore. ARB go ahead with a new API, we need this very soon. Just do it.

  6. #6
    Intern Contributor
    Join Date
    Jul 2006
    Posts
    70
    Direct your complaints towards MS-Windows. The ass-backwardness of wgl* is because Windows is stuck with OGL 1.4 (or less for some OS versions).

Posting Permissions

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