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

Comparing deliantra/Deliantra-Client/pango-render.c (file contents):
Revision 1.9 by root, Sat Aug 11 11:41:24 2007 UTC vs.
Revision 1.10 by root, Sat Aug 11 12:07:54 2007 UTC

252 rc_v2f (arr, x12, y2); 252 rc_v2f (arr, x12, y2);
253} 253}
254 254
255void 255void
256pango_opengl_render_layout_subpixel (PangoLayout *layout, 256pango_opengl_render_layout_subpixel (PangoLayout *layout,
257 rc_t *rc,
257 int x, int y, 258 int x, int y,
258 float r, float g, float b, float a, 259 float r, float g, float b, float a,
259 int flags) 260 int flags)
260{ 261{
261 PangoContext *context; 262 PangoContext *context;
266 context = pango_layout_get_context (layout); 267 context = pango_layout_get_context (layout);
267 fontmap = pango_context_get_font_map (context); 268 fontmap = pango_context_get_font_map (context);
268 renderer = _pango_opengl_font_map_get_renderer (PANGO_OPENGL_FONT_MAP (fontmap)); 269 renderer = _pango_opengl_font_map_get_renderer (PANGO_OPENGL_FONT_MAP (fontmap));
269 gl = PANGO_OPENGL_RENDERER (renderer); 270 gl = PANGO_OPENGL_RENDERER (renderer);
270 271
271 gl->rc = rc_alloc (); 272 gl->rc = rc;
272 gl->r = r; 273 gl->r = r;
273 gl->g = g; 274 gl->g = g;
274 gl->b = b; 275 gl->b = b;
275 gl->a = a; 276 gl->a = a;
276 gl->flags = flags; 277 gl->flags = flags;
277 278
278 glEnable (GL_TEXTURE_2D);
279 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
280 glEnable (GL_BLEND);
281 gl_BlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
282 GL_ONE , GL_ONE_MINUS_SRC_ALPHA);
283 glEnable (GL_ALPHA_TEST);
284 glAlphaFunc (GL_GREATER, 0.01f);
285
286 pango_renderer_draw_layout (renderer, layout, x, y); 279 pango_renderer_draw_layout (renderer, layout, x, y);
287
288 rc_draw (gl->rc);
289
290 glDisable (GL_ALPHA_TEST);
291 glDisable (GL_BLEND);
292 glDisable (GL_TEXTURE_2D);
293
294 rc_free (gl->rc);
295} 280}
296 281
297void 282void
298pango_opengl_render_layout (PangoLayout *layout, 283pango_opengl_render_layout (PangoLayout *layout,
284 rc_t *rc,
299 int x, int y, 285 int x, int y,
300 float r, float g, float b, float a, 286 float r, float g, float b, float a,
301 int flags) 287 int flags)
302{ 288{
303 pango_opengl_render_layout_subpixel (layout, x * PANGO_SCALE, y * PANGO_SCALE, r, g, b, a, flags); 289 pango_opengl_render_layout_subpixel (
290 layout, rc, x * PANGO_SCALE, y * PANGO_SCALE, r, g, b, a, flags
291 );
304} 292}
305 293
306static void 294static void
307pango_opengl_renderer_init (PangoOpenGLRenderer *renderer) 295pango_opengl_renderer_init (PangoOpenGLRenderer *renderer)
308{ 296{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines