projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.38.tar.gz
[xscreensaver]
/
hacks
/
glx
/
cubetwist.c
diff --git
a/hacks/glx/cubetwist.c
b/hacks/glx/cubetwist.c
index 6e11f01faec68d9d3aafebab69ef87bc624873d8..61af2879219bc564d2379a29d0bd54d4ac83d3c2 100644
(file)
--- a/
hacks/glx/cubetwist.c
+++ b/
hacks/glx/cubetwist.c
@@
-14,7
+14,6
@@
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
-# define refresh_cube 0
# define release_cube 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
# define release_cube 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@
-341,8
+340,15
@@
ENTRYPOINT void
reshape_cube (ModeInfo *mi, int width, int height)
{
GLfloat h = (GLfloat) height / (GLfloat) width;
reshape_cube (ModeInfo *mi, int width, int height)
{
GLfloat h = (GLfloat) height / (GLfloat) width;
+ int y = 0;
- glViewport (0, 0, (GLint) width, (GLint) height);
+ if (width > height * 5) { /* tiny window: show middle */
+ height = width;
+ y = -height/2;
+ h = height / (GLfloat) width;
+ }
+
+ glViewport (0, y, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@
-417,15
+423,13
@@
cube_handle_event (ModeInfo *mi, XEvent *event)
}
}
-static void free_cube (ModeInfo *mi);
-
ENTRYPOINT void
init_cube (ModeInfo *mi)
{
cube_configuration *bp;
int wire = MI_IS_WIREFRAME(mi);
ENTRYPOINT void
init_cube (ModeInfo *mi)
{
cube_configuration *bp;
int wire = MI_IS_WIREFRAME(mi);
- MI_INIT (mi, bps
, free_cube
);
+ MI_INIT (mi, bps);
bp = &bps[MI_SCREEN(mi)];
bp = &bps[MI_SCREEN(mi)];
@@
-566,7
+570,7
@@
draw_cube (ModeInfo *mi)
glXSwapBuffers(dpy, window);
}
glXSwapBuffers(dpy, window);
}
-
static
void
+
ENTRYPOINT
void
free_cube (ModeInfo *mi)
{
cube_configuration *bp = &bps[MI_SCREEN(mi)];
free_cube (ModeInfo *mi)
{
cube_configuration *bp = &bps[MI_SCREEN(mi)];