wip : trying to get layered text rendering working

This commit is contained in:
2024-06-23 20:22:36 -04:00
parent 55b80da8e5
commit 7d41fcc335
13 changed files with 311 additions and 113 deletions

View File

@ -19,6 +19,22 @@ intersects_range2 :: #force_inline proc "contextless" ( a, b: Range2 ) -> bool
return true;
}
// AABB: Separating Axis Theorem
overlap_range2 :: #force_inline proc "contextless" ( a, b: Range2 ) -> bool
{
// Check if there's no overlap on the x-axis
if a.max.x <= b.min.x || b.max.x <= a.min.x {
return false; // No overlap on x-axis means no intersection
}
// Check if there's no overlap on the y-axis
if a.max.y <= b.min.y || b.max.y <= a.min.y {
return false; // No overlap on y-axis means no intersection
}
// If neither of the above conditions are true, there's at least a partial overlap
return true;
}
// TODO(Ed): Do we need this? Also does it even work (looks unfinished)?
is_within_screenspace :: #force_inline proc "contextless" ( pos : Vec2 ) -> b32 {
state := get_state(); using state