Overv / Open.GL

The source code and content of Open.GL.

Home Page:http://open.gl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Context settings for SFML

amhndu opened this issue · comments

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;

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