Sa marche putain!

This commit is contained in:
Marc
2023-01-21 10:15:27 +01:00
parent 2d62bfc599
commit 2f0a199e95
7 changed files with 73 additions and 36 deletions
+18 -2
View File
@@ -1,16 +1,32 @@
#include "renderer.h"
#include "text.h"
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_surface.h>
int main(void) {
renderer_main();
RenderObject_t text;
SDL_Color white = {128, 128, 128, 128};
SDL_Color white = {255, 255, 255, 255};
TTF_Init();
if(text_renderText(&text, 0.f, 0.f, 1, white, "/home/gryf/.local/share/fonts/ARIAL.TTF", 25, "Hello World") < 0){
if(text_renderText(&text, 0.f, 0.f, 1000, 1, white, "/usr/share/fonts/TTF/arial.ttf", 25, "Hello World") < 0){
printf("error");
exit(1);
}
SDL_Surface* img = IMG_Load("pp.png");
RenderObject_t duck = {
0.2,
0.2,
0,
0.50,
0.50,
0,
img
};
renderer_renderObject(text);
renderer_renderObject(duck);
while(1);
text_freeFontCache();