SFML community forums
Help => General => Topic started by: Viruses on January 04, 2012, 10:45:29 pm
-
Ok so as the title might suggest, and im no where near this i still want to know how you can do special effects with SFML. Is it advanced enough for like cool special effects? E.g. particle systems,explosions,etc. And also, where does shaders come into play here?
-
Check the documentation for sf::Shader (included in Graphics). Only thing missing right now (I think) are point clouds, making particles a bit harder to do (depending on how you'd like to do them).
-
Wait isnt it supposed to be done in GLSL if opengl and this other for Directx? Why does SFML have a shader class..
-
It's a simple wrapper around GLSL functions. sf::Shader will load your vertex and pixel shaders (beginning with SFML 2.0) and allow you to apply them to other stuff being drawn. You don't have to hassle with OpenGL's shader objects, shader programs, etc.
Also keep in mind that SFML uses OpenGL on Windows too, so you can't use HLSL, only GLSL.
-
Alright. I have a question about SFML coding. I have been using keypressed() function of sf::Keyboard. But i want to check for just a single
key press. So not if its pressed, but if it was pressed and released. How would i do that?
-
http://www.sfml-dev.org/tutorials/1.6/window-events.php
In SFML2, use PollEvent instead of GetEvent.
-
By the way, I have written a particle system and an event system for uniform event/input handling in my library, maybe they help you too (see signature).