X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fextrusion.c;h=d1c8dbbb825e0838f56e219496615e3c53006f61;hb=a445bdd3e3ba4abbee441844b6665b4c3c13d48c;hp=86facfb6f79dbaf98eb5b9f61789838ce75c3c29;hpb=0ed85ca0e4b0eae40a4f50a51d63f2f41e45373a;p=xscreensaver diff --git a/hacks/glx/extrusion.c b/hacks/glx/extrusion.c index 86facfb6..d1c8dbbb 100644 --- a/hacks/glx/extrusion.c +++ b/hacks/glx/extrusion.c @@ -29,14 +29,19 @@ #include - +#ifdef HAVE_CONFIG_H +#include +#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" \ @@ -72,7 +77,11 @@ #include #include #include +#ifdef HAVE_GLE3 +#include +#else #include +#endif #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -456,8 +465,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); } @@ -658,6 +669,7 @@ void draw_screensaver(ModeInfo * mi) dd_lasty *= scale; } + if (mi->fps_p) do_fps (mi); glXSwapBuffers(display, window); } @@ -689,8 +701,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; @@ -728,12 +740,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); @@ -783,8 +796,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);