Hello everyone
I'm using SFML to open a RenderWindow and I would like to use raw openGL to draw 3d graphics.
I'm calling glewInit() after the RenderWindow has been opened.
I'm not using sf::Shader.
Unfortunately, I get this message :
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 3.3 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Created: version = 4.5 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = true ; debug = false ; sRGB = false
And here are a few GL infos I print :
version: 4.5
GL VERSION: 4.5 (Core Profile) Mesa 17.3.7
GLSL VERSION: 4.50
My question is this: Is it possible to get a compatible profile to use the SFML graphics module for 2d rendering (for user interface mostly) AND openGL shaders using GLSL version 3.3 or above ?
Maybe it's not possible and SFML is not ready to support both ? In which case I suppose I should just open a simple sfml window ?
Thank you for your help
EDIT:
If you really want to use OpenGL 3.3 core on your system some steps are necessary:
- Don't use anything in sfml-graphics, this includes sf::Shader. sfml-graphics contexts are by default always compatibility. You will have to do everything yourself in raw OpenGL.
- On your system you have to make sure that you are not using any compatibility contexts. This means no sfml-graphics and explicitly having to activate the context of your window after creation.
- Always make sure that your window is activated after you create it. If you don't explicitly do this you might end up using a context you didn't create, which is not going to be 3.3 core.
I saw that post and I'm not sure I understand. Does it mean that there's no way to use both graphics-module and my own opengl code/shaders ?
Also I just did a simple test: Using a sf::Window instead of sf::RenderWindow doesn't change anything. I get the same core context for requesting version 3.3.