00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __SGL_LAYER_HPP
00027 #define __SGL_LAYER_HPP
00028
00029 #include <sgl.h>
00030 #include <sglGroup.hpp>
00031
00032
00033 class sglStencilLayerBegin;
00034 class sglStencilLayerMiddle;
00035 class sglStencilLayerEnd;
00036 class sglDepthMask;
00037 class sglDepthTest;
00038 class sglColorMask;
00039
00040
00041
00097 class SGL_DLL_API sglLayer : public sglGroup
00098 {
00099 public:
00101 enum LayerMethodEnum
00102 {
00104 eMULTIPASS,
00106 eSTENCIL
00107 };
00108
00109 public:
00114 sglLayer(LayerMethodEnum method = eMULTIPASS);
00116 virtual ~sglLayer();
00117
00121 void setMethod(LayerMethodEnum method);
00122
00126 LayerMethodEnum getMethod() const { return m_method; }
00127
00132 void setStencilMask(GLuint mask);
00133
00137 GLuint getStencilMask() { return m_stencil_mask; }
00138
00139
00140 virtual sglNode *clone(unsigned int mode) const;
00141
00142
00143 virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00144
00145 protected:
00146
00147 virtual void cull(sglCull<float> &trav_state,
00148 unsigned int cull_flags) const;
00149
00150
00151 virtual void cull(sglCull<double> &trav_state,
00152 unsigned int cull_flags) const;
00153
00154 void copyTo(sglLayer *dst, unsigned int mode) const;
00155
00156 private:
00157 sglLayer(const sglLayer &);
00158 sglLayer &operator=(const sglLayer &);
00159
00160 private:
00161 LayerMethodEnum m_method;
00162 GLuint m_stencil_mask;
00163
00164 sglStencilLayerBegin *m_stencil_begin;
00165 sglStencilLayerMiddle *m_stencil_middle;
00166 sglStencilLayerEnd *m_stencil_end;
00167
00168 static sglDepthMask *s_depth_mask;
00169 static sglDepthTest *s_depth_test;
00170 static sglColorMask *s_color_mask;
00171 };
00172
00173 #endif