summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-14 02:24:13 +0000
committerpixel <pixel>2003-03-14 02:24:13 +0000
commitfb5606a005852b96554b3607b8ae06d60db2a6bd (patch)
treef2928cb6fbd3e28c2c37e5184d3b9b680f1c1afe /src
parentff05e0d8437c50e86229a79b99c8f1ae0ffe773f (diff)
Toying...
Diffstat (limited to 'src')
-rw-r--r--src/test.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/test.cc b/src/test.cc
index 55b4a14..a3a4230 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -14,7 +14,9 @@
CODE_BEGINS
virtual int startup() throw (GeneralException) {
- verbosity = M_INFO;
+ int sx1, sx2, sy1, sy2;
+ double t = 0;
+// verbosity = M_INFO;
mogltk::glbase::setup();
new Archive("datas.paq");
mogltk::font font(&Input("font-2.bin"));
@@ -23,11 +25,17 @@ virtual int startup() throw (GeneralException) {
mogltk::engine::setcursorvisible(true);
mogltk::engine::setappactive(true);
- Input * pattern = new Input("pattern6.tex");
- mogltk::texture * mytex = new mogltk::texture(pattern, true);
- delete pattern;
-
+ mogltk::texture * mytex = new mogltk::texture(&Input("pattern6.tex"), true);
+
+ Color AlphaBlue(AQUA);
+ AlphaBlue.A = 50;
+
while (!mogltk::engine::quitrequested()) {
+ sx1 = 320 + 320 * sin(0.983 * t + 3.15);
+ sx2 = 320 + 320 * sin(0.537 * t + 5.32);
+ sy1 = 240 + 240 * sin(0.692 * t + 8.21);
+ sy2 = 240 + 240 * sin(1.029 * t + 2.42);
+
mogltk::glbase::Enter2DMode();
mogltk::shape::tbox(mytex, 50, 50, 561, 561, BLACK, RED, LIME, BLUE);
@@ -42,16 +50,22 @@ virtual int startup() throw (GeneralException) {
"It works!!\n"
"I can't believe it!\n"
);
+
+ mogltk::shape::box(MIN(sx1, sx2), MIN(sy1, sy2), MAX(sx1, sx2), MAX(sy1, sy2), AlphaBlue);
font.putcursor(550, 400);
font.printf("FPS: %.2f\n", mogltk::engine::FPS());
font.printf("mx: %i\n", mogltk::engine::mouseX());
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);
mogltk::glbase::Leave2DMode();
+
+
mogltk::glbase::Flip();
+ t = (double) SDL_GetTicks() / 1000;
}
delete mytex;