Skip to content

Commit

Permalink
Try to fix Raylib example test
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksiiBulba committed Dec 20, 2024
1 parent 3b077cf commit ab007dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions examples/raylib-sidebar-scrolling-container/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#define CLAY_IMPLEMENTATION
#include "../../clay.h"
#include <raylib.h>
#include <stdio.h>
#include <stdlib.h>
#include "../../renderers/raylib/raylib.h"
#include "../../renderers/clay_renderer.h"

const uint32_t FONT_ID_BODY_24 = 0;
Expand Down Expand Up @@ -209,7 +211,12 @@ int main(void) {
Clay_SetMeasureTextFunction(Clay_Renderer_MeasureText);
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,
.height = 768,
.title = "Clay - Raylib Renderer Example",
Expand Down
4 changes: 2 additions & 2 deletions renderers/raylib/clay_renderer_raylib.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ inline Clay_Dimensions Clay_Renderer_MeasureText(Clay_String *text, Clay_TextEle
return textSize;
}

struct Clay_Renderer_Data {
typedef struct Clay_Renderer_Data {
int width;
int height;
const char *title;
unsigned int flags;
};
} Clay_Raylib_Data;

void Clay_Renderer_Initialize(struct Clay_Renderer_Data *data) {
SetConfigFlags(data->flags);
Expand Down

0 comments on commit ab007dc

Please sign in to comment.