ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.11 by root, Mon Apr 10 19:34:03 2006 UTC vs.
Revision 1.13 by root, Tue Apr 11 12:27:51 2006 UTC

47 RETVAL = (char *)glGetString (GL_EXTENSIONS); 47 RETVAL = (char *)glGetString (GL_EXTENSIONS);
48 OUTPUT: 48 OUTPUT:
49 RETVAL 49 RETVAL
50 50
51void 51void
52add_font (char *file)
53 CODE:
54 FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */
55
56void
52set_font (char *file) 57set_font (char *file)
53 CODE: 58 CODE:
54{ 59{
55 int count; 60 int count;
56 FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)file, 0, 0, &count); 61 FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)file, 0, 0, &count);
57 FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */
58 PangoFontDescription *font = pango_fc_font_description_from_pattern (pattern, 0); 62 PangoFontDescription *font = pango_fc_font_description_from_pattern (pattern, 0);
59 FcPatternDestroy (pattern); 63 FcPatternDestroy (pattern);
60 pango_context_set_font_description (context, font); 64 pango_context_set_font_description (context, font);
61} 65}
66
67MODULE = Crossfire::Client PACKAGE = Crossfire::Client
62 68
63void 69void
64font_render (SV *text_, int height = 10) 70font_render (SV *text_, int height = 10)
65 PPCODE: 71 PPCODE:
66{ 72{
104} 110}
105 111
106MODULE = Crossfire::Client PACKAGE = Crossfire::Client::Texture 112MODULE = Crossfire::Client PACKAGE = Crossfire::Client::Texture
107 113
108void 114void
109texture_quad (SV *self, double x0, double y0, double w, double h) 115draw_quad (SV *self, double x, double y, double w = 0, double h = 0)
116 PROTOTYPE: $$$;$$
110 CODE: 117 CODE:
111{ 118{
112 //glBegin 119 HV *hv = (HV *)SvRV (self);
120 double s = SvNV (*hv_fetch (hv, "s", 1, 1));
121 double t = SvNV (*hv_fetch (hv, "t", 1, 1));
122 int name = SvIV (*hv_fetch (hv, "name", 4, 1));
123
124 if (items < 5)
125 {
126 w = SvNV (*hv_fetch (hv, "width", 5, 1));
127 h = SvNV (*hv_fetch (hv, "height", 6, 1));
128 }
129
130 glBindTexture (GL_TEXTURE_2D, name);
131 glBegin (GL_QUADS);
132 glTexCoord2d (0, 0); glVertex2d (x , y );
133 glTexCoord2d (0, t); glVertex2d (x , y + h);
134 glTexCoord2d (s, t); glVertex2d (x + w, y + h);
135 glTexCoord2d (s, 0); glVertex2d (x + w, y );
136 glEnd ();
113} 137}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines