summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2003-10-05 19:14:35 +0000
committerpixel <pixel>2003-10-05 19:14:35 +0000
commit5b14b34d6e11611fb395e3cffaf888bcca0f3661 (patch)
treee02a79f056e1212169c0a030683bb59e1134c2dd /lib
parent6860d41236baf506aaf3ecdc49131f55c8e341be (diff)
Changes of the month
Diffstat (limited to 'lib')
-rw-r--r--lib/glsprite.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/glsprite.cc b/lib/glsprite.cc
index 478c0ef..18df7eb 100644
--- a/lib/glsprite.cc
+++ b/lib/glsprite.cc
@@ -35,3 +35,40 @@ void mogltk::glSprite::draw(int dx, int dy, ColorP c) {
if (!was2D)
mogltk::engine::glbase_o->Leave2DMode();
}
+
+void mogltk::glSprite::drawrotate(int cx, int cy, double a, ColorP c) {
+ bool was2D;
+
+ int sx, sy;
+
+ sx = GetSX() / 2;
+ sy = GetSY() / 2;
+
+ was2D = mogltk::engine::glbase_o->is2D();
+
+ if (!was2D)
+ mogltk::engine::glbase_o->Enter2DMode();
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glRotated(a, 0, 0, 1);
+ glTranslated(cx, cy, 0);
+
+ glMatrixMode(GL_TEXTURE);
+ glRotated(a, 0, 0, 1);
+
+ c.Bind();
+
+ Bind();
+ glBegin(GL_TRIANGLE_STRIP);
+ glTexCoord2i(GetPX() , GetPY() ); glVertex2i( - sx, - sy);
+ glTexCoord2i(GetPX() + GetSX(), GetPY() ); glVertex2i(GetSX() - sx, - sy);
+ glTexCoord2i(GetPX() , GetPY() + GetSY()); glVertex2i( - sx, GetSY() - sy);
+ glTexCoord2i(GetPX() + GetSX(), GetPY() + GetSY()); glVertex2i(GetSX() - sx, GetSY() - sy);
+ glEnd();
+
+ glPopMatrix();
+
+ if (!was2D)
+ mogltk::engine::glbase_o->Leave2DMode();
+}