diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-06-13 18:47:00 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-06-13 18:47:00 +0200 |
commit | c91de71d69265a0d619b25d0c04ae1adb0785f33 (patch) | |
tree | 83176a79b8ed2d83f962758972e5a37a69d8259d /texture.cpp | |
parent | a6417af853180b5568c7f96c903057dd2c454204 (diff) |
Diffstat (limited to 'texture.cpp')
-rwxr-xr-x | texture.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/texture.cpp b/texture.cpp deleted file mode 100755 index 1678a97..0000000 --- a/texture.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __APPLE__ -#include <GL/gl.h> -#include <GL/glut.h> -#else -#include <OpenGL/gl.h> -#include <GLUT/glut.h> -#endif -#include <stdexcept> -#include "texture.h" - -unsigned int Texture::tex() { - return texture; -} - -void Texture::build() { - if(!data) { - throw(std::runtime_error("No texture data")); - } - glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_2D, texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST); - //glTexImage2D(GL_TEXTURE_2D, 0, 4, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); - if(byte_per_pixel == 4) { - gluBuild2DMipmaps(GL_TEXTURE_2D, 4, width, height, GL_BGRA, GL_UNSIGNED_BYTE, data); - } else if(byte_per_pixel == 3) { - gluBuild2DMipmaps(GL_TEXTURE_2D, 3, width, height, GL_BGR, GL_UNSIGNED_BYTE, data); - } -} |