2 This file is part of the 3dengfx demo system.
4 Copyright (c) 2004, 2005 John Tsiombikas <nuclear@siggraph.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "n3dmath2/n3dmath2.hpp"
24 #include "gfx/color.hpp"
25 #include "3dengfx/3denginefx_types.hpp"
31 enum {BLUR_DIR_X, BLUR_DIR_Y};
34 void radial_blur(Texture *tex, float ammount, const Vector2 &origin = Vector2(0.5f, 0.5f), bool additive = false);
35 void dir_blur(Texture *tex, float ammount, int dir);
36 //void blur(Texture *tex, float ammount, bool additive = false);
37 void overlay(Texture *tex, const Vector2 &corner1, const Vector2 &corner2, const Color &color, GfxProg *pprog=0, bool handle_blending = true);
38 void negative(const Vector2 &corner1 = Vector2(0,0), const Vector2 &corner2 = Vector2(1,1));
39 void flash(unsigned long time, unsigned long when, unsigned long dur, const Color &col = Color(1,1,1));
41 // integration with the scripting system
45 void add_image_fx(ImageFx *fx);
46 void remove_image_fx(ImageFx *fx);
47 void apply_image_fx(unsigned long time);
51 unsigned long time, duration;
56 virtual bool parse_script_args(const char **args);
58 virtual void set_time(unsigned long time);
59 virtual void set_duration(unsigned long dur);
61 virtual void apply(unsigned long time) = 0;
64 class FxNegative : public ImageFx {
66 virtual ~FxNegative();
67 virtual void apply(unsigned long time);
70 class FxFlash : public ImageFx {
77 virtual bool parse_script_args(const char **args);
79 virtual void set_color(const Color &col);
80 virtual void apply(unsigned long time);
83 class FxFade : public ImageFx {
91 virtual bool parse_script_args(const char **args);
93 virtual void apply(unsigned long time);
96 class FxOverlay : public ImageFx {
103 virtual ~FxOverlay();
104 virtual bool parse_script_args(const char **args);
106 virtual void set_texture(Texture *tex);
107 virtual void set_shader(GfxProg *sdr);
108 virtual void apply(unsigned long time);