diff options
author | pixel <pixel> | 2003-04-14 15:51:42 +0000 |
---|---|---|
committer | pixel <pixel> | 2003-04-14 15:51:42 +0000 |
commit | e318be8501559a9e53aa9990bf7e07b00c00ee51 (patch) | |
tree | e2df61a572721612437ce6fa81cabc06408a4ed8 /lib/glshape.cc | |
parent | ebc6bb16f895b7c192b9f4c42d1fc4feb41e271c (diff) |
Shapes fixed
Diffstat (limited to 'lib/glshape.cc')
-rw-r--r-- | lib/glshape.cc | 30 |
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; +} |