X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fextrusion.c;h=81cdeb918a8d22a0869b9f901159cf8d4bbb40d0;hb=a94197e76a5dea5cb60542840809d6c20d0abbf3;hp=726177e6787ceeed530fdc0e634b64ab313900ad;hpb=93f25dc6827112d98b8b855ea85c8f5eb8123086;p=xscreensaver diff --git a/hacks/glx/extrusion.c b/hacks/glx/extrusion.c index 726177e6..81cdeb91 100644 --- 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 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" \ @@ -52,13 +55,6 @@ #ifdef USE_GL /* whole file */ -#ifdef HAVE_XPM -# include -# ifndef PIXEL_ALREADY_TYPEDEFED -# define PIXEL_ALREADY_TYPEDEFED /* Sigh, Xmu/Drawing.h needs this... */ -# endif -#endif - #ifdef HAVE_XMU # ifndef VMS # include @@ -67,7 +63,7 @@ # endif /* VMS */ #endif -#include +#include #include #include #include @@ -462,8 +458,10 @@ void Create_Texture(char *filename, int do_mipmap, int do_texture_quality) 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); } @@ -664,6 +662,7 @@ void draw_screensaver(ModeInfo * mi) dd_lasty *= scale; } + if (mi->fps_p) do_fps (mi); glXSwapBuffers(display, window); } @@ -695,8 +694,8 @@ void resetProjection(void) { } /* 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; @@ -734,12 +733,13 @@ void chooseScreensaverExample(void) { } /* main OpenGL initialization routine */ -void initializeGL(GLsizei width, GLsizei height) +void +initializeGL(ModeInfo *mi, GLsizei width, GLsizei height) { int style; int mode; - reshape(width, height); + reshape_screensaver(mi, width, height); 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) { - 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);