summaryrefslogtreecommitdiff
path: root/meme/text.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2014-09-14 14:59:25 (GMT)
committerWerner Almesberger <werner@almesberger.net>2014-09-14 14:59:25 (GMT)
commit57e0603cd3cf68f8adaefb32eec7efd17c43f99b (patch)
tree4de1a8e635bbf0f0ab295a8d971daaab69082b1a /meme/text.c
parente2dc06ebc066399e7274a6627127f725e1f07b17 (diff)
downloadmisc-57e0603cd3cf68f8adaefb32eec7efd17c43f99b.zip
misc-57e0603cd3cf68f8adaefb32eec7efd17c43f99b.tar.gz
misc-57e0603cd3cf68f8adaefb32eec7efd17c43f99b.tar.bz2
meme/: use SDL_GetVideoInfo to set up SDL_AllocSurface, instead of SDL_DisplayFormat
Diffstat (limited to 'meme/text.c')
-rw-r--r--meme/text.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/meme/text.c b/meme/text.c
index 4a4f33c..c01eec0 100644
--- a/meme/text.c
+++ b/meme/text.c
@@ -17,6 +17,7 @@
#include "SDL.h"
#include "SDL_Pango.h"
+#include "gaux.h"
#include "text.h"
@@ -45,7 +46,7 @@ void text_color(Uint32 rgba)
SDL_Surface *text(const char *s)
{
SDLPango_Context *pango;
- SDL_Surface *tmp, *surf;
+ SDL_Surface *surf;
int w, h;
pango = SDLPango_CreateContext_GivenFontDesc(text_font);
@@ -58,9 +59,7 @@ SDL_Surface *text(const char *s)
w = SDLPango_GetLayoutWidth(pango);
h = SDLPango_GetLayoutHeight(pango);
- tmp = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 0, 0, 0, 0, 0);
- surf = SDL_DisplayFormat(tmp);
- SDL_FreeSurface(tmp);
+ surf = sdl_surface(SDL_SWSURFACE, w, h);
SDLPango_Draw(pango, surf, 0, 0);