Overv / Open.GL

The source code and content of Open.GL.
http://open.gl/
1.07k stars 259 forks source link

Context settings for SFML #57

Closed amhndu closed 6 years ago

amhndu commented 7 years ago

SFML 2.3+ supports using core profile and even the OpenGL version can be requested.

For me, using the simple ContextSettings instance given in the articles only creates a 3.0 context with shaders supported upto 130 only. Although, everything in the series still works after just downgrading the version at the top, it'd be much better if the context settings were explicitly given to allow OpenGL 3+ features.

The following code is sufficient:

    sf::ContextSettings settings;
    settings.depthBits = 24;
    settings.stencilBits = 8;
    settings.antialiasingLevel = 2;
    settings.majorVersion = 3;
    settings.minorVersion = 2;
    settings.attributeFlags = sf::ContextSettings::Core;
Overv commented 7 years ago

That looks good, could you submit a pull request to update the context creation chapter and add some explanation?