SFML community forums

Help => General => Topic started by: dydya-stepa on November 06, 2011, 12:03:46 pm

Title: OpenGL / GLSL versions in SFML 2.0 ?
Post by: dydya-stepa on November 06, 2011, 12:03:46 pm
which versions of opengl and glsl sfml supports ?
Title: OpenGL / GLSL versions in SFML 2.0 ?
Post by: Laurent on November 06, 2011, 01:21:29 pm
This question doesn't make sense. SFML doesn't support anything, it rather depends on the target graphics card.

Some GPUs may not support shaders at all, some others may support it but with a limited set of GLSL instructions, etc...
Title: OpenGL / GLSL versions in SFML 2.0 ?
Post by: dydya-stepa on November 06, 2011, 01:29:39 pm
ok, which opengl / shader context or whatever it creates by default?
Title: OpenGL / GLSL versions in SFML 2.0 ?
Post by: Laurent on November 06, 2011, 01:53:40 pm
It creates a "regular" context by default, but you can enable contexts >= 3.0 when you create the window, and choose a specific context version.
Title: OpenGL / GLSL versions in SFML 2.0 ?
Post by: dydya-stepa on November 06, 2011, 02:26:10 pm
when i call Shader::IsAvailable() what it checks? if i get true - what version of shaders should i write my app against ?
Title: OpenGL / GLSL versions in SFML 2.0 ?
Post by: Laurent on November 06, 2011, 06:59:15 pm
Quote
when i call Shader::IsAvailable() what it checks?

It checks the following extensions:
Code: [Select]
ARB_shading_language_100
ARB_shader_objects
ARB_vertex_shader
ARB_fragment_shader

This is the minimum to get shaders working.

Quote
if i get true - what version of shaders should i write my app against ?

The version that the graphics card supports. I don't know how to retrieve it (I don't even know if it's possible), so there's no way to check this with SFML.
Title: OpenGL / GLSL versions in SFML 2.0 ?
Post by: Richy19 on November 07, 2011, 05:13:53 pm
Using this table
Code: [Select]

GLSL Version              OpenGL Version
1.10.59                     2.0
1.20.8                      2.1
1.30.10                     3.0
1.40.08                     3.1
1.50.11                     3.2
3.30.6                      3.3
4.00.9                      4.0
4.10.6                      4.1
4.20.6                      4.2

You can get the current OpenGL version used with:

Code: [Select]
std::cout << "Using OpenGL " << App.GetSettings().MajorVersion << "." << App.GetSettings().MinorVersion << std::endl;

And write the shader code that is supported by the openGL version
Title: OpenGL / GLSL versions in SFML 2.0 ?
Post by: dydya-stepa on November 07, 2011, 06:55:25 pm
thanks! that's what i needed