Try to fix Raylib example test

This commit is contained in:
Oleksii Bulba 2024-12-20 22:19:02 +04:00
parent 3b077cfe30
commit ab007dc8ff
2 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,8 @@
#define CLAY_IMPLEMENTATION #define CLAY_IMPLEMENTATION
#include "../../clay.h" #include "../../clay.h"
#include <raylib.h> #include <stdio.h>
#include <stdlib.h>
#include "../../renderers/raylib/raylib.h"
#include "../../renderers/clay_renderer.h" #include "../../renderers/clay_renderer.h"
const uint32_t FONT_ID_BODY_24 = 0; const uint32_t FONT_ID_BODY_24 = 0;
@ -209,7 +211,12 @@ int main(void) {
Clay_SetMeasureTextFunction(Clay_Renderer_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_Renderer_Initialize(&(struct Clay_Renderer_Data){ Clay_Renderer_Initialize((struct Clay_Renderer_Data)&(struct {
int width;
int height;
const char *title;
int flags;
}){
.width = 1024, .width = 1024,
.height = 768, .height = 768,
.title = "Clay - Raylib Renderer Example", .title = "Clay - Raylib Renderer Example",

View File

@ -138,12 +138,12 @@ inline Clay_Dimensions Clay_Renderer_MeasureText(Clay_String *text, Clay_TextEle
return textSize; return textSize;
} }
struct Clay_Renderer_Data { typedef struct Clay_Renderer_Data {
int width; int width;
int height; int height;
const char *title; const char *title;
unsigned int flags; unsigned int flags;
}; } Clay_Raylib_Data;
void Clay_Renderer_Initialize(struct Clay_Renderer_Data *data) { void Clay_Renderer_Initialize(struct Clay_Renderer_Data *data) {
SetConfigFlags(data->flags); SetConfigFlags(data->flags);