#ifdef USE_GL /* whole file */
-#ifdef HAVE_XPM
-# include <X11/xpm.h>
-# ifndef PIXEL_ALREADY_TYPEDEFED
-# define PIXEL_ALREADY_TYPEDEFED /* Sigh, Xmu/Drawing.h needs this... */
-# endif
-#endif
-
#ifdef HAVE_XMU
# ifndef VMS
# include <X11/Xmu/Drawing.h>
#include <GL/gl.h>
#include <GL/glu.h>
-#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
/* Functions for loading and storing textures */
{
int height, width;
GLubyte *image;
- GLint a;
int format;
if ( !strncmp(filename, "BUILTIN", 7))
/* mipmaps make the image look much nicer */
if (do_mipmap)
- a=gluBuild2DMipmaps(GL_TEXTURE_2D, format, width, height, format, GL_UNSIGNED_BYTE, image);
+ {
+ int status;
+ clear_gl_error();
+ status = gluBuild2DMipmaps(GL_TEXTURE_2D, format, width, height, format,
+ GL_UNSIGNED_BYTE, image);
+ if (status)
+ {
+ const char *s = gluErrorString (status);
+ fprintf (stderr, "%s: error mipmapping %dx%d texture: %s\n",
+ progname, width, height,
+ (s ? s : "(unknown)"));
+ exit (1);
+ }
+ check_gl_error("mipmapping");
+ }
else
{
clear_gl_error();
GLvoid drawScene(ModeInfo * mi)
{
- check_gl_error ("drawScene");
+/* check_gl_error ("drawScene"); */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* we have to do this here because the FPS meter turns these 3 features off!! */
/* increment frame-counter */
frame++;
- check_gl_error ("drawScene");
+/* check_gl_error ("drawScene"); */
}