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

Author Topic: Filter class  (Read 8882 times)

0 Members and 1 Guest are viewing this topic.

Nothingness0x

  • Sr. Member
  • ****
  • Posts: 292
    • View Profile
Filter class
« on: December 28, 2009, 02:48:13 pm »
Hey,

I just have posted a new class on the english wiki to apply color or brightness filter to your windows. Handy to create a transition during a zone changement for example :

http://www.sfml-dev.org/wiki/en/sources/filter

Tell me what you think about it  :wink:

Julien_v42

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • http://tinyrpgsim.wordpress.com
Filter class
« Reply #1 on: January 05, 2010, 07:23:56 pm »
Well, it seems really overkill to use a 800x600 picture, which will need to be loaded from disk into RAM then into VRAM, just to display a fullscreen color. Not to mention it is not portable from a resolution to another (ie if you resize the window to 1024x768, part of your picture won't mask the window).

You could easily achieve the same effect with a 1 pixel picture (stretching your image) or without a picture with a simple quad (using OpenGL, or maybe a SFML Shape).
Working on TinyRPGSim

Nothingness0x

  • Sr. Member
  • ****
  • Posts: 292
    • View Profile
Filter class
« Reply #2 on: January 10, 2010, 05:55:52 am »
well, i didn't impose to use a 800x600 picture, it would work for any image, if you don't wanna use an image of the dimension of your resolution then you can (like you said) rezise it, it won't change how the class works.  :wink:

Julien_v42

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • http://tinyrpgsim.wordpress.com
Filter class
« Reply #3 on: January 10, 2010, 10:35:21 am »
You don't impose anything for sure. But to make the effect work fullscreen, any user would have to supply a fullscreen image. I'd suggest a stretch parameter, allowing any size of image as in the original version (could be used for watermark effect for instance), but also a small image stretched, as I was proposing above.
Working on TinyRPGSim