@@ -76,7 +76,9 @@ pub extern "C" fn processing_surface_resize(window_id: u64, width: u32, height:
7676pub extern "C" fn processing_background_color ( window_id : u64 , color : Color ) {
7777 error:: clear_error ( ) ;
7878 let window_entity = Entity :: from_bits ( window_id) ;
79- error:: check ( || record_command ( window_entity, DrawCommand :: BackgroundColor ( color. into ( ) ) ) ) ;
79+ error:: check ( || {
80+ graphics_record_command ( window_entity, DrawCommand :: BackgroundColor ( color. into ( ) ) )
81+ } ) ;
8082}
8183
8284/// Set the background image for the given window.
@@ -90,7 +92,9 @@ pub extern "C" fn processing_background_image(window_id: u64, image_id: u64) {
9092 error:: clear_error ( ) ;
9193 let window_entity = Entity :: from_bits ( window_id) ;
9294 let image_entity = Entity :: from_bits ( image_id) ;
93- error:: check ( || record_command ( window_entity, DrawCommand :: BackgroundImage ( image_entity) ) ) ;
95+ error:: check ( || {
96+ graphics_record_command ( window_entity, DrawCommand :: BackgroundImage ( image_entity) )
97+ } ) ;
9498}
9599
96100/// Begins the draw for the given window.
@@ -102,7 +106,7 @@ pub extern "C" fn processing_background_image(window_id: u64, image_id: u64) {
102106pub extern "C" fn processing_begin_draw ( window_id : u64 ) {
103107 error:: clear_error ( ) ;
104108 let window_entity = Entity :: from_bits ( window_id) ;
105- error:: check ( || begin_draw ( window_entity) ) ;
109+ error:: check ( || graphics_begin_draw ( window_entity) ) ;
106110}
107111
108112/// Flushes recorded draw commands for the given window.
@@ -114,7 +118,7 @@ pub extern "C" fn processing_begin_draw(window_id: u64) {
114118pub extern "C" fn processing_flush ( window_id : u64 ) {
115119 error:: clear_error ( ) ;
116120 let window_entity = Entity :: from_bits ( window_id) ;
117- error:: check ( || flush ( window_entity) ) ;
121+ error:: check ( || graphics_flush ( window_entity) ) ;
118122}
119123
120124/// Ends the draw for the given window and presents the frame.
@@ -126,7 +130,7 @@ pub extern "C" fn processing_flush(window_id: u64) {
126130pub extern "C" fn processing_end_draw ( window_id : u64 ) {
127131 error:: clear_error ( ) ;
128132 let window_entity = Entity :: from_bits ( window_id) ;
129- error:: check ( || end_draw ( window_entity) ) ;
133+ error:: check ( || graphics_end_draw ( window_entity) ) ;
130134}
131135
132136/// Shuts down internal resources with given exit code, but does *not* terminate the process.
@@ -151,7 +155,7 @@ pub extern "C" fn processing_set_fill(window_id: u64, r: f32, g: f32, b: f32, a:
151155 error:: clear_error ( ) ;
152156 let window_entity = Entity :: from_bits ( window_id) ;
153157 let color = bevy:: color:: Color :: srgba ( r, g, b, a) ;
154- error:: check ( || record_command ( window_entity, DrawCommand :: Fill ( color) ) ) ;
158+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: Fill ( color) ) ) ;
155159}
156160
157161/// Set the stroke color.
@@ -165,7 +169,7 @@ pub extern "C" fn processing_set_stroke_color(window_id: u64, r: f32, g: f32, b:
165169 error:: clear_error ( ) ;
166170 let window_entity = Entity :: from_bits ( window_id) ;
167171 let color = bevy:: color:: Color :: srgba ( r, g, b, a) ;
168- error:: check ( || record_command ( window_entity, DrawCommand :: StrokeColor ( color) ) ) ;
172+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: StrokeColor ( color) ) ) ;
169173}
170174
171175/// Set the stroke weight.
@@ -178,7 +182,7 @@ pub extern "C" fn processing_set_stroke_color(window_id: u64, r: f32, g: f32, b:
178182pub extern "C" fn processing_set_stroke_weight ( window_id : u64 , weight : f32 ) {
179183 error:: clear_error ( ) ;
180184 let window_entity = Entity :: from_bits ( window_id) ;
181- error:: check ( || record_command ( window_entity, DrawCommand :: StrokeWeight ( weight) ) ) ;
185+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: StrokeWeight ( weight) ) ) ;
182186}
183187
184188/// Disable fill for subsequent shapes.
@@ -191,7 +195,7 @@ pub extern "C" fn processing_set_stroke_weight(window_id: u64, weight: f32) {
191195pub extern "C" fn processing_no_fill ( window_id : u64 ) {
192196 error:: clear_error ( ) ;
193197 let window_entity = Entity :: from_bits ( window_id) ;
194- error:: check ( || record_command ( window_entity, DrawCommand :: NoFill ) ) ;
198+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: NoFill ) ) ;
195199}
196200
197201/// Disable stroke for subsequent shapes.
@@ -204,7 +208,7 @@ pub extern "C" fn processing_no_fill(window_id: u64) {
204208pub extern "C" fn processing_no_stroke ( window_id : u64 ) {
205209 error:: clear_error ( ) ;
206210 let window_entity = Entity :: from_bits ( window_id) ;
207- error:: check ( || record_command ( window_entity, DrawCommand :: NoStroke ) ) ;
211+ error:: check ( || graphics_record_command ( window_entity, DrawCommand :: NoStroke ) ) ;
208212}
209213
210214/// Draw a rectangle.
@@ -228,7 +232,7 @@ pub extern "C" fn processing_rect(
228232 error:: clear_error ( ) ;
229233 let window_entity = Entity :: from_bits ( window_id) ;
230234 error:: check ( || {
231- record_command (
235+ graphics_record_command (
232236 window_entity,
233237 DrawCommand :: Rect {
234238 x,
@@ -318,15 +322,15 @@ pub extern "C" fn processing_image_resize(image_id: u64, new_width: u32, new_hei
318322/// - buffer_len must equal width * height of the image.
319323/// - This is called from the same thread as init.
320324#[ unsafe( no_mangle) ]
321- pub unsafe extern "C" fn processing_image_load_pixels (
325+ pub unsafe extern "C" fn processing_image_readback (
322326 image_id : u64 ,
323327 buffer : * mut Color ,
324328 buffer_len : usize ,
325329) {
326330 error:: clear_error ( ) ;
327331 let image_entity = Entity :: from_bits ( image_id) ;
328332 error:: check ( || {
329- let colors = image_load_pixels ( image_entity) ?;
333+ let colors = image_readback ( image_entity) ?;
330334
331335 // Validate buffer size
332336 if colors. len ( ) != buffer_len {
0 commit comments