| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2006 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 00019 #ifndef VRS_GL2_EXTSHADER_UBERSHADERPROGRAMOBJECT_H 00020 #define VRS_GL2_EXTSHADER_UBERSHADERPROGRAMOBJECT_H 00021 00022 // 00023 // VRS 00024 // 00025 #include <vrs/monoattribute.h> 00026 #include <vrs/container/dictionary.h> 00027 #include <vrs/opengl/gl2/programobject.h> 00028 00029 // 00030 // EXTSHADER 00031 // 00032 #include <vrs/opengl/gl2/us/shaderhandler.h> 00033 #include <vrs/opengl/gl2/us/handlerobject.h> 00034 00035 00036 namespace VRS 00037 { 00038 namespace GL2 00039 { 00040 namespace EXTSHADER 00041 { 00042 class VRS_US_API UberShaderProgramObject: public MonoAttribute 00043 { 00044 public: 00045 00046 UberShaderProgramObject(const std::string& programName, 00047 unsigned int programPriority); 00048 00049 ~UberShaderProgramObject(void); 00050 00051 bool attach(SO<HandlerObject> handlerObject); 00052 void detach(SO<HandlerObject> handlerObject); 00053 void detachAll(void); 00054 00055 inline const std::string& getProgramName(void) const 00056 { 00057 return this->programName_; 00058 } 00059 00060 inline unsigned int getProgramPriority(void) const 00061 { 00062 return this->programPriority_; 00063 } 00064 00065 inline SO<Iterator<SO<HandlerObject> > > getVertexHandlerObjects(void) const 00066 { 00067 return this->vertexHandlerObjects_->newIterator(); 00068 } 00069 00070 inline SO<Iterator<SO<HandlerObject> > > getFragmentHandlerObjects(void) const 00071 { 00072 return this->fragmentHandlerObjects_->newIterator(); 00073 } 00074 00075 inline HandlerID getProgramID(void) const 00076 { 00077 return this->programID_; 00078 } 00079 00080 VRS_TYPEINFO(UberShaderProgramObject, MonoAttribute); 00081 VRS_SERIALIZABLE(UberShaderProgramObject); 00082 00083 protected: 00084 00085 UberShaderProgramObject(void); 00086 00087 private: 00088 00089 std::string programName_; 00090 unsigned int programPriority_; 00091 HandlerID programID_; 00092 00093 SO<Array<SO<HandlerObject> > > vertexHandlerObjects_; 00094 SO<Array<SO<HandlerObject> > > fragmentHandlerObjects_; 00095 00096 };//endclass UberShaderProgramObject 00097 00098 };//endnamespace EXTSHADER 00099 00100 };//endnamespace GL2 00101 00102 };//endnamespace VRS 00103 00104 #endif // VRS_GL2_EXTSHADER_UBERSHADERPROGRAMOBJECT_H