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

Author Topic: SFML Special effects and stuff?  (Read 4813 times)

0 Members and 1 Guest are viewing this topic.

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Special effects and stuff?
« 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?

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
SFML Special effects and stuff?
« Reply #1 on: January 05, 2012, 12:31:52 am »
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).

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Special effects and stuff?
« Reply #2 on: January 05, 2012, 04:25:02 pm »
Wait isnt it supposed to be done in GLSL if opengl and this other for Directx? Why does SFML have a shader class..

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
SFML Special effects and stuff?
« Reply #3 on: January 05, 2012, 04:27:47 pm »
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.

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Special effects and stuff?
« Reply #4 on: January 05, 2012, 10:44:20 pm »
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?

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
SFML Special effects and stuff?
« Reply #5 on: January 06, 2012, 12:31:36 am »
http://www.sfml-dev.org/tutorials/1.6/window-events.php

In SFML2, use PollEvent instead of GetEvent.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
SFML Special effects and stuff?
« Reply #6 on: January 06, 2012, 11:45:24 am »
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).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: