summaryrefslogtreecommitdiff
path: root/texture.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-05-21 19:24:51 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-05-21 19:24:51 +0200
commit267bebfc227c94f543a39e2aa75fb101bc06932e (patch)
tree40ad8057634ba80aa19c61f57884982fd59f6b56 /texture.cpp
parent88b1e9e505dad78fd2c3ff927495d322b11491ca (diff)
Moved engine-sources to seperate subdirectory.
Diffstat (limited to 'texture.cpp')
-rw-r--r--texture.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/texture.cpp b/texture.cpp
deleted file mode 100644
index ca9d8e7..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"
-#include <stdio.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_NEAREST);
- if(byte_per_pixel == 4) {
- gluBuild2DMipmaps(GL_TEXTURE_2D, 4, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- } else if(byte_per_pixel == 3) {
- gluBuild2DMipmaps(GL_TEXTURE_2D, 3, width, height, GL_RGB, GL_UNSIGNED_BYTE, data);
- }
-}