TARGET_LINK_LIBRARIES(supertux2 ${PHYSFS_LIBRARY})
IF(HAVE_OPENGL)
TARGET_LINK_LIBRARIES(supertux2 ${OPENGL_LIBRARY})
+ TARGET_LINK_LIBRARIES(supertux2 GLEW)
ENDIF(HAVE_OPENGL)
IF(HAVE_LIBCURL)
TARGET_LINK_LIBRARIES(supertux2 ${CURL_LIBRARY})
"src/",
"/usr/include/AL/", # yuck
"."],
- CXXFLAGS=["-O2", "-g3",
+ CXXFLAGS=["-O0", "-g3",
"-ansi",
"-pedantic",
"-Wall",
self.env.ParseConfig("pkg-config --libs --cflags openal")
self.env.ParseConfig("pkg-config --libs --cflags vorbis vorbisfile ogg")
self.env.Append(LIBS=[self.libsquirrel, self.libbinreloc, self.libtinygettext, self.libfindlocale])
- self.env.Append(LIBS=["SDL_image", "curl", "GL", "physfs"])
+ self.env.Append(LIBS=["SDL_image", "curl", "GL", "GLEW", "physfs"])
# Create config.h
self.iconv_const = 0
} // namespace
-GLRenderer::GLRenderer()
- : desktop_width(-1),
- desktop_height(-1)
+GLRenderer::GLRenderer() :
+ desktop_width(-1),
+ desktop_height(-1)
{
Renderer::instance_ = this;
texture_manager = new TextureManager();
else
texture_manager->reload_textures();
+
+#ifndef GL_VERSION_ES_CM_1_0
+ GLenum err = glewInit();
+ if (GLEW_OK != err)
+ {
+ std::ostringstream out;
+ out << "GLRenderer: " << glewGetErrorString(err);
+ throw std::runtime_error(out.str());
+ }
+ log_info << "Using GLEW " << glewGetString(GLEW_VERSION) << std::endl;
+#endif
}
GLRenderer::~GLRenderer()
texture_width = next_power_of_two(image->w);
texture_height = next_power_of_two(image->h);
#else
- texture_width = image->w;
- texture_height = image->h;
+ if (GL_ARB_texture_non_power_of_two)
+ {
+ texture_width = image->w;
+ texture_height = image->h;
+ }
+ else
+ {
+ texture_width = next_power_of_two(image->w);
+ texture_height = next_power_of_two(image->h);
+ }
#endif
image_width = image->w;
#include <sstream>
#include <stdexcept>
+#ifndef GL_VERSION_ES_CM_1_0
+# include <GL/glew.h>
+#endif
+
#if defined(MACOSX)
# include <OpenGL/gl.h>
# include <OpenGL/glext.h>