SFML community forums

General => General discussions => Topic started by: HKei on January 31, 2012, 01:48:48 pm

Title: Does SFML work with modern OpenGL?
Post by: HKei on January 31, 2012, 01:48:48 pm
Modern as in: OpenGL 3.3 Core/Forward Compatible. I'm currently just looking for an easy platform-independent way of creating an OpenGL context, preferably something nicer than GLUT, and thus stumbled upon SFML. Since it also provides a bunch of other stuff that I need or may need, it seems great to me, but still I am trying to avoid any OpenGL that isn't forward compatible (I am still learning OpenGL, and without the core/forward compatible flag I just wouldn't notice if I was using deprecated functionality, due to the nature of the many tutorials out there).



So uh... just what I wanted to ask: Is SFML compatible with OpenGL 3.3 / 4.x?
Title: Does SFML work with modern OpenGL?
Post by: Laurent on January 31, 2012, 01:55:41 pm
Contexts created by SFML use the compatibility profile flag, because SFML still uses some deprecated functions in its graphics module.

However:
- they should be replaced soon
- you can remove the compatibility flag in the source code and recompile SFML -- it will make no difference if you only use the sfml-window module
Title: Does SFML work with modern OpenGL?
Post by: HKei on January 31, 2012, 02:03:59 pm
Ok, so as long as I steer clear of the graphics module (at least for now), I'll be fine? Thanks.
Title: Does SFML work with modern OpenGL?
Post by: Laurent on January 31, 2012, 02:16:01 pm
Quote
Ok, so as long as I steer clear of the graphics module (at least for now), I'll be fine?

Absolutely.
Title: Does SFML work with modern OpenGL?
Post by: TomCatFort on February 03, 2012, 06:45:26 pm
A flag to create forward compatible context would be very good in SFML 2.0. Even if the graphics module don't support it. SFML already gives window and context creation, basic and very easy audio playback, and cross platform input. Allowing to chose core profile would greatly increase the current usefulness of SFML even if the graphics module is disabled.
Changing the source code, and recompiling it is not a good solution for the developers, especialy on systems where SFML will be (in the future) downloaded by a package manager already compiled.

I propose a solution for context setting modification:
Code: [Select]

enum ContextProfile
{
  CompatibilityProfile, //Default.
  ForwardCompatibleProfile,
};

Using it would require setting it in the ContextSettings instance.
Code: [Select]

ContextSettings cs(0, 0, 0, 3, 2, ForwardCompatibleProfile);
Title: Does SFML work with modern OpenGL?
Post by: Laurent on February 04, 2012, 08:34:39 am
Quote from: "Laurent"
SFML still uses some deprecated functions in its graphics module.

However:
- they should be replaced soon
Title: Does SFML work with modern OpenGL?
Post by: Mars_999 on February 10, 2012, 11:04:59 pm
So will SFML2.0 require OpenGL3+ then? or will you still have access to GL2.1?

Thanks!
Title: Does SFML work with modern OpenGL?
Post by: Mario on February 11, 2012, 02:53:49 am
It still works fine with older versions (e.g. OpenGL 1.4/parts of 2.0 on my netbook), but some features might not work (e.g. shaders oder render to texture).
Title: Does SFML work with modern OpenGL?
Post by: luiscubal on February 14, 2012, 03:13:47 pm
SFML 2.0 will (AFAIK) still use legacy features, being incompatible with core profile but supporting older OpenGL versions.

The whole "don't use legacy OpenGL" discussion seems to apply only to SFML 2.x (post-2.0). And even then, that wouldn't prevent SFML from running on older OpenGL. It would only mean no old functions when running on modern OpenGL versions.
Title: Does SFML work with modern OpenGL?
Post by: Mars_999 on February 18, 2012, 05:00:46 pm
Well if I understand it, if you don't use CORE_PROFILE and use compatibility mode you can use GL2.1 and lower features with GL3+ features? If so why not just run SFML in compatibility mode then?
Title: Does SFML work with modern OpenGL?
Post by: luiscubal on February 18, 2012, 10:50:37 pm
Quote from: "Mars_999"
If so why not just run SFML in compatibility mode then?

That is the current 2.0 behavior.
Title: Does SFML work with modern OpenGL?
Post by: HKei on February 20, 2012, 10:30:02 pm
Quote from: "Mars_999"
Well if I understand it, if you don't use CORE_PROFILE and use compatibility mode you can use GL2.1 and lower features with GL3+ features? If so why not just run SFML in compatibility mode then?


I believe I mentioned I wanted to use the Core profile.
Title: Does SFML work with modern OpenGL?
Post by: Mars_999 on February 21, 2012, 01:21:14 am
Quote from: "HKei"
Quote from: "Mars_999"
Well if I understand it, if you don't use CORE_PROFILE and use compatibility mode you can use GL2.1 and lower features with GL3+ features? If so why not just run SFML in compatibility mode then?


I believe I mentioned I wanted to use the Core profile.


Yes you did. My point is no need as Compatibility mode works with GL3+ anyway... IIRC.

But I agree SFML should just allow the user to set a flag at the time the Render Context is created and set Core/Compatibility mode.