|
KGLLib
|
00001 /* 00002 * Copyright (C) 2008 Rivo Laks <rivolaks@hot.ee> 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef KGLLIB_MESH_H 00019 #define KGLLIB_MESH_H 00020 00021 #include "batch.h" 00022 00023 #include <QtCore/QVector> 00024 00025 00026 namespace KGLLib 00027 { 00028 class Texture; 00029 class Program; 00030 00039 class KGLLIB_EXPORT Mesh : public Batch 00040 { 00041 public: 00045 Mesh(); 00049 Mesh(GeometryBuffer* buffer, int offset, int indexOffset); 00050 virtual ~Mesh(); 00051 00052 virtual void bind(); 00053 virtual void unbind(); 00054 00058 void setTexture(KGLLib::Texture* tex) { setTexture(0, tex); } 00062 KGLLib::Texture* texture() const { return texture(0); } 00068 virtual void setTexture(int index, KGLLib::Texture* tex); 00072 KGLLib::Texture* texture(int index) const; 00073 00077 virtual void setProgram(KGLLib::Program* program); 00081 KGLLib::Program* program() const { return mProgram; } 00082 00083 protected: 00084 00085 private: 00086 QVector<KGLLib::Texture*> mTextures; 00087 KGLLib::Program* mProgram; 00088 }; 00089 00090 } 00091 00092 #endif
1.7.4