X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fantspotlight.c;h=cec2676d9a33b20befbf845b283aeb3b536b45b0;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hp=2598f5cf3bca36d5674e59f35e5ad2fc97f92051;hpb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;p=xscreensaver diff --git a/hacks/glx/antspotlight.c b/hacks/glx/antspotlight.c index 2598f5cf..cec2676d 100644 --- a/hacks/glx/antspotlight.c +++ b/hacks/glx/antspotlight.c @@ -25,6 +25,20 @@ #include "xlock.h" #endif +#ifdef HAVE_COCOA +# include "jwxyz.h" +#else +# include +# include +# include +#endif + +#ifdef HAVE_JWZGLES +# include "jwzgles.h" +#endif /* HAVE_JWZGLES */ + +#include "sphere.h" +#include "tube.h" #include "rotator.h" #include "gltrackball.h" @@ -243,6 +257,7 @@ static Bool draw_ant(ModeInfo *mi, antspotlightstruct *mp, /* filled sphere */ static Bool mySphere(float radius) { +#if 0 GLUquadricObj *quadObj; if((quadObj = gluNewQuadric()) == 0) @@ -251,13 +266,20 @@ static Bool mySphere(float radius) gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL); gluSphere(quadObj, radius, 16, 16); gluDeleteQuadric(quadObj); - +#else + glPushMatrix(); + glScalef (radius, radius, radius); + glRotatef (90, 1, 0, 0); + unit_sphere (16, 16, False); + glPopMatrix(); +#endif return True; } /* silhouette sphere */ static Bool mySphere2(float radius) { +#if 0 GLUquadricObj *quadObj; if((quadObj = gluNewQuadric()) == 0) @@ -265,7 +287,14 @@ static Bool mySphere2(float radius) gluQuadricDrawStyle(quadObj, (GLenum) GLU_LINE); gluSphere(quadObj, radius, 16, 8); gluDeleteQuadric(quadObj); - +#else + /* #### no GLU_LINE */ + glPushMatrix(); + glScalef (radius, radius, radius); + glRotatef (90, 1, 0, 0); + unit_sphere (16, 16, True); + glPopMatrix(); +#endif return True; } @@ -550,8 +579,7 @@ static const GLfloat spotlight_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; static void pinit(void) { glClearDepth(1.0); - glClearColor(0.0, 0.0, 0.0, 1.0); - + /* setup twoside lighting */ glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); @@ -752,6 +780,7 @@ ENTRYPOINT void draw_antspotlight(ModeInfo * mi) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); + glRotatef(current_device_rotation(), 0, 0, 1); /* position camera */