INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
glprogram.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2007-2009 Tom Burdick <thomas.burdick@gmail.com> 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDRO_GLU_GLPROGRAM_H 00012 #define HYDRO_GLU_GLPROGRAM_H 00013 00014 #include "glshader.h" 00015 #include "exceptions.h" 00016 00017 #include <string> 00018 #include <vector> 00019 00020 #include <IceUtil/Shared.h> 00021 #include <IceUtil/Handle.h> 00022 00023 namespace hydroglu 00024 { 00025 00031 class GLProgram : public virtual IceUtil::Shared 00032 { 00033 public: 00034 GLProgram(std::string name); 00035 ~GLProgram(); 00036 00037 GLuint handle() const; 00038 00039 void addShader(GLShaderPtr); 00040 void removeShader(GLShaderPtr); 00041 void link(); 00042 00043 void enable(); 00044 void disable(); 00045 00046 //1 var 00047 void setUniform(std::string uniformName, int value0); 00048 void setUniform(std::string uniformName, float value0); 00049 //2 vars 00050 void setUniform(std::string uniformName, int value0, int value1); 00051 void setUniform(std::string uniformName, float value0, float value1); 00052 //3 vars 00053 void setUniform(std::string uniformName, int value0, int value1, int value2); 00054 void setUniform(std::string uniformName, float value0, float value1, float value2); 00055 //4 vars 00056 void setUniform(std::string uniformName, int value0, int value1, int value2, int value3); 00057 void setUniform(std::string uniformName, float value0, float value1, float value2, float value3); 00058 00059 private: 00060 GLint getUniformLocation(std::string uniformName); 00061 std::vector<GLShaderPtr> shaders_; 00062 GLuint handle_; 00063 std::string name_; 00064 }; 00065 00066 typedef IceUtil::Handle<GLProgram> GLProgramPtr; 00067 00068 } // namespace 00069 00070 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)