summaryrefslogtreecommitdiff
path: root/src/test.cc
diff options
context:
space:
mode:
authorpixel <pixel>2002-12-17 00:09:50 +0000
committerpixel <pixel>2002-12-17 00:09:50 +0000
commitf0981aa6b09e67ec57b7cb92421513415292e97f (patch)
tree482ea3feccc16763733afaaaef36a9a81b55f6b1 /src/test.cc
parentdd1e9ef7dd0d490f9397d524e1cfde13d6314623 (diff)
Commit of the day...
Diffstat (limited to 'src/test.cc')
-rw-r--r--src/test.cc71
1 files changed, 60 insertions, 11 deletions
diff --git a/src/test.cc b/src/test.cc
index f82a6bd..43abd28 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -1,14 +1,18 @@
#include <SDL.h>
-#include "generic.h"
-#include "Main.h"
+#include <generic.h>
+#include <Main.h>
+#include <Input.h>
#include "glbase.h"
#include "gltexture.h"
+#include "glfont.h"
CODE_BEGINS
virtual int startup() throw (GeneralException) {
Uint8 * texture;
verbosity = M_INFO;
mogltk::glbase::setup();
+ Input ffont("font.bin");
+ mogltk::font font(&ffont);
verbosity = M_INFO;
@@ -32,30 +36,32 @@ virtual int startup() throw (GeneralException) {
throw GeneralException("Error: could not load texture.");
}
SDL_BlitSurface(s, NULL, mytex->GetSurface(), NULL);
-/*
+
+/*
for (int y = 0; y < 256; y += 2) {
for (int x = 0; x < 256; x += 2) {
- texture[(x + y * 256) * 4 + 0] = 255;
- texture[(x + y * 256) * 4 + 1] = 255;
+ texture[(x + y * 256) * 4 + 0] = 0;
+ texture[(x + y * 256) * 4 + 1] = 0;
texture[(x + y * 256) * 4 + 2] = 255;
- texture[(x + y * 256) * 4 + 3] = 255;
+ texture[(x + y * 256) * 4 + 3] = 0;
}
}
-*/
+*/
+
mogltk::glbase::Enter2DMode();
mytex->Bind();
glBegin(GL_TRIANGLE_STRIP);
-// glColor3d(0, 0, 0);
+ glColor3d(0, 0, 0);
glTexCoord2i(0, 0);
glVertex2f(50, 50);
-// glColor3d(1, 0, 0);
+ glColor3d(1, 0, 0);
glTexCoord2i(511, 0);
glVertex2f(561, 50);
-// glColor3d(0, 1, 0);
+ glColor3d(0, 1, 0);
glTexCoord2i(0, 511);
glVertex2f(50, 561);
-// glColor3d(0, 0, 1);
+ glColor3d(0, 0, 1);
glTexCoord2i(511, 511);
glVertex2f(561, 561);
glEnd();
@@ -77,6 +83,49 @@ virtual int startup() throw (GeneralException) {
glEnd();
mogltk::glbase::Leave2DMode();
+ font.putcursor(10, 10);
+ font.putentry('P');
+ font.putentry('i');
+ font.putentry('x');
+ font.putentry('e');
+ font.putentry('l');
+ font.putentry('P');
+ font.putentry('a');
+ font.putentry('w');
+ font.putentry('a');
+ font.putentry('!');
+ font.newline();
+ font.putentry('I');
+ font.putentry('t');
+ font.putentry(' ');
+ font.putentry('w');
+ font.putentry('o');
+ font.putentry('r');
+ font.putentry('k');
+ font.putentry('s');
+ font.putentry('!');
+ font.putentry('!');
+ font.newline();
+ font.putentry('I');
+ font.putentry(' ');
+ font.putentry('c');
+ font.putentry('a');
+ font.putentry('n');
+ font.putentry('\'');
+ font.putentry('t');
+ font.putentry(' ');
+ font.putentry('b');
+ font.putentry('e');
+ font.putentry('l');
+ font.putentry('i');
+ font.putentry('e');
+ font.putentry('v');
+ font.putentry('e');
+ font.putentry(' ');
+ font.putentry('i');
+ font.putentry('t');
+ font.putentry('!');
+
mogltk::glbase::Flip();
// sleep(15);