Removed automated event handling (#30)
Co-authored-by: Zachary Levy <zachary@sunforge.is> Reviewed-on: #30
This commit was merged in pull request #30.
This commit is contained in:
@@ -730,21 +730,9 @@ flush_deferred_and_close_backdrop_scope :: proc(
|
||||
prepare_clay_batch :: proc(
|
||||
base_layer: ^Layer,
|
||||
batch: ^ClayBatch,
|
||||
mouse_wheel_delta: [2]f32,
|
||||
frame_time: f32 = 0,
|
||||
custom_draw: Custom_Draw = nil,
|
||||
temp_allocator := context.temp_allocator,
|
||||
) {
|
||||
mouse_pos: [2]f32
|
||||
mouse_flags := sdl.GetMouseState(&mouse_pos.x, &mouse_pos.y)
|
||||
|
||||
// Update clay internals
|
||||
clay.SetPointerState(
|
||||
clay.Vector2{mouse_pos.x - base_layer.bounds.x, mouse_pos.y - base_layer.bounds.y},
|
||||
.LEFT in mouse_flags,
|
||||
)
|
||||
clay.UpdateScrollContainers(true, mouse_wheel_delta, frame_time)
|
||||
|
||||
layer := base_layer
|
||||
command_count := int(batch.cmds.length)
|
||||
deferred_indices := make([dynamic]i32, 0, 16, temp_allocator)
|
||||
|
||||
@@ -314,7 +314,7 @@ clay_borders :: proc() {
|
||||
bounds = base_layer.bounds,
|
||||
cmds = clay.EndLayout(0),
|
||||
}
|
||||
draw.prepare_clay_batch(base_layer, &clay_batch, {0, 0})
|
||||
draw.prepare_clay_batch(base_layer, &clay_batch)
|
||||
draw.end(gpu, window)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ hellope_clay :: proc() {
|
||||
bounds = base_layer.bounds,
|
||||
cmds = clay.EndLayout(0),
|
||||
}
|
||||
draw.prepare_clay_batch(base_layer, &clay_batch, {0, 0})
|
||||
draw.prepare_clay_batch(base_layer, &clay_batch)
|
||||
draw.end(gpu, window)
|
||||
}
|
||||
}
|
||||
@@ -372,7 +372,7 @@ hellope_custom :: proc() {
|
||||
bounds = base_layer.bounds,
|
||||
cmds = clay.EndLayout(0),
|
||||
}
|
||||
draw.prepare_clay_batch(base_layer, &clay_batch, {0, 0}, custom_draw = draw_custom)
|
||||
draw.prepare_clay_batch(base_layer, &clay_batch, custom_draw = draw_custom)
|
||||
draw.end(gpu, window)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user