projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.01.tar.gz
[xscreensaver]
/
hacks
/
glx
/
extrusion.c
diff --git
a/hacks/glx/extrusion.c
b/hacks/glx/extrusion.c
index 726177e6787ceeed530fdc0e634b64ab313900ad..81cdeb918a8d22a0869b9f901159cf8d4bbb40d0 100644
(file)
--- a/
hacks/glx/extrusion.c
+++ b/
hacks/glx/extrusion.c
@@
-37,8
+37,11
@@
# define PROGCLASS "Screensaver"
# define HACK_INIT init_screensaver
# define HACK_DRAW draw_screensaver
# define PROGCLASS "Screensaver"
# define HACK_INIT init_screensaver
# define HACK_DRAW draw_screensaver
+# define HACK_RESHAPE reshape_screensaver
# define screensaver_opts xlockmore_opts
# 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" \
"*wire: False \n" \
"*texture: False \n" \
"*image: BUILTIN \n" \
@@
-52,13
+55,6
@@
#ifdef USE_GL /* whole file */
#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>
#ifdef HAVE_XMU
# ifndef VMS
# include <X11/Xmu/Drawing.h>
@@
-67,7
+63,7
@@
# endif /* VMS */
#endif
# endif /* VMS */
#endif
-#include <
malloc
.h>
+#include <
stdlib
.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@
-462,8
+458,10
@@
void Create_Texture(char *filename, int do_mipmap, int do_texture_quality)
format, GL_UNSIGNED_BYTE, image);
}
else {
format, GL_UNSIGNED_BYTE, image);
}
else {
+ clear_gl_error();
glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0,
format, GL_UNSIGNED_BYTE, image);
glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0,
format, GL_UNSIGNED_BYTE, image);
+ check_gl_error("texture");
}
free(image);
}
}
free(image);
}
@@
-664,6
+662,7
@@
void draw_screensaver(ModeInfo * mi)
dd_lasty *= scale;
}
dd_lasty *= scale;
}
+ if (mi->fps_p) do_fps (mi);
glXSwapBuffers(display, window);
}
glXSwapBuffers(display, window);
}
@@
-695,8
+694,8
@@
void resetProjection(void) {
}
/* Standard reshape function */
}
/* 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;
{
global_width=width;
global_height=height;
@@
-734,12
+733,13
@@
void chooseScreensaverExample(void) {
}
/* main OpenGL initialization routine */
}
/* main OpenGL initialization routine */
-void initializeGL(GLsizei width, GLsizei height)
+void
+initializeGL(ModeInfo *mi, GLsizei width, GLsizei height)
{
int style;
int mode;
{
int style;
int mode;
- reshape
(
width, height);
+ reshape
_screensaver(mi,
width, height);
glViewport( 0, 0, width, height );
glEnable(GL_DEPTH_TEST);
glViewport( 0, 0, width, height );
glEnable(GL_DEPTH_TEST);
@@
-789,8
+789,8
@@
void init_screensaver(ModeInfo * mi)
gp->window = MI_WINDOW(mi);
if ((gp->glx_context = init_GL(mi)) != NULL) {
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);
chooseScreensaverExample();
} else {
MI_CLEARWINDOW(mi);