GLArch.h

Go to the documentation of this file.
00001 /* $Id: GLArch.h,v 1.4 2002/12/05 15:05:47 cvs Exp $ */
00002 
00003 #ifndef __GL_ARCH_H
00004 #define __GL_ARCH_H
00005 
00006 #include <gra/arch/Architecture.h>
00007 #include <gra/render/Render.h>
00008 #include <gra/render/GLRender.h>
00009 #include <gra/render/GLBVRender.h>
00010 #include <gra/shader/GLShader.h>
00011 #include <gra/camera/CameraGL.h>
00012 
00013 using namespace esg;
00014 
00015 namespace gra {
00016 
00022 class GRA_EXPORT GLArch : public Architecture {
00023 protected:
00024         GLShader::MeshMode    _meshMode;
00025         GLShader::ShadingMode _shadingMode;
00026         GLShader::FacetMode   _facetMode;
00027         bool                  _useDisplayList;
00028         int                   _meshDensity;
00029 
00030 public:
00031         struct Params : public Architecture::Params {
00032                 GLShader::MeshMode    meshMode;     
00033                 GLShader::ShadingMode shadingMode;  
00034                 GLShader::FacetMode   facetMode;    
00035                 bool                  displayLists; 
00036                 int                   meshDensity;  
00037 
00038                 Params()
00039                     : meshMode(GLShader::FACETS),
00040                       shadingMode(GLShader::SMOOTH),
00041                       facetMode(GLShader::AUTO),
00042                       displayLists(true),
00043                       meshDensity(1) {}
00044         };
00045 
00046     
00047 public:
00053         GLArch (GLArch::Params& params) : Architecture(params) {
00054             _meshMode       = params.meshMode;
00055             _shadingMode    = params.shadingMode;
00056             _facetMode      = params.facetMode;
00057             _useDisplayList = params.displayLists;
00058             _meshDensity    = params.meshDensity;
00059         }
00060         
00064         virtual Render* createRender (void) {
00065             return new GLRender(_pStopFlag, _useDisplayList);
00066         }
00067 
00071         virtual Shader* createShader (void) {
00072             return new GLShader(_meshMode,
00073                                 _shadingMode,
00074                                 _meshDensity,
00075                                 _facetMode);
00076         }
00077 
00081         void setMeshMode(GLShader::MeshMode m) { _meshMode = m; }
00082         
00086         void setShadingMode(GLShader::ShadingMode m) { _shadingMode = m; }
00087         
00091         void setFacetMode(GLShader::FacetMode m) { _facetMode = m; }
00092 
00096         GLShader::MeshMode getMeshMode() const { return _meshMode; }
00097         
00101         GLShader::ShadingMode getShadingMode() const { return _shadingMode; }
00102         
00106         GLShader::FacetMode getFacetMode() const { return _facetMode; }
00107 };
00108     
00109 } // namespace
00110 
00111 #endif // __GL_ARCH_H

Generated on Tue Nov 21 15:11:42 2006 for gra by  doxygen 1.4.6