@@ -24,6 +24,7 @@ impl SurfaceBuilder {
2424 return Self { name : None } ;
2525 }
2626
27+ /// Set the name of the surface.
2728 pub fn with_name ( mut self , name : & str ) -> Self {
2829 self . name = Some ( name. to_string ( ) ) ;
2930 return self ;
@@ -161,6 +162,7 @@ impl SwapchainBuilder {
161162 return Self { size : ( 480 , 360 ) } ;
162163 }
163164
165+ /// Set the size of the swapchain for the surface image.
164166 pub fn with_size ( mut self , width : u32 , height : u32 ) -> Self {
165167 self . size = ( width, height) ;
166168 return self ;
@@ -298,20 +300,14 @@ pub mod internal {
298300 return surface. frame_buffer_attachment . clone ( ) ;
299301 }
300302
301- pub fn surface_for < RenderBackend : gfx_hal:: Backend > (
302- surface : & mut super :: Surface < RenderBackend > ,
303- ) -> & mut RenderBackend :: Surface {
304- return & mut surface. gfx_hal_surface ;
305- }
306-
307303 /// Borrow the surface and take the image. This internal function is used for
308304 /// rendering and composes surface_for + take image.
309305 pub fn borrow_surface_and_take_image < RenderBackend : gfx_hal:: Backend > (
310306 surface : & mut super :: Surface < RenderBackend > ,
311307 ) -> ( & mut RenderBackend :: Surface , <RenderBackend :: Surface as PresentationSurface < RenderBackend > >:: SwapchainImage ) {
312308 return (
313309 & mut surface. gfx_hal_surface ,
314- surface. image . take ( ) . expect ( "" ) ,
310+ surface. image . take ( ) . expect ( "Surface image is not present " ) ,
315311 ) ;
316312 }
317313}
0 commit comments