[Bindings/Odin] Update odin bindings for rendercommand changes
Some checks are pending
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Waiting to run

This commit is contained in:
Nic Barker 2025-02-06 19:02:54 +13:00
parent b9c5f8e47f
commit 0468243ac7
7 changed files with 8 additions and 2 deletions

View File

@ -229,8 +229,9 @@ RenderCommandData :: struct #raw_union {
RenderCommand :: struct { RenderCommand :: struct {
boundingBox: BoundingBox, boundingBox: BoundingBox,
renderData: RenderCommandData, renderData: RenderCommandData,
zIndex: i32, userData: rawptr,
id: u32, id: u32,
zIndex: i16,
commandType: RenderCommandType, commandType: RenderCommandType,
} }
@ -326,6 +327,7 @@ ElementDeclaration :: struct {
custom: CustomElementConfig, custom: CustomElementConfig,
scroll: ScrollElementConfig, scroll: ScrollElementConfig,
border: BorderElementConfig, border: BorderElementConfig,
userData: rawptr
} }
ErrorType :: enum { ErrorType :: enum {

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -71,9 +71,13 @@ clayRaylibRender :: proc(renderCommands: ^clay.ClayArray(clay.RenderCommand), al
) )
case clay.RenderCommandType.Image: case clay.RenderCommandType.Image:
config := renderCommand.renderData.image config := renderCommand.renderData.image
tintColor := config.backgroundColor
if (tintColor.rgba == 0) {
tintColor = { 255, 255, 255, 255 }
}
// TODO image handling // TODO image handling
imageTexture := cast(^raylib.Texture2D)config.imageData imageTexture := cast(^raylib.Texture2D)config.imageData
raylib.DrawTextureEx(imageTexture^, raylib.Vector2{boundingBox.x, boundingBox.y}, 0, boundingBox.width / cast(f32)imageTexture.width, clayColorToRaylibColor(config.backgroundColor)) raylib.DrawTextureEx(imageTexture^, raylib.Vector2{boundingBox.x, boundingBox.y}, 0, boundingBox.width / cast(f32)imageTexture.width, clayColorToRaylibColor(tintColor))
case clay.RenderCommandType.ScissorStart: case clay.RenderCommandType.ScissorStart:
raylib.BeginScissorMode( raylib.BeginScissorMode(
cast(i32)math.round(boundingBox.x), cast(i32)math.round(boundingBox.x),