Use glew instead of GLee.

Not sure if 1.5.4 is actually the minimal version we need.

Conflicts:

	configure.ac
	lib/ivis_common/tex.h
	lib/ivis_opengl/pieblitfunc.c
	lib/ivis_opengl/piefunc.c
	lib/ivis_opengl/piematrix.c
	lib/ivis_opengl/screen.c
master
cybersphinx 2010-12-28 00:48:56 -05:00 committed by Per Inge Mathisen
parent 3481d2e0f6
commit c80e14ca35
12 changed files with 63 additions and 77 deletions

View File

@ -340,7 +340,7 @@ AS_IF([test "x$enable_sound" = "xyes"],[
PKG_CHECK_MODULES([OPENGLC], [quesoglc >= 0.7.2])
PKG_CHECK_MODULES([GLee], [glee >= 5.4.0])
PKG_CHECK_MODULES([GLEW], [glew >= 1.5.4])
# Checks for libraries:

View File

@ -24,31 +24,6 @@
#ifndef __INCLUDED_LIB_FRAMEWORK_OPENGL_H__
#define __INCLUDED_LIB_FRAMEWORK_OPENGL_H__
#include "wzglobal.h"
#if defined(__glext_h_)
# define FRAMEWORK_GLEXT_INCLUDED
#else
// Prevent inclusion of glext.h by gl.h, requiring explicit inclusion by the user
# define __glext_h_
#endif
#if defined(WZ_OS_MAC)
# include <OpenGL/gl.h>
#else
# include <GL/gl.h>
#endif
// Restore the previous definition state of the __glext_h_ symbol
#if defined(FRAMEWORK_GLEXT_INCLUDED)
# undef FRAMEWORK_GLEXT_INCLUDED
#else
# undef __glext_h_
#endif
// Workaround X11 headers #defining Status
#ifdef Status
# undef Status
#endif
#include <GL/glew.h>
#endif

View File

@ -1,4 +1,4 @@
AM_CPPFLAGS = $(SDL_CFLAGS) $(PNG_CFLAGS) $(OPENGLC_CFLAGS) $(OPENGL_CFLAGS) $(WZ_CPPFLAGS) $(GLee_CFLAGS)
AM_CPPFLAGS = $(SDL_CFLAGS) $(PNG_CFLAGS) $(OPENGLC_CFLAGS) $(OPENGL_CFLAGS) $(WZ_CPPFLAGS) $(GLEW_CFLAGS)
AM_CFLAGS = $(WZ_CFLAGS) -Wno-missing-declarations
AM_CXXFLAGS = $(WZ_CXXFLAGS)

View File

@ -21,7 +21,7 @@
* Render routines for 3D coloured and shaded transparency rendering.
*/
#include <GLee.h>
#include <GL/glew.h>
#include <string.h>
#include "lib/framework/frame.h"
@ -594,14 +594,14 @@ static void pie_DrawShadows(void)
glEnable(GL_STENCIL_TEST);
// Check if we have the required extensions
if (GLEE_EXT_stencil_wrap)
if (GL_EXT_stencil_wrap)
{
op_depth_pass_front = GL_INCR_WRAP_EXT;
op_depth_pass_back = GL_DECR_WRAP_EXT;
}
// generic 1-pass version
if (GLEE_EXT_stencil_two_side)
if (GL_EXT_stencil_two_side)
{
glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT);
glDisable(GL_CULL_FACE);
@ -618,7 +618,7 @@ static void pie_DrawShadows(void)
glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
}
// check for ATI-specific 1-pass version
else if (GLEE_ATI_separate_stencil)
else if (GL_ATI_separate_stencil)
{
glDisable(GL_CULL_FACE);
glStencilMask(~0);

View File

@ -26,7 +26,7 @@
*/
/***************************************************************************/
#include <GLee.h>
#include <GL/glew.h>
#include "lib/framework/frame.h"
#include <SDL.h>
@ -54,7 +54,7 @@ bool pie_Initialise(void)
pie_TexInit();
/* Find texture compression extension */
if (GLEE_ARB_texture_compression)
if (GL_ARB_texture_compression)
{
debug(LOG_TEXTURE, "Texture compression: Yes");
wz_texture_compression = GL_COMPRESSED_RGBA_ARB;

View File

@ -21,7 +21,7 @@
* Renderer setup and state control routines for 3D rendering.
*/
#include <GLee.h>
#include <GL/glew.h>
#include "lib/framework/frame.h"
#include <SDL.h>

View File

@ -24,7 +24,7 @@
*
*/
#include <GLee.h>
#include "lib/framework/opengl.h"
#include "lib/framework/frame.h"
#include "lib/exceptionhandler/dumpinfo.h"
#include <SDL.h>
@ -76,6 +76,8 @@ bool screenInitialise(
int bpp = 0, value;
char buf[512];
GLint glMaxTUs;
GLenum err;
// Fetch the video info.
const SDL_VideoInfo* video_info = SDL_GetVideoInfo();
@ -169,7 +171,16 @@ bool screenInitialise(
debug( LOG_FATAL, "Double buffering is required for this game!");
exit(1);
}
err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
debug(LOG_FATAL, "Error: %s", glewGetErrorString(err));
exit(1);
}
info("Status: Using GLEW %s", glewGetString(GLEW_VERSION));
/* Dump general information about OpenGL implementation to the console and the dump file */
ssprintf(buf, "OpenGL Vendor : %s", glGetString(GL_VENDOR));
addDumpInfo(buf);
@ -187,27 +198,27 @@ bool screenInitialise(
/* Dump extended information about OpenGL implementation to the console */
debug(LOG_3D, "OpenGL Extensions : %s", glGetString(GL_EXTENSIONS)); // FIXME This is too much for MAX_LEN_LOG_LINE
debug(LOG_3D, "Supported OpenGL extensions:");
debug(LOG_3D, " * OpenGL 1.2 %s supported!", GLEE_VERSION_1_2 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 1.3 %s supported!", GLEE_VERSION_1_3 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 1.4 %s supported!", GLEE_VERSION_1_4 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 1.5 %s supported!", GLEE_VERSION_1_5 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 2.0 %s supported!", GLEE_VERSION_2_0 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 2.1 %s supported!", GLEE_VERSION_2_1 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 3.0 %s supported!", GLEE_VERSION_3_0 ? "is" : "is NOT");
debug(LOG_3D, " * Texture compression %s supported.", GLEE_ARB_texture_compression ? "is" : "is NOT");
debug(LOG_3D, " * Two side stencil %s supported.", GLEE_EXT_stencil_two_side ? "is" : "is NOT");
debug(LOG_3D, " * ATI separate stencil is%s supported.", GLEE_ATI_separate_stencil ? "" : " NOT");
debug(LOG_3D, " * Stencil wrap %s supported.", GLEE_EXT_stencil_wrap ? "is" : "is NOT");
debug(LOG_3D, " * Anisotropic filtering %s supported.", GLEE_EXT_texture_filter_anisotropic ? "is" : "is NOT");
debug(LOG_3D, " * Rectangular texture %s supported.", GLEE_ARB_texture_rectangle ? "is" : "is NOT");
debug(LOG_3D, " * FrameBuffer Object (FBO) %s supported.", GLEE_EXT_framebuffer_object ? "is" : "is NOT");
debug(LOG_3D, " * Vertex Buffer Object (VBO) %s supported.", GLEE_ARB_vertex_buffer_object ? "is" : "is NOT");
debug(LOG_3D, " * NPOT %s supported.", GLEE_ARB_texture_non_power_of_two ? "is" : "is NOT");
debug(LOG_3D, " * texture cube_map %s supported.", GLEE_ARB_texture_cube_map ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 1.2 %s supported!", GL_VERSION_1_2 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 1.3 %s supported!", GL_VERSION_1_3 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 1.4 %s supported!", GL_VERSION_1_4 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 1.5 %s supported!", GL_VERSION_1_5 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 2.0 %s supported!", GL_VERSION_2_0 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 2.1 %s supported!", GL_VERSION_2_1 ? "is" : "is NOT");
debug(LOG_3D, " * OpenGL 3.0 %s supported!", GL_VERSION_3_0 ? "is" : "is NOT");
debug(LOG_3D, " * Texture compression %s supported.", GL_ARB_texture_compression ? "is" : "is NOT");
debug(LOG_3D, " * Two side stencil %s supported.", GL_EXT_stencil_two_side ? "is" : "is NOT");
debug(LOG_3D, " * ATI separate stencil is%s supported.", GL_ATI_separate_stencil ? "" : " NOT");
debug(LOG_3D, " * Stencil wrap %s supported.", GL_EXT_stencil_wrap ? "is" : "is NOT");
debug(LOG_3D, " * Anisotropic filtering %s supported.", GL_EXT_texture_filter_anisotropic ? "is" : "is NOT");
debug(LOG_3D, " * Rectangular texture %s supported.", GL_ARB_texture_rectangle ? "is" : "is NOT");
debug(LOG_3D, " * FrameBuffer Object (FBO) %s supported.", GL_EXT_framebuffer_object ? "is" : "is NOT");
debug(LOG_3D, " * Vertex Buffer Object (VBO) %s supported.", GL_ARB_vertex_buffer_object ? "is" : "is NOT");
debug(LOG_3D, " * NPOT %s supported.", GL_ARB_texture_non_power_of_two ? "is" : "is NOT");
debug(LOG_3D, " * texture cube_map %s supported.", GL_ARB_texture_cube_map ? "is" : "is NOT");
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &glMaxTUs);
debug(LOG_3D, " * Total number of Texture Units (TUs) supported is %d.", (int) glMaxTUs);
if (!GLEE_VERSION_1_4)
if (!GL_VERSION_1_4)
{
debug(LOG_FATAL, "OpenGL 1.4 + VBO extension is required for this game!");
exit(1);
@ -216,23 +227,23 @@ bool screenInitialise(
#ifndef WZ_OS_MAC
// Make OpenGL's VBO functions available under the core names for
// implementations that have them only as extensions, namely Mesa.
if (!GLEE_VERSION_1_5)
if (!GL_VERSION_1_5)
{
if (GLEE_ARB_vertex_buffer_object)
if (GL_ARB_vertex_buffer_object)
{
info("Using VBO extension functions under the core names.");
GLeeFuncPtr_glBindBuffer = GLeeFuncPtr_glBindBufferARB;
GLeeFuncPtr_glDeleteBuffers = GLeeFuncPtr_glDeleteBuffersARB;
GLeeFuncPtr_glGenBuffers = GLeeFuncPtr_glGenBuffersARB;
GLeeFuncPtr_glIsBuffer = GLeeFuncPtr_glIsBufferARB;
GLeeFuncPtr_glBufferData = GLeeFuncPtr_glBufferDataARB;
GLeeFuncPtr_glBufferSubData = GLeeFuncPtr_glBufferSubDataARB;
GLeeFuncPtr_glGetBufferSubData = GLeeFuncPtr_glGetBufferSubDataARB;
GLeeFuncPtr_glMapBuffer = GLeeFuncPtr_glMapBufferARB;
GLeeFuncPtr_glUnmapBuffer = GLeeFuncPtr_glUnmapBufferARB;
GLeeFuncPtr_glGetBufferParameteriv = GLeeFuncPtr_glGetBufferParameterivARB;
GLeeFuncPtr_glGetBufferPointerv = GLeeFuncPtr_glGetBufferPointervARB;
__glewBindBuffer = __glewBindBufferARB;
__glewDeleteBuffers = __glewDeleteBuffersARB;
__glewGenBuffers = __glewGenBuffersARB;
__glewIsBuffer = __glewIsBufferARB;
__glewBufferData = __glewBufferDataARB;
__glewBufferSubData = __glewBufferSubDataARB;
__glewGetBufferSubData = __glewGetBufferSubDataARB;
__glewMapBuffer = __glewMapBufferARB;
__glewUnmapBuffer = __glewUnmapBufferARB;
__glewGetBufferParameteriv = __glewGetBufferParameterivARB;
__glewGetBufferPointerv = __glewGetBufferPointervARB;
}
else
{
@ -245,7 +256,7 @@ bool screenInitialise(
#endif
/* Dump information about OpenGL 2.0+ implementation to the console and the dump file */
if (GLEE_VERSION_2_0)
if (GL_VERSION_2_0)
{
GLint glMaxTIUs;

View File

@ -18,7 +18,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <GLee.h>
#include <GL/glew.h>
#include "lib/framework/frame.h"
#if defined(WZ_OS_MAC)
@ -154,7 +154,7 @@ int pie_AddTexPage(iV_Image *s, const char* filename, int slot, int maxTextureSi
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Use anisotropic filtering, if available, but only max 4.0 to reduce processor burden
if (GLEE_EXT_texture_filter_anisotropic)
if (GL_EXT_texture_filter_anisotropic)
{
GLfloat max;

View File

@ -1,4 +1,4 @@
AM_CPPFLAGS = $(SDL_CFLAGS) $(THEORA_CFLAGS) $(OPENAL_CFLAGS) $(WZ_CPPFLAGS) $(GLee_CFLAGS)
AM_CPPFLAGS = $(SDL_CFLAGS) $(THEORA_CFLAGS) $(WZ_CPPFLAGS)
AM_CFLAGS = $(WZ_CFLAGS)
AM_CXXFLAGS = $(WZ_CXXFLAGS)

View File

@ -4,7 +4,7 @@
%.lex.hpp %.lex.cpp:: %.l
$(LEX) $(LFLAGS) $(AM_LFLAGS) -o$@ $<
AM_CPPFLAGS = -DYY_NO_INPUT $(SDL_CFLAGS) $(PHYSFS_CFLAGS) $(PNG_CFLAGS) $(OGGVORBIS_CFLAGS) $(OPENAL_CFLAGS) $(OPENGLC_CFLAGS) $(OPENGL_CFLAGS) $(WZ_CPPFLAGS) $(GLee_CFLAGS)
AM_CPPFLAGS = -DYY_NO_INPUT $(SDL_CFLAGS) $(PHYSFS_CFLAGS) $(PNG_CFLAGS) $(OGGVORBIS_CFLAGS) $(OPENAL_CFLAGS) $(OPENGLC_CFLAGS) $(OPENGL_CFLAGS) $(WZ_CPPFLAGS) $(GLEW_CFLAGS)
AM_CFLAGS = $(WZ_CFLAGS)
AM_CXXFLAGS = $(WZ_CXXFLAGS)
AM_LFLAGS = $(FLEX_FLAGS)
@ -297,7 +297,7 @@ warzone2100_LIBS = \
$(top_builddir)/lib/iniparser/libiniparser.a \
$(top_builddir)/lib/exceptionhandler/libexceptionhandler.a
warzone2100_LDADD = $(warzone2100_LIBS) $(LTLIBINTL) $(SDL_LIBS) $(PHYSFS_LIBS) $(PNG_LIBS) $(OGGVORBIS_LIBS) $(THEORA_LIBS) $(OPENAL_LIBS) $(OPENGLC_LIBS) $(OPENGL_LIBS) $(X11_LIBS) $(GLee_LIBS)
warzone2100_LDADD = $(warzone2100_LIBS) $(LTLIBINTL) $(SDL_LIBS) $(PHYSFS_LIBS) $(PNG_LIBS) $(OGGVORBIS_LIBS) $(THEORA_LIBS) $(OPENAL_LIBS) $(OPENGLC_LIBS) $(OPENGL_LIBS) $(X11_LIBS) $(GLEW_LIBS)
if MINGW32
warzone2100_LDADD += $(top_builddir)/win32/warzone2100.o $(WIN32_LIBS)

View File

@ -29,7 +29,7 @@
* The water is drawn using the hardcoded page-80 and page-81 textures.
*/
#include <GLee.h>
#include <GL/glew.h>
#include <string.h>
#include "lib/framework/frame.h"

View File

@ -23,7 +23,7 @@
* This is where we do texture atlas generation.
*/
#include <GLee.h>
#include <GL/glew.h>
#include "lib/framework/frame.h"
@ -111,7 +111,7 @@ static int newPage(const char *name, int level, int width, int height, int count
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Use anisotropic filtering, if available, but only max 4.0 to reduce processor burden
if (GLEE_EXT_texture_filter_anisotropic)
if (GL_EXT_texture_filter_anisotropic)
{
GLfloat max;