pong/src/text.h

23 lines
583 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 TTF_Font *TEXT_FONT = NULL;
static FcChar8 *TEXT_FONT_FILE = NULL;
static const SDL_Color TEXT_FONT_COLOR = { 255, 255, 255 };
typedef struct Text {
const int POSX;
const int POSY;
} 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