1 //////////////////////////////////////////////////////////////////////////////// 2 // Scorched3D (c) 2000-2011 3 // 4 // This file is part of Scorched3D. 5 // 6 // Scorched3D is free software; you can redistribute it and/or modify 7 // it under the terms of the GNU General Public License as published by 8 // the Free Software Foundation; either version 2 of the License, or 9 // (at your option) any later version. 10 // 11 // Scorched3D is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License along 17 // with this program; if not, write to the Free Software Foundation, Inc., 18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 //////////////////////////////////////////////////////////////////////////////// 20 21 #include <common/Defines.h> 22 #include <GLEXT/GLTextureSet.h> 23 GLTextureSet()24GLTextureSet::GLTextureSet() 25 { 26 } 27 ~GLTextureSet()28GLTextureSet::~GLTextureSet() 29 { 30 while (!textures_.empty()) 31 { 32 GLTexture *texture = textures_.back(); 33 delete texture; 34 textures_.pop_back(); 35 } 36 } 37 getNoTextures()38int GLTextureSet::getNoTextures() 39 { 40 return (int) textures_.size(); 41 } 42 getTexture(int index)43GLTexture *GLTextureSet::getTexture(int index) 44 { 45 DIALOG_ASSERT(index >= 0 && index < getNoTextures()); 46 47 return textures_[index]; 48 } 49 addTexture(GLTexture * texture)50void GLTextureSet::addTexture(GLTexture *texture) 51 { 52 textures_.push_back(texture); 53 } 54