SFMl for 3D programming?

I heard that SFML is not for 3D programming because it does not support 3D stuffs but SFML uses OpenGL, right? or is it because SFML uses its own OpenGL? if so, how do I use SFML as just a 'window creator' and use OpenGL explicitly for '3D' stuffs?

*EDIT*

maybe I misunderstood something...

You can't make 3D games with only SFML, but you can make 3D games if you include opengl.cpp am I right?
Last edited on
Well there have a small tutorial on sfmls website - http://www.sfml-dev.org/tutorials/2.2/window-opengl.php´

And maybe this thread might be helpful - http://www.cplusplus.com/forum/lounge/131907/
Last edited on
You "can" make 3D-games any graphics library as well, the only problem is rendering.

The SFML library itself "can" only draw 2D-stuff, that doesn't mean it's completely impossible to make 3D-games. The only problem is that you'd have to write stuff around that 2D framework to make it "look like 3D" (eg. tilting, viewport, distance etc.)

OpenGL on the other hand supports the rendering of 3D-stuff without you having to translate everything to the 3D-space.

The job of a programmer is to devide what tool is best for the task, for 3D-stuff opengl is far surpirior to SFML.

So to give a concrete answer to your question: You could make 3D games with SFML but that would be like using a piece of paper to ram a nail in the wall.
You can use SFML to provide the window or the menu interface but for the game itself you should use opengl
Yes I get that, but isn't SFML supports OpenGL? I'm confused because SFML comes with OpenGL but people are saying that SFML can't draw 3D stuffs. Or does SFML supports OpenGL but not for 3D?
Last edited on
The fact that SFML uses OpenGL is an implementation detail. SFML is correctly abstracted so that the end user does not have to know a single thing about OpenGL programming in order to use SFML.
It is true that SFML does not provide functions for drawing things in 3D, as it is a 2D library.

OpenGL's state can be pushed and popped with SFML's drawing state to allow the use of OpenGL functions and SFML functions within the same draw frame (though I personally have not used it in this way).

SFML is also more than just its Graphics.hpp, it provides System, Window, and Network modules.

You can use its sf::Window class as a window context for any version of OpenGL.
Last edited on
So basically if I want to create 3D games, I use SFML for making window and use OpenGL explicitly.

I searched online and I couldn't find how to use OpenGL explicitly using SFML. Can someone give me a useful links?
So basically if I want to create 3D games, I use SFML for making window and use OpenGL explicitly.
Or you could use a 3D engine such as Unreal 4 (it is free).
Last edited on
Or you could use a 3D engine such as Unreal 4 (it is free).

Or Ogre3d - http://www.ogre3d.org/
Topic archived. No new replies allowed.