summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-08 02:49:42 +0000
committerpixel <pixel>2003-03-08 02:49:42 +0000
commit02ee82a20cc5462ab43fdfa3b0237cd8618bdd97 (patch)
treea8d1053b3f520765573936ba380547d048bc39f2 /src
parent054738ff7c07cf86e72fa7fb6d4136349eef5b1c (diff)
Sprites working(?)
Diffstat (limited to 'src')
-rw-r--r--src/test.cc27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/test.cc b/src/test.cc
index 129127a..b09c00d 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -7,15 +7,20 @@
#include "gltexture.h"
#include "glfont.h"
#include "engine.h"
+#include "sprite.h"
CODE_BEGINS
virtual int startup() throw (GeneralException) {
verbosity = M_INFO;
mogltk::glbase::setup();
- new Archive("datas.paq");
+// new Archive("datas.paq");
Input * fonte = new Input("font-2.bin");
mogltk::font font(fonte);
delete fonte;
+ Input * cursor = new Input("cursor.rgba");
+ printm(M_INFO, "Sprite file size: %i\n", cursor->GetSize());
+ mogltk::Sprite * s = new mogltk::Sprite(cursor, 25, 25);
+ delete cursor;
verbosity = M_INFO;
@@ -27,7 +32,7 @@ virtual int startup() throw (GeneralException) {
while (!mogltk::engine::quitrequested()) {
mogltk::glbase::Enter2DMode();
-
+
mytex->Bind();
glBegin(GL_TRIANGLE_STRIP);
glColor3d(0, 0, 0);
@@ -75,6 +80,24 @@ virtual int startup() throw (GeneralException) {
"It works!!\n"
"I can't believe it!\n"
);
+
+ s->draw( 50, 50);
+ s->draw(100, 50);
+ s->draw(150, 50);
+ s->draw(200, 50);
+ s->draw( 50, 100);
+ s->draw(100, 100);
+ s->draw(150, 100);
+ s->draw(200, 100);
+ s->draw( 50, 150);
+ s->draw(100, 150);
+ s->draw(150, 150);
+ s->draw(200, 150);
+ s->draw( 50, 200);
+ s->draw(100, 200);
+ s->draw(150, 200);
+ s->draw(200, 200);
+
mogltk::glbase::Leave2DMode();
mogltk::glbase::Flip();
}