never gonna give you up
This commit is contained in:
+20
-1
@@ -1,17 +1,36 @@
|
||||
#include "renderer.h"
|
||||
#include "text.h"
|
||||
#include <SDL2/SDL_mixer.h>
|
||||
|
||||
|
||||
int main(void) {
|
||||
renderer_main();
|
||||
Mix_Init(MIX_INIT_MP3);
|
||||
if(Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096) != 0){
|
||||
printf("Music sound could not be open!\n"
|
||||
"SDL_Error: %s\n", Mix_GetError());
|
||||
return 0;
|
||||
}
|
||||
|
||||
Mix_Music *music = Mix_LoadMUS("../assets/music/test.mp3");
|
||||
if(Mix_PlayMusic(music, -1) != 0){
|
||||
printf("Music sound could not be played!\n"
|
||||
"SDL_Error: %s\n", Mix_GetError());
|
||||
Mix_FreeMusic(music);
|
||||
return 0;
|
||||
}
|
||||
|
||||
RenderObject_t text;
|
||||
SDL_Color white = {128, 128, 128, 128};
|
||||
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, 1, white, "ARIAL.TTF", 25, "Hello World") < 0){
|
||||
printf("error");
|
||||
exit(1);
|
||||
}
|
||||
renderer_renderObject(text);
|
||||
while(1);
|
||||
Mix_FreeMusic(music);
|
||||
Mix_CloseAudio();
|
||||
|
||||
text_freeFontCache();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user