| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2004 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: variablesmapping.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00019 // 00020 // $Log$ 00021 // Revision 1.5 2006/05/17 13:04:09 baumann 00022 // code cleanup 00023 // 00024 // Revision 1.4 2005/01/03 01:43:10 klimetschek 00025 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00026 // - removed vrs.vcproj 00027 // minor things: 00028 // - added all glutexamples to vrs4glut.sln 00029 // - fixed some problems in glutexamples 00030 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00031 // 00032 // Revision 1.3 2004/11/09 15:06:27 kirsch 00033 // further changes to class comments due to doxygen 00034 // 00035 // Revision 1.2 2004/11/03 14:45:07 saar 00036 // Class comment changed (Doxygen style) 00037 // 00038 // Revision 1.1 2004/10/06 09:49:14 nienhaus 00039 // support for the OpenGL shading language 00040 // (on behalf of kosta) 00041 // 00042 00043 #ifndef VRS_GL2_VARIABLESMAPPING_H 00044 #define VRS_GL2_VARIABLESMAPPING_H 00045 00046 #include <vrs/sharedobj.h> 00047 #include <vrs/opengl/enginegl.h> 00048 #include <vector> 00049 00050 namespace VRS { 00051 namespace GL2 { 00052 00060 class VRS_CORE_API VariablesMapping : public SharedObj { 00061 public: 00062 VariablesMapping(); 00066 int location(const std::string& variableName) const; 00070 GLenum type(const std::string& variableName) const; 00073 std::string variable(int variableLocation) const; // "" for invalid variableIndex 00075 00076 int count(const std::string& variableName) const; // -1 for invalid variableName 00077 int count(int variableLocation) const; // -1 for invalid variableLocation 00079 00080 SO<Iterator<std::string> > samplers() const; 00082 00083 struct Mapping { 00084 int location_; 00085 std::string name_; 00086 int count_; 00087 GLenum type_; 00088 }; // struct Mapping 00090 void add(int location, const std::string& name, int count, GLenum type); 00091 bool remove(const std::string& name); 00092 bool clear(); 00094 00095 VRS_TYPEINFO(VariablesMapping, SharedObj); 00096 00097 private: 00098 std::vector<Mapping> mappings_; 00099 }; // class VariablesMapping 00100 00101 } // namespace GL2 00102 } // namespace VRS 00103 00104 #endif // VRS_GL2_VARIABLESMAPPING_H