--- deliantra/Deliantra-Client/Client.xs 2006/04/10 19:34:03 1.11 +++ deliantra/Deliantra-Client/Client.xs 2006/04/10 22:16:33 1.12 @@ -106,8 +106,26 @@ MODULE = Crossfire::Client PACKAGE = Crossfire::Client::Texture void -texture_quad (SV *self, double x0, double y0, double w, double h) +draw_quad (SV *self, double x, double y, double w = 0, double h = 0) + PROTOTYPE: $$$;$$ CODE: { - //glBegin + HV *hv = (HV *)SvRV (self); + double s = SvNV (*hv_fetch (hv, "s", 1, 1)); + double t = SvNV (*hv_fetch (hv, "t", 1, 1)); + int name = SvIV (*hv_fetch (hv, "name", 4, 1)); + + if (items < 5) + { + w = SvNV (*hv_fetch (hv, "width", 5, 1)); + h = SvNV (*hv_fetch (hv, "height", 6, 1)); + } + + glBindTexture (GL_TEXTURE_2D, name); + glBegin (GL_QUADS); + glTexCoord2d (0, 0); glVertex2d (x , y ); + glTexCoord2d (0, t); glVertex2d (x , y + h); + glTexCoord2d (s, t); glVertex2d (x + w, y + h); + glTexCoord2d (s, 0); glVertex2d (x + w, y ); + glEnd (); }