source: GTP/trunk/App/Demos/Illum/Shark3D/version164x12u/IllumDemo/src/gtp_shader/eng_shader_special_worldmat.h @ 2196

Revision 2196, 5.5 KB checked in by szirmay, 17 years ago (diff)
Line 
1///////////////////////////////////////////////////////////////////////////////
2//
3//      ##  ######
4//       ######  ###
5//  ## ###############        Shark 3D Engine (www.shark3d.com)
6//   ########## # # #
7//    ########                Copyright (c) 1996-2006 Spinor GmbH.
8//   ######### # # #          All rights reserved.
9//  ##   ##########
10//      ##
11//
12///////////////////////////////////////////////////////////////////////////////
13
14//@cpp
15
16#ifndef GTP_SHADER_WORLDMAT_H
17#define GTP_SHADER_WORLDMAT_H
18
19#include "../../interf/eng_shader.h"
20#include "../../interf/eng_shaderenv.h"
21#include "../../interf/eng_pos.h"
22#include "../../../comp/core/comp_setup.h"
23#include "../../../comp/util/comp_util_uniquebase.h"
24
25///////////////////////////////////////////////////////////////////////////////
26
27class s3d_CEngShaderSpecialWorldMatGfx;
28
29//@
30typedef s3d_CUtilKeyEntry<s3d_CEngGfxCtxPtr, s3d_CEngShaderSpecialWorldMatGfx*>
31        s3d_CEngShaderSpecialWorldMatGfxEntry;
32
33//@
34typedef s3d_CUtilTree<s3d_CEngShaderSpecialWorldMatGfxEntry>
35        s3d_CEngShaderSpecialWorldMatGfxTree;
36
37///////////////////////////////////////////////////////////////////////////////
38
39struct s3d_CEngShaderSpecialWorldMatData: s3d_CUtilPtrBase
40{
41    s3d_CUtilStr m_Info;
42    s3d_CUtilAtomArray m_MethodArray;
43    s3d_CUtilStr m_WorldMatVarInfo;
44    s3d_CUtilAtomPtr m_WorldMatVarAtom;
45        bool m_Inverse;
46        bool m_Transpose;
47};
48
49typedef s3d_CUtilPtr<s3d_CEngShaderSpecialWorldMatData>
50        s3d_CEngShaderSpecialWorldMatDataPtr;
51
52///////////////////////////////////////////////////////////////////////////////
53
54//@
55class s3d_CEngShaderSpecialWorldMat
56    : public s3d_CEngShader,
57    public s3d_CCompUtilUniqueBase,
58    public s3d_CCompSetup
59{
60public:
61    S3D_UTIL_RTTI_TABLE_DECLARE
62
63    //@
64    s3d_CEngShaderSpecialWorldMat();
65
66    //@
67    void SetupInit(
68            s3d_CUtilMsgHandler *MsgHandler, s3d_CUtilStr_cr Info,
69            s3d_CCompSuppl *FetchSuppl, s3d_CUtilSnkChunk *Param);
70
71    //@
72    void SetupDone();
73
74    //@
75    s3d_CUtilStr GetInfo();
76
77    //@
78    void RegisterNotif(s3d_CUtilNotifRecip *Recip);
79
80    //@
81    s3d_CEngShaderGfxPtr FindShaderGfx(
82            s3d_CUtilNotifGather *NotifGather, s3d_CEngGfxCtx *GfxCtx);
83
84private:
85    s3d_CEngShaderEnvPtr m_ShaderEnv;
86    s3d_CEngShaderSpecialWorldMatGfxTree m_ShaderGfxTree;
87    s3d_CEngShaderSpecialWorldMatDataPtr m_Data;
88};
89
90//@
91typedef s3d_CUtilPtr<s3d_CEngShaderSpecialWorldMat>
92        s3d_CEngShaderSpecialWorldMatPtr;
93
94///////////////////////////////////////////////////////////////////////////////
95
96//@
97class s3d_CEngShaderSpecialWorldMatGfx: public s3d_CEngShaderGfx
98{
99public:
100    //@
101    s3d_CEngShaderSpecialWorldMatGfx(
102            s3d_CEngShaderEnv *ShaderEnv, s3d_CEngGfxCtx *GfxCtx,
103            s3d_CEngShaderSpecialWorldMatData *Data);
104
105    //@
106    s3d_CEngShaderSpecialWorldMatGfxTree::CNode *GetNode();
107
108    //@
109    void RegisterNotif(s3d_CUtilNotifRecip *Recip);
110
111    //@
112    void ExtractGfx();
113
114    //@
115    bool IsValid();
116
117    //@
118    void LinkCollect(s3d_CUtilAtomSet &VarAtomSet);
119
120    //@
121    void LinkAppoint(s3d_CDrvVarDecl *VarDecl);
122
123    //@
124    s3d_CEngShaderInstPtr CreateShaderInst(
125            s3d_CEngShaderHead *Head);
126
127private:
128    s3d_CEngShaderSpecialWorldMatGfxTree::CNode m_Node;
129    s3d_CEngShaderEnvPtr m_ShaderEnv;
130    s3d_CEngShaderSpecialWorldMatDataPtr m_Data;
131
132    // ShaderGfx-Data Variables:
133    s3d_CDrvVarSlotInit m_WorldMatVarSlot;
134
135    friend class s3d_CEngShaderSpecialWorldMatInst;
136};
137
138//@
139typedef s3d_CUtilPtr<s3d_CEngShaderSpecialWorldMatGfx>
140        s3d_CEngShaderSpecialWorldMatGfxPtr;
141
142///////////////////////////////////////////////////////////////////////////////
143
144//@
145class s3d_CEngShaderSpecialWorldMatInst
146    : public s3d_CEngShaderInst,
147    public s3d_CEngShaderExec
148{
149public:
150    //@
151    s3d_CEngShaderSpecialWorldMatInst(
152            s3d_CEngShaderEnv *ShaderEnv,
153            s3d_CEngShaderSpecialWorldMatGfx *ShaderGfx);
154
155    //@
156    void RegisterNotif(s3d_CUtilNotifRecip *Recip);
157
158    //@
159    void SetShaderCtx(s3d_CEngShaderCtx *ShaderCtx);
160
161    //@
162    void SetGfxState(s3d_CEngGfxState *GfxState);
163
164    //@
165    void SetPos(s3d_CEngPos *Pos);
166
167    //@
168    void SetModel(s3d_CEngModel *Model);
169
170    //@
171    void ArrangeCollect(
172            s3d_CUtilMemPool *MemPool,
173            s3d_CEngShaderScopeArray &ScopeArray);
174
175    //@
176    void ArrangeInit(
177            s3d_CUtilMemPool *MemPool,
178            s3d_CEngShaderScopeArray_cr ScopeArray);
179
180    //@
181    void ArrangePerform(
182            s3d_CUtilMemPool *MemPool,
183            s3d_CEngShaderScopeArray_cr ScopeArray);
184
185    //@
186    void ArrangeFeedback(
187            s3d_CUtilMemPool *MemPool,
188            s3d_CEngShaderScopeArray_cr ScopeArray);
189
190    //@
191    void ArrangeGather(
192            s3d_CEngShaderExecArray &ExecArray);
193
194    //@
195    void ShaderExecPerform(
196            s3d_CEngShaderScope *Scope,
197            s3d_CUtilAtom *Method,
198            s3d_CEngGfxTaskArray &TaskArray);
199
200private:
201    s3d_CEngShaderEnvPtr m_ShaderEnv;
202    s3d_CEngShaderSpecialWorldMatGfxPtr m_ShaderGfx;
203    s3d_CEngPosPtr m_Pos;
204
205    void SetVars(
206            s3d_CUtilMemPool *MemPool, s3d_CEngShaderScope *Scope);
207};
208
209//@
210typedef s3d_CUtilPtr<s3d_CEngShaderSpecialWorldMatInst>
211        s3d_CEngShaderSpecialWorldMatInstPtr;
212
213///////////////////////////////////////////////////////////////////////////////
214
215#endif
Note: See TracBrowser for help on using the repository browser.