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