From e318be8501559a9e53aa9990bf7e07b00c00ee51 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 14 Apr 2003 15:51:42 +0000 Subject: Shapes fixed --- lib/glshape.cc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'lib/glshape.cc') 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; +} -- cgit v1.2.3