-/* xscreensaver, Copyright (c) 1998-2012 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998-2014 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
#include "xpm-ximage.h"
#include "rotator.h"
#include "gltrackball.h"
+
+#ifdef __GNUC__
+ __extension__ /* don't warn about "string length is greater than the length
+ ISO C89 compilers are required to support" when including
+ the following XPM file... */
+#endif
#if 0
# include "../images/lament128.xpm"
#else
scale_for_window(ModeInfo *mi)
{
lament_configuration *lc = &lcs[MI_SCREEN(mi)];
- int target_size = lc->texture->width * 1.4;
+
+ /* No texture created in -wireframe or -no-texture, so guess. */
+ int target_size = (lc->texture
+ ? lc->texture->width * 1.4
+ : 340);
int win_size = (MI_WIDTH(mi) > MI_HEIGHT(mi) ? MI_HEIGHT(mi) : MI_WIDTH(mi));
/* This scale makes the box take up most of the window */
glPushMatrix();
+ /* Do it twice because we don't track the device's orientation. */
+ glRotatef( current_device_rotation(), 0, 0, 1);
gltrackball_rotate (lc->trackball);
+ glRotatef(-current_device_rotation(), 0, 0, 1);
/* Make into the screen be +Y right be +X, and up be +Z. */
glRotatef(-90.0, 1.0, 0.0, 0.0);