mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-07 14:58:05 +00:00
[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
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:
parent
b9c5f8e47f
commit
0468243ac7
@ -229,8 +229,9 @@ RenderCommandData :: struct #raw_union {
|
||||
RenderCommand :: struct {
|
||||
boundingBox: BoundingBox,
|
||||
renderData: RenderCommandData,
|
||||
zIndex: i32,
|
||||
userData: rawptr,
|
||||
id: u32,
|
||||
zIndex: i16,
|
||||
commandType: RenderCommandType,
|
||||
}
|
||||
|
||||
@ -326,6 +327,7 @@ ElementDeclaration :: struct {
|
||||
custom: CustomElementConfig,
|
||||
scroll: ScrollElementConfig,
|
||||
border: BorderElementConfig,
|
||||
userData: rawptr
|
||||
}
|
||||
|
||||
ErrorType :: enum {
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -71,9 +71,13 @@ clayRaylibRender :: proc(renderCommands: ^clay.ClayArray(clay.RenderCommand), al
|
||||
)
|
||||
case clay.RenderCommandType.Image:
|
||||
config := renderCommand.renderData.image
|
||||
tintColor := config.backgroundColor
|
||||
if (tintColor.rgba == 0) {
|
||||
tintColor = { 255, 255, 255, 255 }
|
||||
}
|
||||
// TODO image handling
|
||||
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:
|
||||
raylib.BeginScissorMode(
|
||||
cast(i32)math.round(boundingBox.x),
|
||||
|
Loading…
Reference in New Issue
Block a user