2024-10-13 22:43:33 +08:00
|
|
|
#ifndef TEXTURE_H
|
|
|
|
#define TEXTURE_H
|
|
|
|
|
|
|
|
#include <SDL2/SDL_ttf.h>
|
|
|
|
#include "SDL2/SDL.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SDL_Texture* texture;
|
|
|
|
SDL_Renderer* renderer;
|
|
|
|
TTF_Font* font;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
} text_texture;
|
|
|
|
|
2024-11-08 22:46:33 +08:00
|
|
|
typedef struct {
|
|
|
|
text_texture* textures;
|
|
|
|
int len;
|
|
|
|
} text_texture_frame;
|
|
|
|
|
|
|
|
int text_texture_init(text_texture* text_texture, SDL_Renderer* renderer, int font_size);
|
2024-10-13 22:43:33 +08:00
|
|
|
int text_texture_load(text_texture* text_texture, char* string);
|
|
|
|
int text_texture_render(text_texture* text_texture, int x, int y);
|
2024-11-08 22:46:33 +08:00
|
|
|
int text_texture_destroy(text_texture* text_texture);
|
|
|
|
|
|
|
|
int text_texture_frame_init(text_texture_frame* text_texture_frame, int len, SDL_Renderer* renderer, int font_size);
|
|
|
|
int text_texture_frame_render(text_texture_frame* text_texture_frame, int x, int y);
|
|
|
|
int text_texture_frame_destroy(text_texture_frame* text_texture_frame);
|
2024-10-13 22:43:33 +08:00
|
|
|
|
|
|
|
#endif
|