@@ -211,6 +211,110 @@ pub extern "C" fn processing_no_stroke(window_id: u64) {
211211 error:: check ( || graphics_record_command ( window_entity, DrawCommand :: NoStroke ) ) ;
212212}
213213
214+ /// Push the current transformation matrix onto the stack.
215+ ///
216+ /// SAFETY:
217+ /// - Init and surface_create have been called.
218+ /// - window_id is a valid ID returned from surface_create.
219+ /// - This is called from the same thread as init.
220+ #[ unsafe( no_mangle) ]
221+ pub extern "C" fn processing_push_matrix ( window_id : u64 ) {
222+ error:: clear_error ( ) ;
223+ let window_entity = Entity :: from_bits ( window_id) ;
224+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: PushMatrix ) ) ;
225+ }
226+
227+ /// Pop the transformation matrix from the stack.
228+ ///
229+ /// SAFETY:
230+ /// - Init and surface_create have been called.
231+ /// - window_id is a valid ID returned from surface_create.
232+ /// - This is called from the same thread as init.
233+ #[ unsafe( no_mangle) ]
234+ pub extern "C" fn processing_pop_matrix ( window_id : u64 ) {
235+ error:: clear_error ( ) ;
236+ let window_entity = Entity :: from_bits ( window_id) ;
237+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: PopMatrix ) ) ;
238+ }
239+
240+ /// Reset the transformation matrix to identity.
241+ ///
242+ /// SAFETY:
243+ /// - Init and surface_create have been called.
244+ /// - window_id is a valid ID returned from surface_create.
245+ /// - This is called from the same thread as init.
246+ #[ unsafe( no_mangle) ]
247+ pub extern "C" fn processing_reset_matrix ( window_id : u64 ) {
248+ error:: clear_error ( ) ;
249+ let window_entity = Entity :: from_bits ( window_id) ;
250+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: ResetMatrix ) ) ;
251+ }
252+
253+ /// Translate the coordinate system.
254+ ///
255+ /// SAFETY:
256+ /// - Init and surface_create have been called.
257+ /// - window_id is a valid ID returned from surface_create.
258+ /// - This is called from the same thread as init.
259+ #[ unsafe( no_mangle) ]
260+ pub extern "C" fn processing_translate ( window_id : u64 , x : f32 , y : f32 ) {
261+ error:: clear_error ( ) ;
262+ let window_entity = Entity :: from_bits ( window_id) ;
263+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: Translate { x, y } ) ) ;
264+ }
265+
266+ /// Rotate the coordinate system.
267+ ///
268+ /// SAFETY:
269+ /// - Init and surface_create have been called.
270+ /// - window_id is a valid ID returned from surface_create.
271+ /// - This is called from the same thread as init.
272+ #[ unsafe( no_mangle) ]
273+ pub extern "C" fn processing_rotate ( window_id : u64 , angle : f32 ) {
274+ error:: clear_error ( ) ;
275+ let window_entity = Entity :: from_bits ( window_id) ;
276+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: Rotate { angle } ) ) ;
277+ }
278+
279+ /// Scale the coordinate system.
280+ ///
281+ /// SAFETY:
282+ /// - Init and surface_create have been called.
283+ /// - window_id is a valid ID returned from surface_create.
284+ /// - This is called from the same thread as init.
285+ #[ unsafe( no_mangle) ]
286+ pub extern "C" fn processing_scale ( window_id : u64 , x : f32 , y : f32 ) {
287+ error:: clear_error ( ) ;
288+ let window_entity = Entity :: from_bits ( window_id) ;
289+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: Scale { x, y } ) ) ;
290+ }
291+
292+ /// Shear along the X axis.
293+ ///
294+ /// SAFETY:
295+ /// - Init and surface_create have been called.
296+ /// - window_id is a valid ID returned from surface_create.
297+ /// - This is called from the same thread as init.
298+ #[ unsafe( no_mangle) ]
299+ pub extern "C" fn processing_shear_x ( window_id : u64 , angle : f32 ) {
300+ error:: clear_error ( ) ;
301+ let window_entity = Entity :: from_bits ( window_id) ;
302+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: ShearX { angle } ) ) ;
303+ }
304+
305+ /// Shear along the Y axis.
306+ ///
307+ /// SAFETY:
308+ /// - Init and surface_create have been called.
309+ /// - window_id is a valid ID returned from surface_create.
310+ /// - This is called from the same thread as init.
311+ #[ unsafe( no_mangle) ]
312+ pub extern "C" fn processing_shear_y ( window_id : u64 , angle : f32 ) {
313+ error:: clear_error ( ) ;
314+ let window_entity = Entity :: from_bits ( window_id) ;
315+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: ShearY { angle } ) ) ;
316+ }
317+
214318/// Draw a rectangle.
215319///
216320/// SAFETY:
0 commit comments