File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1986,13 +1986,17 @@ impl Window {
19861986
19871987 #[ doc( alias = "SDL_GetWindowGammaRamp" ) ]
19881988 pub fn gamma_ramp_arrays ( & self ) -> Result < [ [ u16 ; 256 ] ; 3 ] , String > {
1989- let mut ret = mem:: MaybeUninit :: < [ [ u16 ; 256 ] ; 3 ] > :: uninit ( ) ;
1990- let ptr = ret. as_mut_ptr ( ) . cast :: < u16 > ( ) ;
1989+ let [ mut red, mut green, mut blue] = [ mem:: MaybeUninit :: < [ u16 ; 256 ] > :: uninit ( ) ; 3 ] ;
19911990 let result = unsafe {
1992- sys:: SDL_GetWindowGammaRamp ( self . context . raw , ptr, ptr. add ( 256 ) , ptr. add ( 512 ) )
1991+ sys:: SDL_GetWindowGammaRamp (
1992+ self . context . raw ,
1993+ red. as_mut_ptr ( ) . cast :: < u16 > ( ) ,
1994+ green. as_mut_ptr ( ) . cast :: < u16 > ( ) ,
1995+ blue. as_mut_ptr ( ) . cast :: < u16 > ( ) ,
1996+ )
19931997 } ;
19941998 if result == 0 {
1995- Ok ( unsafe { ret . assume_init ( ) } )
1999+ Ok ( unsafe { [ red . assume_init ( ) , green . assume_init ( ) , blue . assume_init ( ) ] } )
19962000 } else {
19972001 Err ( get_error ( ) )
19982002 }
You can’t perform that action at this time.
0 commit comments