aboutsummaryrefslogtreecommitdiff
path: root/src/fw/renderer.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/fw/renderer.odin')
-rw-r--r--src/fw/renderer.odin56
1 files changed, 5 insertions, 51 deletions
diff --git a/src/fw/renderer.odin b/src/fw/renderer.odin
index 149eff6..7653938 100644
--- a/src/fw/renderer.odin
+++ b/src/fw/renderer.odin
@@ -4,12 +4,15 @@ import "core:log"
import "core:image"
import "core:math"
import "core:math/linalg"
-import "core:math/linalg/glsl"
WHITE :: Color{1, 1, 1, 1}
BLACK :: Color{0, 0, 0, 1}
TRANSPARENT :: Color{0, 0, 0, 0}
+RED :: Color{1, 0, 0, 1}
+GREEN :: Color{0, 1, 0, 1}
+BLUE :: Color{0, 0, 1, 1}
+
Index :: u16
Renderer_Backend :: enum {
@@ -293,7 +296,7 @@ draw_rect_gradient :: proc(
}
}
-draw_rect :: proc(
+draw_rect :: #force_inline proc(
pos: Vec2,
size: Vec2,
depth: f32 = 0,
@@ -312,55 +315,6 @@ draw_rect :: proc(
tex,
lines,
)
- // try_batch_calls(tex.handle, .Triangles if !lines else .Lines, true)
- //
- // depth := depth
- //
- // if depth < -1 || depth > 1 {
- // log.warnf(
- // "Depth is out of range (%v). It will be clamped to -1..1.",
- // depth
- // )
- // depth = math.clamp(depth, -1, 1)
- // }
- //
- // pos := linalg.round(pos)
- //
- // tl := Vertex{{pos.x, pos.y, depth}, {0, 0}, color}
- // tr := Vertex{{pos.x + size.x, pos.y, depth}, {1, 0}, color}
- // bl := Vertex{{pos.x, pos.y + size.y, depth}, {0, 1}, color}
- // br := Vertex{{pos.x + size.x, pos.y + size.y, depth}, {1, 1}, color}
- //
- // start := Index(len(renderer.draw_call.vertices))
- //
- // reserve(&renderer.draw_call.vertices, len(renderer.draw_call.vertices) + 4)
- // _add_vertex(tl)
- // _add_vertex(tr)
- // _add_vertex(bl)
- // _add_vertex(br)
- //
- //
- // if lines {
- // reserve(&renderer.draw_call.indices, len(renderer.draw_call.indices) + 8)
- //
- // _add_index(start, 0)
- // _add_index(start, 1)
- // _add_index(start, 1)
- // _add_index(start, 3)
- // _add_index(start, 3)
- // _add_index(start, 2)
- // _add_index(start, 2)
- // _add_index(start, 0)
- // } else {
- // reserve(&renderer.draw_call.indices, len(renderer.draw_call.indices) + 6)
- //
- // _add_index(start, 0)
- // _add_index(start, 1)
- // _add_index(start, 2)
- // _add_index(start, 2)
- // _add_index(start, 1)
- // _add_index(start, 3)
- // }
}
draw_tex :: proc(