X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fflyingtoasters.c;h=b9915f5a7fc7c5e3e9c100cee8290bdff4e86e8e;hp=9e1a482d9157e1f2c8f60e6152be21933a86db41;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hpb=ec8d2b32b63649e6d32bdfb306eda062769af823 diff --git a/hacks/glx/flyingtoasters.c b/hacks/glx/flyingtoasters.c index 9e1a482d..b9915f5a 100644 --- a/hacks/glx/flyingtoasters.c +++ b/hacks/glx/flyingtoasters.c @@ -362,8 +362,11 @@ load_textures (ModeInfo *mi) glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, xi->width, xi->height, 0, GL_RGBA, - /* GL_UNSIGNED_BYTE, */ +# ifndef USE_IPHONE GL_UNSIGNED_INT_8_8_8_8_REV, +# else + GL_UNSIGNED_BYTE, +# endif xi->data); check_gl_error("texture"); @@ -374,14 +377,19 @@ load_textures (ModeInfo *mi) glBindTexture (GL_TEXTURE_2D, bp->toast_texture); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); +# ifndef HAVE_JWZGLES glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); +# endif glPixelStorei (GL_UNPACK_ALIGNMENT, 1); glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, xi->width, xi->height, 0, GL_RGBA, - /* GL_UNSIGNED_BYTE, */ +# ifndef USE_IPHONE GL_UNSIGNED_INT_8_8_8_8_REV, +# else + GL_UNSIGNED_BYTE, +# endif xi->data); check_gl_error("texture"); @@ -476,8 +484,10 @@ init_toasters (ModeInfo *mi) glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, shiny); if (do_texture) glBindTexture (GL_TEXTURE_2D, bp->chrome_texture); +# ifndef HAVE_JWZGLES glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); +# endif } else if (i == TOAST || i == TOAST_BITTEN) { @@ -489,8 +499,10 @@ init_toasters (ModeInfo *mi) glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, shiny); if (do_texture) glBindTexture (GL_TEXTURE_2D, bp->toast_texture); +# ifndef HAVE_JWZGLES glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); +# endif glMatrixMode(GL_TEXTURE); glTranslatef(0.5, 0.5, 0); @@ -795,9 +807,12 @@ draw_toasters (ModeInfo *mi) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix (); + glRotatef(current_device_rotation(), 0, 0, 1); glRotatef(bp->view_x, 1, 0, 0); glRotatef(bp->view_y, 0, 1, 0); + glRotatef(-current_device_rotation(), 0, 0, 1); gltrackball_rotate (bp->user_trackball); + glRotatef(current_device_rotation(), 0, 0, 1); #if 0