SFML community forums

Help => General => Topic started by: digimikeh on July 10, 2020, 05:10:15 am

Title: Using opengl
Post by: digimikeh on July 10, 2020, 05:10:15 am

I'm looking for a way to do a game just like Donkey Kong Country from Super Nintendo, you know, the game is smooth, good graphics and animations.....

After seeing some showcases i saw that many of the games runs a bit lag, i don't know either if thats because recording screen or something else... so i investigated a little more and found that i can use opengl for 2d content which means that SFML by default does not uses openGl... is this right?

In such case, do you think i'm forced to use opengl to create something like Donkey Kong Country or the default SFML video system is ok?..

In case i need opengl, does someone has a good book or resource to learn SFML + Opengl?

Thanks so much!..

I understood that SFML uses OpenGL, so i think i neee to focus on learning how to move sprites smoothly using time & physics..
Title: Re: Using opengl
Post by: Hapax on July 12, 2020, 11:13:54 pm
Hi! :)

It's likely that it's the capture software that is showing lag. Without using OpenGL directly, 2D can be done (just as) smoothly using just SFML (yes, SFML uses OpenGL itself).

(click to show/hide)
Title: Re: Using opengl
Post by: fallahn on July 12, 2020, 11:27:17 pm
Just for clarity: the first example (space racers) actually mixed opengl with SFML. However the remake (https://github.com/fallahn/osgc/tree/master/space_racers) uses 'pure' SFML :)

As for books, I highly recommend https://www.packtpub.com/game-development/sfml-game-development over any of the other SFML-centric books which I've read (and https://gameprogrammingpatterns.com/contents.html is also worth a read too)
Title: Re: Using opengl
Post by: Hapax on July 13, 2020, 11:18:12 pm
Apologies. I intended to mention the use of direct OpenGL in tandem with SFML in your game!
Does the "remake" use SFML exclusively and does it still have 3D elements?
Title: Re: Using opengl
Post by: fallahn on July 14, 2020, 01:56:53 pm
Sorry for hijacking this thread somewhat :) - Yes the remake still has 3D elements, which are created using standard sf::VertexArrays and some vertex shader trickery, rather than using OpenGL directly (so I guess it depends on your definition of 'pure'). I posted some experiments on twitter (https://twitter.com/TrederiaGames/status/1197241889734483973) in the past, and the source is here (https://github.com/fallahn/osgc/tree/master/fist/src) if anyone feels like digging around.

EDIT: In fact a better exxample might be this:  ;D