@@ -3,6 +3,7 @@ pub mod error;
33pub mod geometry;
44mod graphics;
55pub mod image;
6+ pub mod light;
67pub mod render;
78mod surface;
89pub mod transform;
@@ -25,7 +26,10 @@ use tracing::debug;
2526use crate :: geometry:: { AttributeFormat , AttributeValue } ;
2627use crate :: graphics:: flush;
2728use crate :: {
28- graphics:: GraphicsPlugin , image:: ImagePlugin , render:: command:: DrawCommand ,
29+ graphics:: GraphicsPlugin ,
30+ image:: ImagePlugin ,
31+ light:: { LightPlugin , LightType } ,
32+ render:: command:: DrawCommand ,
2933 surface:: SurfacePlugin ,
3034} ;
3135
@@ -248,6 +252,7 @@ fn create_app(config: Config) -> App {
248252 GraphicsPlugin ,
249253 SurfacePlugin ,
250254 geometry:: GeometryPlugin ,
255+ LightPlugin ,
251256 ) ) ;
252257 app. add_systems ( First , ( clear_transient_meshes, activate_cameras) )
253258 . add_systems ( Update , flush_draw_commands. before ( AssetEventSystems ) ) ;
@@ -774,6 +779,16 @@ pub fn image_destroy(entity: Entity) -> error::Result<()> {
774779 } )
775780}
776781
782+ // pub fn geometry_box(width: f32, height: f32, depth: f32) -> error::Result<Entity> {
783+ pub fn light_create ( light_type : LightType , x : f32 , y : f32 , z : f32 ) -> error:: Result < Entity > {
784+ app_mut ( |app| {
785+ Ok ( app
786+ . world_mut ( )
787+ . run_system_cached_with ( light:: create, ( light_type, x, y, z) )
788+ . unwrap ( ) )
789+ } )
790+ }
791+
777792pub fn geometry_layout_create ( ) -> error:: Result < Entity > {
778793 app_mut ( |app| {
779794 Ok ( app
0 commit comments