1*bee3c7a9SAlexandre Deckner /* 2*bee3c7a9SAlexandre Deckner * Copyright 2008, Haiku Inc. All rights reserved. 3*bee3c7a9SAlexandre Deckner * Distributed under the terms of the MIT License. 4*bee3c7a9SAlexandre Deckner * 5*bee3c7a9SAlexandre Deckner * Authors: 6*bee3c7a9SAlexandre Deckner * Alexandre Deckner <alex@zappotek.com> 7*bee3c7a9SAlexandre Deckner */ 8*bee3c7a9SAlexandre Deckner 9*bee3c7a9SAlexandre Deckner #include "Texture.h" 10*bee3c7a9SAlexandre Deckner 11*bee3c7a9SAlexandre Deckner #include <opengl/GL/gl.h> 12*bee3c7a9SAlexandre Deckner 13*bee3c7a9SAlexandre Deckner 14*bee3c7a9SAlexandre Deckner Texture::Texture() 15*bee3c7a9SAlexandre Deckner : 16*bee3c7a9SAlexandre Deckner fId(0) 17*bee3c7a9SAlexandre Deckner { 18*bee3c7a9SAlexandre Deckner } 19*bee3c7a9SAlexandre Deckner 20*bee3c7a9SAlexandre Deckner 21*bee3c7a9SAlexandre Deckner Texture::~Texture() 22*bee3c7a9SAlexandre Deckner { 23*bee3c7a9SAlexandre Deckner if (glIsTexture(fId)) { 24*bee3c7a9SAlexandre Deckner GLuint ids[1] = {fId}; 25*bee3c7a9SAlexandre Deckner glDeleteTextures(1, ids); 26*bee3c7a9SAlexandre Deckner } 27*bee3c7a9SAlexandre Deckner } 28*bee3c7a9SAlexandre Deckner 29*bee3c7a9SAlexandre Deckner 30*bee3c7a9SAlexandre Deckner GLuint 31*bee3c7a9SAlexandre Deckner Texture::Id() 32*bee3c7a9SAlexandre Deckner { 33*bee3c7a9SAlexandre Deckner return fId; 34*bee3c7a9SAlexandre Deckner } 35