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: wglCreateContextAttribsARB not needed anymore?

  1. #1
    Newbie Newbie
    Join Date
    May 2013
    Posts
    3

    wglCreateContextAttribsARB not needed anymore?

    Is wglCreateContextAttribsARB not needed anymore? I just recently noticed with the latest drivers from both NVIDIA and AMD that just calling wglCreateContext gives me access to all OpenGL versions and associated extensions up to the version supported without having to call wglCreateContextAttribsARB. Is this a bug or was it intended? Has anybody else experienced this?

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,144
    It is needed, more than ever before. There are several attributes/flags that cannot be set without that function.

    wglCreateContext should make non-debug compatibility non-forward profile/context. If it is so, there is no bug.

  3. #3
    Newbie Newbie
    Join Date
    May 2013
    Posts
    3
    I'm fully aware of what the specification says for the expected behavior of wglCreateContextAttribsARB and its uses. However that wasn't my question. My question was really whether or not anybody else has experienced this behavior.

  4. #4
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,144
    I'm really sorry my English is so bad that you cannot understand me (and even I didn't understand what you wrote). There are three questions and I'll explicitly answer to each one.

    Quote Originally Posted by soconnell View Post
    Is wglCreateContextAttribsARB not needed anymore?
    It is needed since there is no other way to define context's attributes.

    Quote Originally Posted by soconnell View Post
    I just recently noticed with the latest drivers from both NVIDIA and AMD that just calling wglCreateContext gives me access to all OpenGL versions and associated extensions up to the version supported without having to call wglCreateContextAttribsARB. Is this a bug or was it intended?
    It is intended behavior.

    Quote Originally Posted by soconnell View Post
    Has anybody else experienced this?
    Yes

    There is a clear state in the spec:
    Quote Originally Posted by WGL_ARB_create_context
    ...
    When this extension is supported, calling

    wglCreateContext(hdc)

    is equivalent to calling

    wglCreateContextAttribs(hdc,0,NULL).
    ...
    The legacy context creation routines can only return OpenGL 3.1
    contexts if the GL_ARB_compatibility extension is supported, and can
    only return OpenGL 3.2 or greater contexts implementing the
    compatibility profile. This ensures compatibility for existing
    applications. However, 3.0-aware applications are encouraged to use
    wglCreateContextAttribsARB instead of the legacy routines.

  5. #5
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,213
    Quote Originally Posted by soconnell View Post
    ...*CreateContext gives me access to all OpenGL versions and associated extensions up to the version supported without having to call *CreateContextAttribsARB. Is this a bug or was it intended? Has anybody else experienced this?
    Intended (for backward compatibility), and yes. If compatibility profile alone is all you need, just use *CreateContext and be happy.

    However, *CreateContextAttribs is useful for creating a debug profile if nothing else (produces perf tips from the driver on what you're doing). You can also target a specific OpenGL version. And/or if you're a purist, you might want to target the core profile which keeps you from using any of the deprecated features.

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Apr 2009
    Posts
    591
    For NVIDIA and ATI, if you just want features then *CreateContext is fine.

    But, for Intel with Mesa under Linux, using glxCreateContext will give one a GL3.0 context; if you want greater than 3.0 under Intel with Mesa (or really any driver implemented via Mesa) then you must use glxCreateContextAttribsARB AND select core profile. One important feature is that geometry shader development in Mesa has been geometry shaders as found in 3.2, not as found in GL_ARB_geometry_shader; so there is a real advantage of glxCreateContextAttribsARB over glxCreateContext for Mesa based GL implementations.



Posting Permissions

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