| 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: programobject.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00019 // 00020 // $Log$ 00021 // Revision 1.5 2006/05/19 09:31:28 baumann 00022 // missing include added 00023 // 00024 // Revision 1.4 2006/05/17 13:04:09 baumann 00025 // code cleanup 00026 // 00027 // Revision 1.3 2005/01/03 01:43:10 klimetschek 00028 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00029 // - removed vrs.vcproj 00030 // minor things: 00031 // - added all glutexamples to vrs4glut.sln 00032 // - fixed some problems in glutexamples 00033 // - removed all project references from all VS projects (using solution wide project dependencies instead) 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_PROGRAMOBJECT_H 00044 #define VRS_GL2_PROGRAMOBJECT_H 00045 00046 #include <vrs/monoattribute.h> 00047 #include <vrs/opengl/gl2/shaderobject.h> 00048 #include <vrs/opengl/gl2/variablesmapping.h> 00049 #include <vector> 00050 #include <set> 00051 00052 namespace VRS { 00053 namespace GL2 { 00054 00055 class VariablesMapping; 00056 00061 class VRS_CORE_API ProgramObject : public MonoAttribute { 00062 public: 00063 VRS_TYPEINFO(ProgramObject, MonoAttribute); 00064 VRS_SERIALIZABLE(ProgramObject); 00065 00066 ProgramObject(); 00074 bool operator==(const ProgramObject& other) const; 00075 00076 virtual bool attach(SO<ShaderObject> shader); 00077 virtual bool detach(SO<ShaderObject> shader); 00079 00080 virtual SO<Iterator<SO<ShaderObject> > > attachedShaders() const; 00082 00083 enum VariablesType { Uniforms, Attributes }; // enum VariablesType 00084 virtual SO<VariablesMapping> mapping(VariablesType variablesType) const; 00090 virtual SO<Iterator<std::string> > querySamplerNames() const; 00091 00092 virtual bool isActive() const; 00093 virtual void activate(bool s); 00095 00096 virtual TransactionNo getLastUpdate() const; 00097 virtual void setLastUpdate(TransactionNo last); 00099 00100 private: 00101 SO<HashTable<SO<ShaderObject> > > shaders_; 00102 SO<VariablesMapping> uniformsMapping_; 00103 SO<VariablesMapping> attributesMapping_; 00104 TransactionNo lastUpdate_; 00105 bool isActive_; 00106 }; // class ProgramObject 00107 00108 } // namespace GL2 00109 } // namespace VRS 00110 00111 #endif // VRS_GL2_PROGRAMOBJECT_H