summaryrefslogtreecommitdiff
path: root/engine/texture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engine/texture.cpp')
-rw-r--r--engine/texture.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/engine/texture.cpp b/engine/texture.cpp
index ca9d8e7..c3575f2 100644
--- a/engine/texture.cpp
+++ b/engine/texture.cpp
@@ -1,10 +1,4 @@
-#ifndef __APPLE__
-#include <GL/gl.h>
-#include <GL/glut.h>
-#else
-#include <OpenGL/gl.h>
-#include <GLUT/glut.h>
-#endif
+#include <SDL/SDL_opengl.h>
#include <stdexcept>
#include "texture.h"
#include <stdio.h>
@@ -21,9 +15,5 @@ void Texture::build() {
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);
- }
+ gluBuild2DMipmaps(GL_TEXTURE_2D, 4, width, height, format, GL_UNSIGNED_BYTE, data);
}