23 lines
559 B
C
23 lines
559 B
C
#ifndef TEXT_H
|
|
#define TEXT_H
|
|
|
|
#include <SDL.h>
|
|
#include <SDL_ttf.h>
|
|
#include <fontconfig/fontconfig.h>
|
|
|
|
static const FcChar8 *TEXT_FONT_FAMILY = "Liberation Mono";
|
|
static const SDL_Color TEXT_FONT_COLOR = { 255, 255, 255 };
|
|
|
|
typedef struct Text {
|
|
const int POSX;
|
|
const int POSY;
|
|
TTF_Font *TEXT_FONT;
|
|
FcChar8 *TEXT_FONT_FILE;
|
|
} Text;
|
|
|
|
Text* Text_init(int posX, int posY, const FcChar8 *font_style, int font_ptsize);
|
|
void Text_free(Text* text);
|
|
int Text_render(const Text* text, SDL_Renderer *renderer, const char *str, int width, int height);
|
|
|
|
#endif
|