1 // Copyright 2016-2016 the openage authors. See copying.md for legal info. 2 3 #include "gui_standalone_subtexture.h" 4 5 namespace openage { 6 namespace gui { 7 GuiStandaloneSubtexture(GLuint id,const QSize & size)8GuiStandaloneSubtexture::GuiStandaloneSubtexture(GLuint id, const QSize &size) 9 : 10 id(id), 11 size(size) { 12 } 13 ~GuiStandaloneSubtexture()14GuiStandaloneSubtexture::~GuiStandaloneSubtexture() { 15 glDeleteTextures(1, &this->id); 16 } 17 bind()18void GuiStandaloneSubtexture::bind() { 19 glBindTexture(GL_TEXTURE_2D, this->textureId()); 20 } 21 hasAlphaChannel() const22bool GuiStandaloneSubtexture::hasAlphaChannel() const { 23 // assume 32bit textures 24 return true; 25 } 26 hasMipmaps() const27bool GuiStandaloneSubtexture::hasMipmaps() const { 28 return false; 29 } 30 isAtlasTexture() const31bool GuiStandaloneSubtexture::isAtlasTexture() const { 32 return false; 33 } 34 textureId() const35int GuiStandaloneSubtexture::textureId() const { 36 return this->id; 37 } 38 textureSize() const39QSize GuiStandaloneSubtexture::textureSize() const { 40 return this->size; 41 } 42 43 }} // namespace openage::gui 44