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

Author Topic: is sfml using modern rendering API  (Read 5074 times)

0 Members and 1 Guest are viewing this topic.

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
is sfml using modern rendering API
« 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?

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: is sfml using modern rendering API
« Reply #1 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

zmertens

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: is sfml using modern rendering API
« Reply #2 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.
The truth will set you free but first it will piss you off.

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: is sfml using modern rendering API
« Reply #3 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?

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: is sfml using modern rendering API
« Reply #4 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

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: is sfml using modern rendering API
« Reply #5 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. =)
« Last Edit: July 29, 2015, 01:32:07 pm by Mr_Blame »