summaryrefslogtreecommitdiff
path: root/lib/glshape.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/glshape.cc')
-rw-r--r--lib/glshape.cc30
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/glshape.cc b/lib/glshape.cc
index e1c1faf..7662334 100644
--- a/lib/glshape.cc
+++ b/lib/glshape.cc
@@ -175,7 +175,7 @@ void mogltk::glshape::fdraw(fill * f, ColorP c, int sx, int sy) {
texture * t = f->GetTexture();
if (!t) {
- filldrawer * w = new filldrawer(f, t = f->Talloc(), c);
+ filldrawer * w = new filldrawer(f, t = f->Talloc(), WHITE);
f->walk(w);
delete w;
}
@@ -196,3 +196,31 @@ void mogltk::glshape::fdraw(fill * f, ColorP c, int sx, int sy) {
LEAVE;
}
+
+void mogltk::glshape::sdraw(fill * f, ColorP c, int sx, int sy) {
+ ENTERT;
+
+ texture * t = f->GetSTexture();
+
+ if (!t) {
+ segdrawer * w = new segdrawer(f, t = f->STalloc(), WHITE);
+ f->swalk(w);
+ delete w;
+ }
+
+ c.Bind();
+ t->Bind();
+ int w = t->GetWidth();
+ int h = t->GetHeight();
+ int x = f->GetMinX() + sx;
+ int y = f->GetMinY() + sy;
+
+ glBegin(GL_TRIANGLE_STRIP);
+ glTexCoord2i(0, 0); glVertex2i(x , y );
+ glTexCoord2i(w, 0); glVertex2i(x + w, y );
+ glTexCoord2i(0, h); glVertex2i(x , y + h);
+ glTexCoord2i(w, h); glVertex2i(x + w, y + h);
+ glEnd();
+
+ LEAVE;
+}