Merge branch 'master' of ssh.marcbarbier.fr:Marc/gamejam-polytech

This commit is contained in:
2023-01-21 10:24:11 +01:00
7 changed files with 75 additions and 36 deletions
+18 -2
View File
@@ -1,6 +1,8 @@
#include "renderer.h"
#include "text.h"
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_surface.h>
int main(void) {
@@ -21,13 +23,27 @@ int main(void) {
}
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, "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);
Mix_FreeMusic(music);
Mix_CloseAudio();