| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2002 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: texenvcombinegl.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00019 // $Date: 2007-08-09 09:51:16 +0200 (Thu, 09 Aug 2007) $ 00020 // $Revision: 6014 $ 00021 // $State$ 00022 // $Author: Konstantin_Baumann $ 00023 // 00024 // $Log$ 00025 // Revision 1.12 2005/06/15 16:30:02 baumann 00026 // added methods SharedObj::isEqual() and SharedObj::IsEqual() (define operator==() in derived classes for a real implementaton) 00027 // 00028 // Revision 1.11 2005/01/03 01:43:09 klimetschek 00029 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00030 // - removed vrs.vcproj 00031 // minor things: 00032 // - added all glutexamples to vrs4glut.sln 00033 // - fixed some problems in glutexamples 00034 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00035 // 00036 // Revision 1.10 2004/11/03 14:45:07 saar 00037 // Class comment changed (Doxygen style) 00038 // 00039 // Revision 1.9 2004/03/12 16:28:41 baumann 00040 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00041 // 00042 // Revision 1.8 2004/01/19 11:43:58 baumann 00043 // serialization mechanism improved 00044 // 00045 // Revision 1.7 2004/01/19 07:28:03 baumann 00046 // serialization mechanism improved 00047 // 00048 // Revision 1.6 2003/11/07 14:19:25 kirsch 00049 // removed leading underscore from include guards 00050 // 00051 // Revision 1.5 2003/07/23 17:04:49 baumann 00052 // code cleanup (especially untabified) 00053 // 00054 // Revision 1.4 2002/11/07 08:58:54 baumann 00055 // set default value of lodBias is 0.0 not 1.0 00056 // 00057 // Revision 1.3 2002/09/29 08:19:21 baumann 00058 // comments added 00059 // 00060 // Revision 1.2 2002/09/28 22:33:49 baumann 00061 // TYPEINFO bug fixed 00062 // 00063 // Revision 1.1 2002/09/28 09:13:37 baumann 00064 // - new class added: TexEnvCombineGL 00065 // - some functionality of class TexEnvGL moved to new class TexEnvCombineGL 00066 // 00067 00068 #ifndef VRS_OPENGL_TEXENVCOMBINEGL_H_ 00069 #define VRS_OPENGL_TEXENVCOMBINEGL_H_ 00070 00071 #include <vrs/opengl/openglconfig.h> 00072 #include <vrs/opengl/texenvgl.h> 00073 00074 namespace VRS {; 00075 00077 class VRS_CORE_API TexEnvCombineGL : public TexEnvGL { 00078 public: 00079 enum CombineMode { 00080 REPLACE, // GL_ARB_texture_env_combine: arg0 00081 MODULATE, // GL_ARB_texture_env_combine: arg0 * arg1 00082 ADD, // GL_ARB_texture_env_combine: arg0 + arg1 00083 ADD_SIGNED, // GL_ARB_texture_env_combine: arg0 + arg1 - 0.5 00084 SUBTRACT, // GL_ARB_texture_env_combine: arg0 - arg1 00085 INTERPOLATE, // GL_ARB_texture_env_combine: arg0 * arg2 + arg1 * (1-arg2) 00086 DOT3_RGB, // GL_ARB_texture_env_dot3: arg0 dot arg1 (only RGB part) 00087 DOT3_RGBA, // GL_ARB_texture_env_dot3: arg0 dot arg1 (combineAlpha will be ignored) 00088 MULTIPLY_AND_ADD, // GL_NV_texture_env_combine4: arg0 * arg1 + arg2 * arg3 00089 MULTIPLY_AND_ADD_SIGNED // GL_NV_texture_env_combine4: arg0 * arg1 + arg2 * arg3 - 0.5 00090 }; 00091 VRS_SERIALIZABLE_CLASS_ENUM(CombineMode); 00092 00093 TexEnvCombineGL(CombineMode combineRGB = TexEnvCombineGL::REPLACE, CombineMode combineAlpha = TexEnvCombineGL::REPLACE, 00094 GLenum source0RGB = GL_TEXTURE, GLenum source0Alpha = GL_TEXTURE, 00095 GLenum operand0RGB = GL_SRC_COLOR, GLenum operand0Alpha = GL_SRC_ALPHA, 00096 GLenum source1RGB = GL_ZERO, GLenum source1Alpha = GL_ZERO, 00097 GLenum operand1RGB = GL_ZERO, GLenum operand1Alpha = GL_ZERO, 00098 GLenum source2RGB = GL_ZERO, GLenum source2Alpha = GL_ZERO, 00099 GLenum operand2RGB = GL_ZERO, GLenum operand2Alpha = GL_ZERO, 00100 GLenum source3RGB = GL_ZERO, GLenum source3Alpha = GL_ZERO, 00101 GLenum operand3RGB = GL_ZERO, GLenum operand3Alpha = GL_ZERO, 00102 GLint scaleRGB = 1, GLint scaleAlpha = 1, 00103 const Color& textureEnvColor = Color::black, 00104 double lodBias = 0.0); 00105 00106 bool operator==(const TexEnvCombineGL& other) const; 00107 00108 CombineMode getCombineRGB() const; 00109 CombineMode getCombineAlpha() const; 00110 00111 GLenum getSourceRGB(unsigned int index) const; 00112 GLenum getSourceAlpha(unsigned int index) const; 00113 00114 GLenum getOperandRGB(unsigned int index) const; 00115 GLenum getOperandAlpha(unsigned int index) const; 00116 00117 GLint getScaleRGB() const; 00118 GLint getScaleAlpha() const; 00119 00120 void setCombineRGB(CombineMode combineRGB); 00121 void setCombineAlpha(CombineMode combineAlpha); 00122 00123 void setSourceRGB(unsigned int index, GLenum sourceRGB); 00124 void setSourceAlpha(unsigned int index, GLenum sourceAlpha); 00125 00126 void setOperandRGB(unsigned int index, GLenum operandRGB); 00127 void setOperandAlpha(unsigned int index, GLenum operandAlpha); 00128 00129 void setScaleRGB(GLint scaleRGB); 00130 void setScaleAlpha(GLint scaleAlpha); 00131 00132 VRS_TYPEINFO(TexEnvCombineGL, TexEnvGL); 00133 VRS_SERIALIZABLE(TexEnvCombineGL); 00134 00135 private: 00136 CombineMode combineRGB_, combineAlpha_; 00137 GLint scaleRGB_, scaleAlpha_; 00138 GLenum sourceRGB_[4], sourceAlpha_[4]; 00139 GLenum operandRGB_[4], operandAlpha_[4]; 00140 }; 00141 00142 } // namespace VRS 00143 00144 #endif // VRS_OPENGL_TEXENVCOMBINEGL_H_