|
|
libraries/libopengl-dylan/examples/glu-test .cvsignore, NONE, 1.1 Makefile,: msg#00113
|
Subject: |
libraries/libopengl-dylan/examples/glu-test .cvsignore, NONE, 1.1 Makefile, NONE, 1.1 glu-test-exports.dylan, NONE, 1.1 glu-test.dylan, NONE, 1.1 glu-test.lid, NONE, 1.1 |
Update of /var/lib/cvs/libraries/libopengl-dylan/examples/glu-test
In directory cantor:/tmp/cvs-serv19147
Added Files:
.cvsignore Makefile glu-test-exports.dylan glu-test.dylan
glu-test.lid
Log Message:
bug: 6994
little test program to ensure GLU constants aren't broken. draws a spinning
wireframe sphere.
--- NEW FILE: .cvsignore ---
.libs
cc-glu-test-files.mak
glu-test
*.c
--- NEW FILE: Makefile ---
glu-test: glu-test.lid glu-test.dylan glu-test-exports.dylan
d2c -L../.. glu-test.lid
clean:
-rm -f *.o *.s *.a *.c *.mak *~ glu-test
-rm -rf .libs
--- NEW FILE: glu-test-exports.dylan ---
module: dylan-user
define library glu-test
use dylan;
use streams;
use format;
use print;
use standard-io;
use garbage-collection;
use transcendental;
use opengl;
end library;
define module glu-test
use dylan;
use extensions;
use system;
use streams;
use format;
use print;
use standard-io;
use transcendental;
use garbage-collection;
use opengl;
use opengl-glu;
use opengl-glut;
end module;
--- NEW FILE: glu-test.dylan ---
module: glu-test
synopsis:
author:
copyright:
define constant $PI = 3.141592654;
define constant $ROTATION-SPEED = 2;
define variable angle = 0.0;
define variable last-frame-time = 0.0;
define variable draw :: <function> = callback-method() => ();
glClear($GL-COLOR-BUFFER-BIT + $GL-DEPTH-BUFFER-BIT);
let now = glutGet($GLUT-ELAPSED-TIME);
let dt = as(<GLdouble>, now - last-frame-time) / 1000.0;
last-frame-time := now;
angle := angle + ($ROTATION-SPEED * dt);
if (angle > (2.0 * $PI))
angle := angle - (2.0 * $PI);
end if;
glLoadIdentity();
gluLookAt(5.0 * cos(angle), 0.0, 5.0 * sin(angle),
0.0, 0.0, 0.0,
0.0, 1.0, 0.0);
let sphere = gluNewQuadric();
gluQuadricDrawStyle(sphere, $GLU-LINE);
gluSphere(sphere, 1.0, 32, 16);
gluDeleteQuadric(sphere);
glutSwapBuffers();
end;
define variable reshape :: <function> =
callback-method(width :: <integer>, height :: <integer> ) => ();
let aspect = as(<GLdouble>, width) / as(<GLdouble>, height);
glViewport(0, 0, width, height);
glMatrixMode($GL-PROJECTION);
glLoadIdentity();
gluPerspective(45.0, aspect, 1.0, 100.0);
glMatrixMode($GL-MODELVIEW);
end;
define variable idle :: <function> =
callback-method() => ();
glutPostRedisplay();
end;
begin
glut-init();
glutInitDisplayMode($GLUT-RGB + $GLUT-DEPTH + $GLUT-DOUBLE);
glutInitWindowPosition(0, 0);
glutInitWindowSize(300, 300);
glutCreateWindow("GLU Quadric Test");
glutDisplayFunc(draw);
glutReshapeFunc(reshape);
glutIdleFunc(idle);
glutMainLoop();
end;
--- NEW FILE: glu-test.lid ---
library: glu-test
executable: glu-test
files: glu-test-exports
glu-test
!DSPAM:408baa51194243120412016!
_______________________________________________
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
http://www.gwydiondylan.org/mailman/listinfo/gd-chatter
|
| |