mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-20 21:28:03 +00:00
More readme fixes
This commit is contained in:
parent
04239a2c6e
commit
71bd99191e
@ -121,17 +121,16 @@ CreateLayout :: proc() -> clay.ClayArray(clay.RenderCommand) {
|
||||
|
||||
6. Call [clay.EndLayout(screenWidth, screenHeight)](https://github.com/nicbarker/clay/blob/main/README.md#clay_endlayout) and process the resulting [clay.RenderCommandArray](https://github.com/nicbarker/clay/blob/main/README.md#clay_rendercommandarray) in your choice of renderer.
|
||||
|
||||
```C
|
||||
renderCommands: clay.RenderCommandArray = clay.EndLayout(windowWidth, windowHeight);
|
||||
```Odin
|
||||
renderCommands: clay.ClayArray(clay.RenderCommand) = clay.EndLayout(windowWidth, windowHeight)
|
||||
|
||||
for i := 0; i < renderCommands.length; i += 1 {
|
||||
renderCommand := clay.RenderCommandArray_Get(renderCommands, cast(i32)i)
|
||||
for i: u32 = 0; i < renderCommands.length; i += 1 {
|
||||
renderCommand := clay.RenderCommandArray_Get(&renderCommands, cast(i32)i)
|
||||
|
||||
switch (renderCommand->commandType) {
|
||||
case CLAY_RENDER_COMMAND_TYPE_RECTANGLE: {
|
||||
DrawRectangle(
|
||||
renderCommand.boundingBox,
|
||||
renderCommand.config.rectangleElementConfig.color);
|
||||
switch renderCommand.commandType {
|
||||
case .Rectangle:
|
||||
{
|
||||
DrawRectangle(renderCommand.boundingBox, renderCommand.config.rectangleElementConfig.color)
|
||||
}
|
||||
// ... Implement handling of other command types
|
||||
}
|
||||
|
@ -58,5 +58,18 @@ CreateLayout :: proc() -> clay.ClayArray(clay.RenderCommand) {
|
||||
clay.RectangleConfig({color = COLOR_LIGHT}),
|
||||
) {}
|
||||
}
|
||||
// ...
|
||||
|
||||
renderCommands: clay.ClayArray(clay.RenderCommand) = clay.EndLayout(windowWidth, windowHeight)
|
||||
|
||||
for i: u32 = 0; i < renderCommands.length; i += 1 {
|
||||
renderCommand := clay.RenderCommandArray_Get(&renderCommands, cast(i32)i)
|
||||
|
||||
switch renderCommand.commandType {
|
||||
case .Rectangle:
|
||||
{
|
||||
DrawRectangle(renderCommand.boundingBox, renderCommand.config.rectangleElementConfig.color)
|
||||
}
|
||||
// ... Implement handling of other command types
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user