~ubuntu-branches/ubuntu/karmic/xscreensaver/karmic

« back to all changes in this revision

Viewing changes to hacks/glx/cage.c

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Hildebrandt
  • Date: 2006-07-29 23:00:43 UTC
  • mfrom: (1.1.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20060729230043-3ergkicskbntet5n
Tags: 4.24-5
remove /usr/doc/xscreensaver link to finish /usr/doc ->
/usr/share/doc transition (closes: #380394)

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
#define PlankThickness  0.15
157
157
 
158
158
static Bool 
159
 
draw_woodplank(cagestruct * cp)
 
159
draw_woodplank(cagestruct * cp, int wire)
160
160
{
161
 
        glBegin(GL_QUADS);
 
161
        glBegin(wire ? GL_LINES : GL_QUADS);
162
162
        glNormal3f(0, 0, 1);
163
163
        glTexCoord2f(0, 0);
164
164
        glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
219
219
}
220
220
 
221
221
static Bool
222
 
draw_impossiblecage(cagestruct * cp)
 
222
draw_impossiblecage(cagestruct * cp, int wire)
223
223
{
224
224
        glPushMatrix();
225
225
        glRotatef(90, 0, 1, 0);
226
226
        glTranslatef(0.0, PlankHeight - PlankWidth, -PlankThickness - PlankWidth);
227
 
        if (!draw_woodplank(cp))
 
227
        if (!draw_woodplank(cp, wire))
228
228
                return False;
229
229
        glPopMatrix();
230
230
        glPushMatrix();
231
231
        glRotatef(90, 0, 0, 1);
232
232
        glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth - PlankThickness);
233
 
        if (!draw_woodplank(cp))
 
233
        if (!draw_woodplank(cp, wire))
234
234
                return False;
235
235
        glPopMatrix();
236
236
        glPushMatrix();
237
237
        glRotatef(90, 0, 1, 0);
238
238
        glTranslatef(0.0, PlankWidth - PlankHeight, -PlankThickness - PlankWidth);
239
 
        if (!draw_woodplank(cp))
 
239
        if (!draw_woodplank(cp, wire))
240
240
                return False;
241
241
        glPopMatrix();
242
242
        glPushMatrix();
243
243
        glTranslatef(0.0, PlankWidth - PlankHeight, 3 * PlankThickness - PlankWidth);
244
 
        if (!draw_woodplank(cp))
 
244
        if (!draw_woodplank(cp, wire))
245
245
                return False;
246
246
        glPopMatrix();
247
247
        glPushMatrix();
248
248
        glRotatef(90, 0, 0, 1);
249
249
        glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth - PlankThickness);
250
 
        if (!draw_woodplank(cp))
 
250
        if (!draw_woodplank(cp, wire))
251
251
                return False;
252
252
        glPopMatrix();
253
253
        glPushMatrix();
254
254
        glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth - 3 * PlankThickness);
255
 
        if (!draw_woodplank(cp))
 
255
        if (!draw_woodplank(cp, wire))
256
256
                return False;
257
257
        glPopMatrix();
258
258
        glPushMatrix();
259
259
        glTranslatef(0.0, PlankHeight - PlankWidth, 3 * PlankThickness - PlankWidth);
260
 
        if (!draw_woodplank(cp))
 
260
        if (!draw_woodplank(cp, wire))
261
261
                return False;
262
262
        glPopMatrix();
263
263
        glPushMatrix();
264
264
        glRotatef(90, 0, 0, 1);
265
265
        glTranslatef(0.0, PlankHeight - PlankWidth, PlankThickness - PlankWidth);
266
 
        if (!draw_woodplank(cp))
 
266
        if (!draw_woodplank(cp, wire))
267
267
                return False;
268
268
        glPopMatrix();
269
269
        glPushMatrix();
270
270
        glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth - 3 * PlankThickness);
271
 
        if (!draw_woodplank(cp))
 
271
        if (!draw_woodplank(cp, wire))
272
272
                return False;
273
273
        glPopMatrix();
274
274
        glPushMatrix();
275
275
        glRotatef(90, 0, 1, 0);
276
276
        glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth + PlankThickness);
277
 
        if (!draw_woodplank(cp))
 
277
        if (!draw_woodplank(cp, wire))
278
278
                return False;
279
279
        glPopMatrix();
280
280
        glPushMatrix();
281
281
        glRotatef(90, 0, 0, 1);
282
282
        glTranslatef(0.0, PlankWidth - PlankHeight, PlankThickness - PlankWidth);
283
 
        if (!draw_woodplank(cp))
 
283
        if (!draw_woodplank(cp, wire))
284
284
                return False;
285
285
        glPopMatrix();
286
286
        glPushMatrix();
287
287
        glRotatef(90, 0, 1, 0);
288
288
        glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth + PlankThickness);
289
 
        if (!draw_woodplank(cp))
 
289
        if (!draw_woodplank(cp, wire))
290
290
                return False;
291
291
        glPopMatrix();
292
292
        return True;
312
312
pinit(ModeInfo *mi)
313
313
{
314
314
        int status;
 
315
 
315
316
        glClearDepth(1.0);
316
317
        glClearColor(0.0, 0.0, 0.0, 1.0);
317
318
 
 
319
    if (MI_IS_WIREFRAME(mi))
 
320
      return;
 
321
 
318
322
        glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
319
323
        glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
320
324
        glLightfv(GL_LIGHT0, GL_POSITION, position0);
440
444
        glRotatef(cp->step * 100, 0, 0, 1);
441
445
        glRotatef(25 + cos(cp->step * 5) * 6, 1, 0, 0);
442
446
        glRotatef(204.5 - sin(cp->step * 5) * 8, 0, 1, 0);
443
 
        if (!draw_impossiblecage(cp)) {
 
447
        if (!draw_impossiblecage(cp, MI_IS_WIREFRAME(mi))) {
444
448
                release_cage(mi);
445
449
                return;
446
450
        }