changed copyright years in source files
[fegdk.git] / core / code / video / gl / f_effectpass.h
blobe0c749b8ff4cb276d3f6b7d5974753fa9627ccbd
1 /*
2 fegdk: FE Game Development Kit
3 Copyright (C) 2001-2008 Alexey "waker" Yakovenko
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 Alexey Yakovenko
20 waker@users.sourceforge.net
23 #ifndef __F_EFFECT_PASS
24 #define __F_EFFECT_PASS
26 #include "f_effect.h"
27 #include "f_shader.h"
28 #include <GL/glew.h>
30 namespace fe
33 class FE_API effectPass : public fragileObject
36 friend class effectTechnique;
37 friend class effect;
39 private:
41 GLint mListId;
43 struct redir_s
45 int reg;
46 int redir;
49 struct shader_redir_s
51 cStr parmname;
52 handle parm;
53 int redir;
56 redir_s mTexRedir[8];
57 int mNumTexRedirs;
59 struct shader_info_t
61 bool valid;
62 cStr type;
63 cStr entry;
64 cStr profile;
65 cStr name;
68 shader_info_t mVertProgInfo;
69 shader_info_t mFragProgInfo;
71 shaderPtr mpVertexProgram;
72 shaderPtr mpFragmentProgram;
74 shader_redir_s mVertRedir[256];
75 int mNumVertRedirs;
77 shader_redir_s mFragRedir[256];
78 int mNumFragRedirs;
80 redir_s mTransformRedir[11]; // world, view, proj, tex[8]
81 int mNumTransformRedirs;
83 int mPrimColorRedir;
84 bool mbNeedResolveDeps;
86 void loose (void);
87 void restore (void);
89 protected:
91 // rendering
92 void apply (effect &s, uint32 flags);
93 void finalize (void); // cancels post-effects of using programmable pipeline, etc
95 // parser
96 bool load (charParser &p, effect &s);
98 // parser helpers (transforms)
99 void readTransform (charParser &p, effect &s, GLenum t, int reg);
100 void readGlEnable (charParser &p, const GLenum cap);
101 GLenum readCmpFunc (charParser &p);
102 void readTSS (charParser &p, GLenum pname);
104 public:
106 // ctor & dtor
107 effectPass (void);
108 ~effectPass (void);
110 shaderPtr getVertProgram (void) const;
111 shaderPtr getFragProgram (void) const;
117 #endif // __F_EFFECT_PASS