Index


NAME

Top

SDL::Surface - Graphic surface structure. Access to SDL_Surface.

CATEGORY

Core, Video, Structure

SYNOPSIS

Top

The main surface (display) is provided by SDL::Video::set_video_mode. use SDL; #provides flags & constants use SDL::Video; #provides access to set_video_mode use SDL::Surface; #provides access to SDL_Surface struct internals

  SDL::init(SDL_INIT_VIDEO); 
  my $display = SDL::Video::set_video_mode(); 

All surfaces constructed from now on are attached to the $display. There are two constructors available to do this.

  my $surface  = SDL::Surface->new ( ... ); 
  my $surface2 = SDL::Surface->new_from ( surface, ... ); 

DESCRIPTION

Top

An SDL_Surface defines a surfaceangular area of pixels.

METHODS

Top

new ( flags, width, height, depth, Rmask, Gmask, Bmask, Amask )

The constructor creates a new surface with the specified parameter values.

    my $surface = SDL::Surface->new( ... );

new_from ( surface, width, height, depth, Rmask, Gmask, Bmask, Amask )

The constructor creates a new surface with the specified parameter values.

    my $surface = SDL::Surface->new_from( $old_surface, ... );




Construtor Parameters

w

SDL::Surface width are defined at construction. Thus the following is read only.

  my $w = $surface->w; 

h

SDL::Surface height are defined at construction. Thus the following is read only.

  my $h = $surface->h; 

SEE ALSO

Top

SDL, SDL::PixelFormat, SDL::Video