* Revision History:
* Tue Oct 19 22:24:47 PDT 1999 Initial creation by David Konerding
+ * <dek@cgl.ucsf.edu>
*
* Notes:
* This screensaver requires the GLE ("OpenGL Tubing and Extrusion Library")
#include <X11/Intrinsic.h>
-
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#ifdef STANDALONE
# define PROGCLASS "Screensaver"
# define HACK_INIT init_screensaver
# define HACK_DRAW draw_screensaver
+# define HACK_RESHAPE reshape_screensaver
# define screensaver_opts xlockmore_opts
-#define DEFAULTS "*light: True \n" \
+#define DEFAULTS "*delay: 10000 \n" \
+ "*showFPS: False \n" \
+ "*light: True \n" \
"*wire: False \n" \
"*texture: False \n" \
"*image: BUILTIN \n" \
#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>
# endif /* VMS */
#endif
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <GL/gl.h>
#include <GL/glu.h>
+#ifdef HAVE_GLE3
+#include <GL/gle.h>
+#else
#include <GL/tube.h>
+#endif
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
format, GL_UNSIGNED_BYTE, image);
}
else {
+ clear_gl_error();
glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0,
format, GL_UNSIGNED_BYTE, image);
+ check_gl_error("texture");
}
free(image);
}
dd_lasty *= scale;
}
+ if (mi->fps_p) do_fps (mi);
glXSwapBuffers(display, window);
}
glEnable (GL_LIGHTING);
glColorMaterial (GL_FRONT, GL_DIFFUSE);
+ glColorMaterial (GL_BACK, GL_DIFFUSE);
glEnable (GL_COLOR_MATERIAL);
}
}
/* Standard reshape function */
-static void
-reshape(int width, int height)
+void
+reshape_screensaver(ModeInfo *mi, int width, int height)
{
+ global_width=width;
+ global_height=height;
glViewport( 0, 0, global_width, global_height );
resetProjection();
}
}
/* main OpenGL initialization routine */
-void initializeGL(GLsizei width, GLsizei height)
+void
+initializeGL(ModeInfo *mi, GLsizei width, GLsizei height)
{
int style;
int mode;
- global_width=width;
- global_height=height;
-
+ reshape_screensaver(mi, width, height);
glViewport( 0, 0, width, height );
glEnable(GL_DEPTH_TEST);
glClearColor(0,0,0,0);
- glCullFace(GL_BACK);
- glEnable(GL_CULL_FACE);
+/* glCullFace(GL_BACK); */
+/* glEnable(GL_CULL_FACE); */
glShadeModel(GL_SMOOTH);
if (do_light)
SetupLight();
- if (do_wire)
+ if (do_wire) {
glPolygonMode(GL_FRONT,GL_LINE);
+ glPolygonMode(GL_BACK,GL_LINE);
+ }
if (do_texture) {
Create_Texture(which_image, do_mipmap, do_texture_quality);
glEnable(GL_TEXTURE_2D);
gp->window = MI_WINDOW(mi);
if ((gp->glx_context = init_GL(mi)) != NULL) {
- reshape(MI_WIDTH(mi), MI_HEIGHT(mi));
- initializeGL(MI_WIDTH(mi), MI_HEIGHT(mi));
+ reshape_screensaver(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+ initializeGL(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
chooseScreensaverExample();
} else {
MI_CLEARWINDOW(mi);