@@ -448,6 +448,60 @@ pub extern "C" fn processing_pop_matrix(graphics_id: u64) {
448448 error:: check ( || graphics_record_command ( graphics_entity, DrawCommand :: PopMatrix ) ) ;
449449}
450450
451+ /// Push the current style onto the style stack.
452+ ///
453+ /// SAFETY:
454+ /// - graphics_id is a valid ID returned from graphics_create.
455+ /// - This is called from the same thread as init.
456+ #[ unsafe( no_mangle) ]
457+ pub extern "C" fn processing_push_style ( graphics_id : u64 ) {
458+ error:: clear_error ( ) ;
459+ let graphics_entity = Entity :: from_bits ( graphics_id) ;
460+ error:: check ( || graphics_record_command ( graphics_entity, DrawCommand :: PushStyle ) ) ;
461+ }
462+
463+ /// Pop the most recently saved style off the style stack.
464+ ///
465+ /// SAFETY:
466+ /// - graphics_id is a valid ID returned from graphics_create.
467+ /// - This is called from the same thread as init.
468+ #[ unsafe( no_mangle) ]
469+ pub extern "C" fn processing_pop_style ( graphics_id : u64 ) {
470+ error:: clear_error ( ) ;
471+ let graphics_entity = Entity :: from_bits ( graphics_id) ;
472+ error:: check ( || graphics_record_command ( graphics_entity, DrawCommand :: PopStyle ) ) ;
473+ }
474+
475+ /// Push both the style and the transformation matrix onto their stacks.
476+ ///
477+ /// SAFETY:
478+ /// - graphics_id is a valid ID returned from graphics_create.
479+ /// - This is called from the same thread as init.
480+ #[ unsafe( no_mangle) ]
481+ pub extern "C" fn processing_push ( graphics_id : u64 ) {
482+ error:: clear_error ( ) ;
483+ let graphics_entity = Entity :: from_bits ( graphics_id) ;
484+ error:: check ( || {
485+ graphics_record_command ( graphics_entity, DrawCommand :: PushStyle ) ?;
486+ graphics_record_command ( graphics_entity, DrawCommand :: PushMatrix )
487+ } ) ;
488+ }
489+
490+ /// Pop both the style and the transformation matrix off their stacks.
491+ ///
492+ /// SAFETY:
493+ /// - graphics_id is a valid ID returned from graphics_create.
494+ /// - This is called from the same thread as init.
495+ #[ unsafe( no_mangle) ]
496+ pub extern "C" fn processing_pop ( graphics_id : u64 ) {
497+ error:: clear_error ( ) ;
498+ let graphics_entity = Entity :: from_bits ( graphics_id) ;
499+ error:: check ( || {
500+ graphics_record_command ( graphics_entity, DrawCommand :: PopStyle ) ?;
501+ graphics_record_command ( graphics_entity, DrawCommand :: PopMatrix )
502+ } ) ;
503+ }
504+
451505/// Reset the transformation matrix to identity.
452506///
453507/// SAFETY:
0 commit comments