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.8 by root, Sun Apr 9 01:19:15 2006 UTC vs.
Revision 1.10 by root, Sun Apr 9 17:34:15 2006 UTC

6 6
7#include <SDL.h> 7#include <SDL.h>
8#include <SDL_opengl.h> 8#include <SDL_opengl.h>
9 9
10#include <pango/pango.h> 10#include <pango/pango.h>
11#include <pango/pangofc-fontmap.h>
11#include <pango/pangoft2.h> 12#include <pango/pangoft2.h>
13
14#include <sys/types.h>
15#include <sys/socket.h>
16#include <netinet/in.h>
17#include <netinet/tcp.h>
12 18
13static PangoContext *context; 19static PangoContext *context;
14static PangoFontMap *fontmap; 20static PangoFontMap *fontmap;
15 21
16MODULE = Crossfire::Client PACKAGE = Crossfire::Client 22MODULE = Crossfire::Client PACKAGE = Crossfire::Client
18BOOT: 24BOOT:
19{ 25{
20 fontmap = pango_ft2_font_map_new (); 26 fontmap = pango_ft2_font_map_new ();
21 context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)fontmap); 27 context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)fontmap);
22} 28}
29
30void
31lowdelay (int fd, int val = 1)
32 CODE:
33 setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val));
23 34
24char * 35char *
25gl_version () 36gl_version ()
26 CODE: 37 CODE:
27 RETVAL = (char *)glGetString (GL_VERSION); 38 RETVAL = (char *)glGetString (GL_VERSION);
34 RETVAL = (char *)glGetString (GL_EXTENSIONS); 45 RETVAL = (char *)glGetString (GL_EXTENSIONS);
35 OUTPUT: 46 OUTPUT:
36 RETVAL 47 RETVAL
37 48
38void 49void
39add_font (char *file) 50set_font (char *file)
40 CODE: 51 CODE:
41 FcConfigAppFontAddFile (0, (const FcChar8 *)file);
42
43void
44set_font (char *pango_font)
45 CODE:
46{ 52{
53 int count;
54 FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)file, 0, 0, &count);
55 FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */
47 PangoFontDescription *font = pango_font_description_from_string (pango_font); 56 PangoFontDescription *font = pango_fc_font_description_from_pattern (pattern, 0);
57 FcPatternDestroy (pattern);
48 pango_context_set_font_description (context, font); 58 pango_context_set_font_description (context, font);
49} 59}
50 60
51void 61void
52font_render (SV *text_, int height = 10) 62font_render (SV *text_, int height = 10)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines