diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-01 18:24:37 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-01 18:24:37 -0600 |
commit | 4e997a9c6e25689dca65a2ec573a599699ef8170 (patch) | |
tree | fdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /PerlQt/examples/opengl/gear | |
parent | bfa107694b2507a7116f8856cafe4ab1375da8a9 (diff) | |
download | libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.tar.gz libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.zip |
Initial TQt conversion
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; } |