Added ability to open, close and render fonts

This commit is contained in:
abdelrahman committed 2022-09-25 15:58:54 +01:00
1 parent e3f4f9c94f
commit dbc8c88b89
6 files changed
+111 -9

No files matched your search

+15
View File
@@ -43,6 +43,21 @@ void render_clear(const Renderer *renderer, SDL_Color color) {
SDL_RenderClear(renderer->SDL_base_renderer);
}
void render_surface(const Renderer *renderer, SDL_Surface *surface, float x,
float y, float w, float h) {
SDL_Texture *texture =
SDL_CreateTextureFromSurface(renderer->SDL_base_renderer, surface);
if (!texture) {
return;
}
render_texture(renderer, texture, x, y, w, h);
SDL_DestroyTexture(texture);
texture = NULL;
}
void render_texture(const Renderer *renderer, SDL_Texture *texture, float x,
float y, float w, float h) {
if (!renderer || !texture) {