SDLx::App doesn't initialize SDLx::Surface correctly #161

Closed
kthakore opened this Issue Jul 26, 2011 · 3 comments

Projects

None yet

1 participant

@kthakore
PerlGameDev member

Variables from %options hash in the constructor of SDLx::App aren't correctly assigned to the surface object SDLx::App represents. In App.pm:

my $surface = SDL::Video::set_video_mode( $w, $h, $d, $f ) 
    or croak SDL::get_error();
$options{surface} = $surface;

my $self = SDLx::Surface->new(%options);

and in Surface.pm:

    if ( $options{surface} ) {
            $self = bless $options{surface}, $class;
    } else {
            my $width  = $options{width}  || $options{w};
            my $height = $options{height} || $options{h};
            ..
    }

This makes passing valuable options, like {green,red,blue,alpha}mask from SDLx::App constructor impossible.

@kthakore
PerlGameDev member

Author: kthakore
Time: 1283640853
Field: status
Value: closed

@kthakore kthakore was assigned Jul 26, 2011
@kthakore
PerlGameDev member

Author: kthakore
Time: 1283640853
Field: resolution
Value: invalid

@kthakore
PerlGameDev member

Author: kthakore
Time: 1283640853
Field: comment
Value:
The display made by SDL::Video::set_video_mode( $w, $h, $d, $f )

is what the app will be. It cannot have any masks.

http://sdl.beuc.net/sdl.wiki/SDL_SetVideoMode

@kthakore kthakore closed this Jul 26, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment