#include #include "intro.h" #define FONT_SIZE 36 void display_loading(void) { int window_width = GetRenderWidth(); int window_height = GetRenderHeight(); int loading_width = MeasureText("Loading...", FONT_SIZE); BeginDrawing(); DrawText("Loading...", window_width - loading_width, window_height - FONT_SIZE, FONT_SIZE, RAYWHITE); EndDrawing(); } Intro *load_intro(void) { Intro *i = malloc(sizeof(Intro)); i->textures = malloc(sizeof(Texture) * 2); Image bgb = LoadImage("img/made_by_bgb.png"); i->textures[0] = LoadTextureFromImage(bgb); UnloadImage(bgb); Image ray = LoadImage("img/made_w_raylib.png"); i->textures[1] = LoadTextureFromImage(ray); UnloadImage(ray); i->texture_count = 2; i->timer = 0.; return i; } void intro_display(Intro *intro) { for (int i = 0; i < intro->texture_count; i++) { intro->timer = GetTime() + 2.0; BeginDrawing(); DrawTexture(intro->textures[i], 0, 0, WHITE); EndDrawing(); while(GetTime() < intro->timer) {} } }