Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: When a support for a core context ?  (Read 3622 times)

0 Members and 2 Guests are viewing this topic.

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
When a support for a core context ?
« on: October 26, 2015, 10:41:22 am »
Hi!

I've tried to create an opengl 4.2 core context on windows with SFML but it doesn't seem that SFML support it yet.

Only older versions of opengl are working.

So, when I execute a code with moddern opengl, it crash.

But with glfw I don't have any problem.

Do you plan to add an SFML support for modern opengl one day ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: When a support for a core context ?
« Reply #1 on: October 26, 2015, 10:47:15 am »
Everything you have to know is explained in the documentation. There is even a big red box in the corresponding tutorial.

Quote
OpenGL versions above 3.0 are supported by SFML (as long as your graphics driver can handle them). Support for selecting the profile of 3.2+ contexts and whether the context debug flag is set was added in SFML 2.3. The forward compatibility flag is not supported. By default, SFML creates 3.2+ contexts using the compatibility profile because the graphics module makes use of legacy OpenGL functionality. If you intend on using the graphics module, make sure to create your context without the core profile setting or the graphics module will not function correctly. On OS X, SFML supports creating OpenGL 3.2+ contexts using the core profile only. If you want to use the graphics module on OS X, you are limited to using a legacy context which implies OpenGL version 2.1.
Laurent Gomila - SFML developer

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: When a support for a core context ?
« Reply #2 on: October 27, 2015, 07:24:25 pm »
And how can I create a context without the core profile ?

In the SFML source code I've seen that on windows it's a core profile which is created. O_O

Excepting in debug mode ...

With GLFW I haven't any problem ..., but when I create an opengl 3.3+ context with SFML the .exe crash. :/

For the moment I'm using GLFW, but, just wanted to mention that.


AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: When a support for a core context ?
« Reply #3 on: October 28, 2015, 07:54:40 am »
No SFML won't create a core context by default, as Laurent posted, please read the answers...
Quote
By default, SFML creates 3.2+ contexts using the compatibility profile


Just have a look at sf::ContextSettings and you will get all your answers. There you can set the major and minor version of the context, and with the attribute member you can set the Debug, Core or the Compability flag...

Quote
Excepting in debug mode ...
?

Quote
but when I create an opengl 3.3+ context with SFML the .exe crash.
A really useful statement, have you tried to debug it? I guess you want to create a 3.3+ compability context but your driver doesn't support it?



AlexAUT