Refactor audio and texture into own files

This commit is contained in:
2024-10-13 22:43:33 +08:00
parent 92d3e150cb
commit 64195dd5a9
7 changed files with 293 additions and 259 deletions
+20
View File
@@ -0,0 +1,20 @@
#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;
int text_texture_init(text_texture* text_texture, SDL_Renderer* renderer);
int text_texture_load(text_texture* text_texture, char* string);
int text_texture_render(text_texture* text_texture, int x, int y);
int text_texture_free(text_texture* text_texture);
#endif