@@ -238,9 +238,9 @@ impl<RenderBackend: gfx_hal::Backend> Surface<RenderBackend> {
238238
239239 /// Get the size of the surface's extent. Will only return a size if a
240240 /// swapchain has been applied to the surface to render with.
241- pub fn size ( & self ) -> Option < [ u32 ; 2 ] > {
241+ pub fn size ( & self ) -> Option < ( u32 , u32 ) > {
242242 return match self . extent {
243- Some ( extent) => Some ( [ extent. width , extent. height ] ) ,
243+ Some ( extent) => Some ( ( extent. width , extent. height ) ) ,
244244 None => None ,
245245 } ;
246246 }
@@ -249,16 +249,16 @@ impl<RenderBackend: gfx_hal::Backend> Surface<RenderBackend> {
249249// ------------------------------ SWAPCHAIN BUILDER ----------------------------
250250
251251pub struct SwapchainBuilder {
252- size : [ u32 ; 2 ] ,
252+ size : ( u32 , u32 ) ,
253253}
254254
255255impl SwapchainBuilder {
256256 pub fn new ( ) -> Self {
257- return Self { size : [ 480 , 360 ] } ;
257+ return Self { size : ( 480 , 360 ) } ;
258258 }
259259
260260 pub fn with_size ( mut self , width : u32 , height : u32 ) -> Self {
261- self . size = [ width, height] ;
261+ self . size = ( width, height) ;
262262 return self ;
263263 }
264264
@@ -270,14 +270,12 @@ impl SwapchainBuilder {
270270 let physical_device = super :: gpu:: internal:: physical_device_for ( gpu) ;
271271 let caps = surface. gfx_hal_surface . capabilities ( physical_device) ;
272272 let format = internal:: get_first_supported_format ( surface, physical_device) ;
273+ let ( width, height) = self . size ;
273274
274275 let mut swapchain_config = gfx_hal:: window:: SwapchainConfig :: from_caps (
275276 & caps,
276277 format,
277- gfx_hal:: window:: Extent2D {
278- width : self . size [ 0 ] ,
279- height : self . size [ 1 ] ,
280- } ,
278+ gfx_hal:: window:: Extent2D { width, height } ,
281279 ) ;
282280
283281 // TODO(vmarcella) Profile the performance on MacOS to see if this slows
0 commit comments