From 8f74eed85ffa485f6a3d4197a4aa652f10b77774 Mon Sep 17 00:00:00 2001 From: Oleksii Bulba Date: Fri, 20 Dec 2024 20:42:14 +0400 Subject: [PATCH] Fixed Raylib example test --- examples/raylib-sidebar-scrolling-container/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/raylib-sidebar-scrolling-container/main.c b/examples/raylib-sidebar-scrolling-container/main.c index 8fc1d63..59df7bb 100644 --- a/examples/raylib-sidebar-scrolling-container/main.c +++ b/examples/raylib-sidebar-scrolling-container/main.c @@ -195,7 +195,7 @@ void UpdateDrawFrame(void) // currentTime = GetTime(); BeginDrawing(); ClearBackground(BLACK); - Clay_Raylib_Render(renderCommands); + Clay_Renderer_Render(renderCommands); EndDrawing(); // printf("render time: %f ms\n", (GetTime() - currentTime) * 1000); @@ -205,9 +205,15 @@ void UpdateDrawFrame(void) int main(void) { uint64_t totalMemorySize = Clay_MinMemorySize(); Clay_Arena clayMemory = (Clay_Arena) { .label = CLAY_STRING("Clay Memory Arena"), .memory = malloc(totalMemorySize), .capacity = totalMemorySize }; - Clay_SetMeasureTextFunction(Raylib_MeasureText); + Clay_SetMeasureTextFunction(Clay_Renderer_MeasureText); Clay_Initialize(clayMemory, (Clay_Dimensions) { (float)GetScreenWidth(), (float)GetScreenHeight() }); - Clay_Raylib_Initialize(1024, 768, "Clay - Raylib Renderer Example", FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI | FLAG_MSAA_4X_HINT); + + Clay_Renderer_Initialize(&(struct Clay_Renderer_Data){ + .width = 1024, + .height = 768, + .title = "Clay - Raylib Renderer Example", + .flags = FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI | FLAG_MSAA_4X_HINT + }); profilePicture = LoadTextureFromImage(LoadImage("resources/profile-picture.png")); Raylib_fonts[FONT_ID_BODY_24] = (Raylib_Font) { .font = LoadFontEx("resources/Roboto-Regular.ttf", 48, 0, 400),