mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-20 05:08:04 +00:00
Fixed Raylib example test
This commit is contained in:
parent
1601c6db95
commit
8f74eed85f
@ -195,7 +195,7 @@ void UpdateDrawFrame(void)
|
|||||||
// currentTime = GetTime();
|
// currentTime = GetTime();
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
ClearBackground(BLACK);
|
ClearBackground(BLACK);
|
||||||
Clay_Raylib_Render(renderCommands);
|
Clay_Renderer_Render(renderCommands);
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
// printf("render time: %f ms\n", (GetTime() - currentTime) * 1000);
|
// printf("render time: %f ms\n", (GetTime() - currentTime) * 1000);
|
||||||
|
|
||||||
@ -205,9 +205,15 @@ void UpdateDrawFrame(void)
|
|||||||
int main(void) {
|
int main(void) {
|
||||||
uint64_t totalMemorySize = Clay_MinMemorySize();
|
uint64_t totalMemorySize = Clay_MinMemorySize();
|
||||||
Clay_Arena clayMemory = (Clay_Arena) { .label = CLAY_STRING("Clay Memory Arena"), .memory = malloc(totalMemorySize), .capacity = totalMemorySize };
|
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_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"));
|
profilePicture = LoadTextureFromImage(LoadImage("resources/profile-picture.png"));
|
||||||
Raylib_fonts[FONT_ID_BODY_24] = (Raylib_Font) {
|
Raylib_fonts[FONT_ID_BODY_24] = (Raylib_Font) {
|
||||||
.font = LoadFontEx("resources/Roboto-Regular.ttf", 48, 0, 400),
|
.font = LoadFontEx("resources/Roboto-Regular.ttf", 48, 0, 400),
|
||||||
|
Loading…
Reference in New Issue
Block a user