diff options
Diffstat (limited to 'PerlQt/examples/opengl/gear')
-rw-r--r-- | PerlQt/examples/opengl/gear/gear | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/PerlQt/examples/opengl/gear/gear b/PerlQt/examples/opengl/gear/gear index 2edc951..d9e4c8a 100644 --- a/PerlQt/examples/opengl/gear/gear +++ b/PerlQt/examples/opengl/gear/gear @@ -2,7 +2,7 @@ # # Draws a gear. # -# This code is originally from Qt-1.44, by Troll Tech +# This code is originally from TQt-1.44, by Troll Tech # # Portions of this code have been borrowed from Brian Paul's Mesa # distribution. @@ -11,8 +11,8 @@ package GearWidget; use OpenGL qw(:all); -use Qt; -use Qt::attributes qw( +use TQt; +use TQt::attributes qw( gear1 gear2 gear3 @@ -22,7 +22,7 @@ use Qt::attributes qw( angle ); -use Qt::isa qw(Qt::GLWidget); +use TQt::isa qw(TQt::GLWidget); # # Draw a gear wheel. You'll probably want to call this function when @@ -54,7 +54,7 @@ sub gear { glNormal3f(0.0, 0.0, 1.0); # draw front face - glBegin(GL_QUAD_STRIP); + glBegin(GL_TQUAD_STRIP); for $i (0 .. $teeth) { $angle = $i * 2.0*$pi / $teeth; glVertex3f($r0*cos($angle), $r0*sin($angle), $width*0.5); @@ -65,7 +65,7 @@ sub gear { glEnd(); # draw front sides of teeth - glBegin(GL_QUADS); + glBegin(GL_TQUADS); $da = 2.0*$pi / $teeth / 4.0; for $i (0 .. $teeth-1) { $angle = $i * 2.0*$pi / $teeth; @@ -81,7 +81,7 @@ sub gear { glNormal3f(0.0, 0.0, -1.0); # draw back face - glBegin(GL_QUAD_STRIP); + glBegin(GL_TQUAD_STRIP); for $i (0 .. $teeth) { $angle = $i * 2.0*$pi / $teeth; glVertex3f($r1*cos($angle), $r1*sin($angle), -$width*0.5); @@ -92,7 +92,7 @@ sub gear { glEnd(); # draw back sides of teeth - glBegin(GL_QUADS); + glBegin(GL_TQUADS); $da = 2.0*$pi / $teeth / 4.0; for $i (0 .. $teeth-1) { $angle = $i * 2.0*$pi / $teeth; @@ -105,7 +105,7 @@ sub gear { glEnd(); # draw outward faces of teeth - glBegin(GL_QUAD_STRIP); + glBegin(GL_TQUAD_STRIP); for $i (0 .. $teeth-1) { $angle = $i * 2.0*$pi / $teeth; @@ -139,7 +139,7 @@ sub gear { glShadeModel(GL_SMOOTH); # draw inside radius cylinder - glBegin(GL_QUAD_STRIP); + glBegin(GL_TQUAD_STRIP); for $i (0 .. $teeth) { $angle = $i * 2.0*$pi / $teeth; glNormal3f(-cos($angle), -sin($angle), 0.0); @@ -251,12 +251,12 @@ sub timerEvent { package main; -use Qt; +use TQt; use GearWidget; -$app = Qt::Application(\@ARGV); +$app = TQt::Application(\@ARGV); -if(!Qt::GLFormat::hasOpenGL()) { +if(!TQt::GLFormat::hasOpenGL()) { warn("This system has no OpenGL support. Exiting."); exit -1; } |