SFML community forums

General => Feature requests => Topic started by: Mr_Blame on July 28, 2015, 10:27:10 pm

Title: is sfml using modern rendering API
Post by: Mr_Blame on July 28, 2015, 10:27:10 pm
I may look stupid(because i do not know how sfml renders things) but if it does it with some kind of glVertex functions it's ok, but most most poeple say that this style functions refer to fixed pipeline and some computer with openGL do not support, because the sahders exist (yeah in modern openGL 3.3+ and bigger versions porgramms no step can be made withput shaders). If sfml uses fixed pipeline than should it be added or not? Or does sfml already renders with openGL 3.3+ style?
Title: Re: is sfml using modern rendering API
Post by: AlexAUT on July 28, 2015, 11:11:41 pm
No sfml-graphics is using the fixed pipeline aka legacy/old opengl for rendering. If want to have a look on how SFML renders it's components, you can look it up here: www.github.com/sfml/sfml



AlexAUT
Title: Re: is sfml using modern rendering API
Post by: zmertens on July 29, 2015, 05:49:59 am
Also, Mr_Blame, SFML is modular in the sense that you can set up your own OpenGL rendering scheme by simply using a sf::Window object and something like GLEW to initialize OpenGL functions.
Title: Re: is sfml using modern rendering API
Post by: Mr_Blame on July 29, 2015, 11:47:38 am
Thanks a lot, AlexAUT for putting this link :).

Also I have a question for zwookie: how to create an OpenGL 4.x context in SFML window API?

And also will SFML stop using fixed pipeline sometime?
Title: Re: is sfml using modern rendering API
Post by: AlexAUT on July 29, 2015, 12:00:30 pm
int main(int argc, char *argv[])
{
        sf::ContextSettings settings;
        //4.1 context
        settings.majorVersion = 4;
        settings.minorVersion = 1;
        //You can also set different flag (core|compability|debug)
        settings.attributeFlags = sf::ContextSettings::Debug | sf::ContextSettings::Core;

        sf::Window({800, 600}, "Test", sf::Style::Default, settings);
}
 

This creates a 4.1 context, and if 4.1 is not available it should create the "nearest" one.

But keep in mind, sfml-graphics won't gain any advantage of a higher context version, and especially on linux (mesa) drivers don't like compability 3.X+ contexts, and when you use a core context sfml-graphics won't work anymore!

And also will SFML stop using fixed pipeline sometime?

Yes I think so, but don't expect it in the near future, soonTM  ;)


AlexAUT
Title: Re: is sfml using modern rendering API
Post by: Mr_Blame on July 29, 2015, 01:27:46 pm
It's ok. :)

I am just making an OpenGL app using SFML for crossplatform window API.

I know that it is old them but when SFML will stop using fixed pipeline it will be esier for SFML to move to OpenGL ES :). And also using shaders instead of fixed pipeline makes app making esier and gives more features in graphics making. =)
Title: Re: is sfml using modern rendering API
Post by: Jesper Juhl on July 29, 2015, 01:46:44 pm
You can still use shaders:
http://www.sfml-dev.org/tutorials/2.3/graphics-shader.php
http://www.sfml-dev.org/documentation/2.3/classsf_1_1Shader.php