summaryrefslogtreecommitdiff
path: root/src/test.cc
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 /src/test.cc
parent6860d41236baf506aaf3ecdc49131f55c8e341be (diff)
Changes of the month
Diffstat (limited to 'src/test.cc')
-rw-r--r--src/test.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/test.cc b/src/test.cc
index 9003cab..ec00bfe 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -28,10 +28,10 @@ virtual int startup() throw (GeneralException) {
new Archive("datas.paq");
#if 1
- mogltk::base * gl = new mogltk::glbase();
- mogltk::shape * sh = new mogltk::glshape();
- mogltk::font * font = new mogltk::glfont(&Input("font-2.bin"));
- mogltk::Sprite * s = new mogltk::glSprite(&Input("cursor.rgba"), 25, 25);
+ mogltk::glbase * gl = new mogltk::glbase();
+ mogltk::glshape * sh = new mogltk::glshape();
+ mogltk::glfont * font = new mogltk::glfont(&Input("font-2.bin"));
+ mogltk::glSprite * s = new mogltk::glSprite(&Input("cursor.rgba"), 25, 25);
#else
mogltk::base * gl = new mogltk::base();
mogltk::shape * sh = new mogltk::shape();
@@ -90,8 +90,20 @@ virtual int startup() throw (GeneralException) {
font->printf("my: %i\n", mogltk::engine::mouseY());
font->printf("t: %.2fs\n", (double) SDL_GetTicks() / 1000);
- s->draw(mogltk::engine::mouseX() - 8, mogltk::engine::mouseY() - 6);
+ double sx, sy, l, a;
+ sx = mogltk::engine::mouseX() - 320;
+ sy = mogltk::engine::mouseY() - 240;
+ l = sqrt(sx * sx + sy * sy);
+ sx /= l;
+ sy /= l;
+ a = acos(sx);
+ if (sy < 0)
+ a = -a;
+
+ font->printf("a: %.2f\n", a);
sh->line(320, 240, mogltk::engine::mouseX(), mogltk::engine::mouseY());
+ s->drawrotate(320, 240, a);
+ s->draw(mogltk::engine::mouseX() - 8, mogltk::engine::mouseY() - 6);
gl->Leave2DMode();