remove label from argument Renderer.draw_rect ~bb

This commit is contained in:
tali 2024-01-19 19:04:08 -05:00
parent 9162e9f3b4
commit 5f31d1eb7f
3 changed files with 4 additions and 6 deletions

View File

@ -105,7 +105,7 @@ module Sprite_graph = struct
let rec render_rec ren = function
| [] -> ()
| { tf; bb; fill } :: nodes ->
S2.Renderer.draw_rect ren ~tf ~bb ~fill;
S2.Renderer.draw_rect ren bb ~tf ~fill;
render_rec ren nodes
let render t ~ren =

View File

@ -334,20 +334,18 @@ let clear _t (bg : color) =
Gl.clear Gl.color_buffer_bit;
end
let draw_rect t ~tf ~bb ~fill =
let draw_rect t ~tf ~fill rect =
let sh = t.polygon in
begin
(* TODO: cache/store uniform locations in some way *)
use sh;
set_mat2a (uniform sh "Transform") tf;
set_aabb (uniform sh "BoundingBox") bb;
set_aabb (uniform sh "BoundingBox") rect;
set_int (uniform sh "Border") 0;
set_color (uniform sh "Fill") fill;
draw_geometry t.polygon_rect;
end
let _white = Color.white ()
let draw_texture t ~tf ~rect ~clip ~tint tex =
let sh = t.sprite in
begin

View File

@ -36,7 +36,7 @@ module Renderer : sig
val pre_draw : t -> unit
val post_draw : t -> unit
val clear : t -> color -> unit
val draw_rect : t -> tf:mat2a -> bb:aabb -> fill:color -> unit
val draw_rect : t -> tf:mat2a -> fill:color -> aabb -> unit
val draw_sprite : t -> tf:mat2a -> ?tint:color -> ?pos:vec2 -> Sprite.t -> unit
end