Welcome, Guest. Please login or register.

Author Topic: [C++][OpenGL] How to get compatibility profile for GLSL 3.3  (Read 54 times)

0 Members and 2 Guests are viewing this topic.

arrognz

  • Newbie
  • *
  • Posts: 1
    • View Profile
[C++][OpenGL] How to get compatibility profile for GLSL 3.3
« on: August 12, 2018, 03:41:11 pm »
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 :

(click to show/hide)

And here are a few GL infos I print :

(click to show/hide)

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.
« Last Edit: August 12, 2018, 04:02:50 pm by arrognz »

Hapax

  • Hero Member
  • *****
  • Posts: 2575
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: [C++][OpenGL] How to get compatibility profile for GLSL 3.3
« Reply #1 on: August 13, 2018, 11:17:40 pm »
Is your intention to use 3.3 core because the first message suggests that you're attempting to use 3.3 "not-core".
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

 

anything