1111mod glfw;
1212mod graphics;
1313
14- use graphics:: { Geometry , Graphics , Image , Topology , get_graphics, get_graphics_mut} ;
14+ use graphics:: { Geometry , Graphics , Image , Light , Topology , get_graphics, get_graphics_mut} ;
1515use pyo3:: { exceptions:: PyRuntimeError , prelude:: * , types:: PyTuple } ;
1616
1717use std:: env;
@@ -20,7 +20,7 @@ use std::env;
2020fn processing ( m : & Bound < ' _ , PyModule > ) -> PyResult < ( ) > {
2121 m. add_class :: < Graphics > ( ) ?;
2222 m. add_class :: < Image > ( ) ?;
23- m. add_class :: < Geometry > ( ) ?;
23+ m. add_class :: < Light > ( ) ?;
2424 m. add_class :: < Topology > ( ) ?;
2525 m. add_function ( wrap_pyfunction ! ( size, m) ?) ?;
2626 m. add_function ( wrap_pyfunction ! ( run, m) ?) ?;
@@ -40,6 +40,7 @@ fn processing(m: &Bound<'_, PyModule>) -> PyResult<()> {
4040 m. add_function ( wrap_pyfunction ! ( rect, m) ?) ?;
4141 m. add_function ( wrap_pyfunction ! ( image, m) ?) ?;
4242 m. add_function ( wrap_pyfunction ! ( draw_geometry, m) ?) ?;
43+ m. add_function ( wrap_pyfunction ! ( create_directional_light, m) ?) ?;
4344
4445 Ok ( ( ) )
4546}
@@ -223,3 +224,15 @@ fn rect(
223224fn image ( module : & Bound < ' _ , PyModule > , image_file : & str ) -> PyResult < Image > {
224225 get_graphics ( module) ?. image ( image_file)
225226}
227+
228+ #[ pyfunction]
229+ #[ pyo3( pass_module, signature = ( r, g, b, illuminance) ) ]
230+ fn create_directional_light (
231+ module : & Bound < ' _ , PyModule > ,
232+ r : f32 ,
233+ g : f32 ,
234+ b : f32 ,
235+ illuminance : f32 ,
236+ ) -> PyResult < Light > {
237+ get_graphics ( module) ?. light_directional ( r, g, b, illuminance)
238+ }
0 commit comments