add N2.mli
This commit is contained in:
parent
a691757921
commit
5ce8d30f89
|
@ -32,7 +32,8 @@ let main () =
|
||||||
)
|
)
|
||||||
in
|
in
|
||||||
let ty = 400.0 in
|
let ty = 400.0 in
|
||||||
Mat2A.set (TG.model root.transform) ~tx ~ty ~sx:1.0 ~sy:1.0
|
let tf = TG.model (Scene.transform root) in
|
||||||
|
Mat2A.set tf ~tx ~ty ~sx:1.0 ~sy:1.0
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Renderer.pre_draw ren;
|
Renderer.pre_draw ren;
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
open Adam
|
||||||
|
open S2
|
||||||
|
module Sexp = Sexplib0.Sexp
|
||||||
|
|
||||||
|
module Transform_graph : sig
|
||||||
|
type t
|
||||||
|
type node
|
||||||
|
|
||||||
|
val make : unit -> t
|
||||||
|
val update : t -> unit
|
||||||
|
|
||||||
|
val add : ?parent:node -> t -> node
|
||||||
|
val model : node -> mat2a
|
||||||
|
val world : node -> mat2a
|
||||||
|
end
|
||||||
|
|
||||||
|
module Sprite_graph : sig
|
||||||
|
type t
|
||||||
|
type node
|
||||||
|
|
||||||
|
val make : unit -> t
|
||||||
|
val render : t -> ren:Renderer.t -> unit
|
||||||
|
|
||||||
|
val add_rect : t -> tf:mat2a -> bb:aabb -> fill:color -> node
|
||||||
|
end
|
||||||
|
|
||||||
|
module Scene : sig
|
||||||
|
type t
|
||||||
|
type obj
|
||||||
|
|
||||||
|
val load : string ->
|
||||||
|
tg:Transform_graph.t ->
|
||||||
|
sg:Sprite_graph.t ->
|
||||||
|
t
|
||||||
|
|
||||||
|
val get : t -> string -> obj
|
||||||
|
val transform : obj -> Transform_graph.node
|
||||||
|
end
|
Loading…
Reference in New Issue