|
NAMESDLmm::Surface - A graphical surface structure which is used to store graphical data.SYNOPSIS#include <sdlmm_surface.h> Inherits SDLmm::BaseSurface. Public MethodsSurface (SDL_Surface *surface) Constructor from an SDL_Surface*. Surface (const Surface &other) Surface () Create an uninitialized surface. Surface& operator= (const Surface &other) Implementation of operator=. Surface Duplicate () const virtual bool SetDisplayFormat () Convert the surface to the display format. virtual bool SetDisplayFormatAlpha () Convert the surface to the display format. Static Public MethodsSurface CreateSurface (const BaseSurface &other) Surface CreateSurface (Uint32 flags, int w, int h, int d, Uint32 Rmask=0, Uint32 Gmask=0, Uint32 Bmask=0, Uint32 Amask=0) Allocate an empty RGB surface. Surface CreateSurface (void *pixels, int w, int h, int d, int p, Uint32 Rmask=0, Uint32 Gmask=0, Uint32 Bmask=0, Uint32 Amask=0) Create a new Surface from the provided pixel data. Surface LoadBMP (const char *file) Loads a Windows BMP and returns it as a new Surface. Surface LoadBMP (const std::string &file) Loads a Windows BMP and returns a new Surface. DETAILED DESCRIPTIONA graphical surface structure which is used to store graphical data.Surfaces represent areas of 'graphical' memory, memory that can be drawn to or blitted onto other Surfaces. Todo:
Author:
CONSTRUCTOR & DESTRUCTOR DOCUMENTATIONSDLmm::Surface::Surface (SDL_Surface * surface) [inline, explicit]Constructor from an SDL_Surface*.This creates a new Surface object from an existing SDL_Surface. It's very important not to free the original surface since that will cause a problem when the object is destructed (SDL_Surface storage freed twice). Use with caution. SDLmm::Surface::Surface (const Surface & other) [inline]SDLmm::Surface::Surface () [inline]Create an uninitialized surface.Warning:
MEMBER FUNCTION DOCUMENTATIONSurface SDLmm::Surface::CreateSurface (void * pixels, int w, int h, int d, int p, Uint32 Rmask = 0, Uint32 Gmask = 0, Uint32 Bmask = 0, Uint32 Amask = 0) [inline, static]Create a new Surface from the provided pixel data.The data stored in pixels is assumed to be of the depth specified in the parameter d. The pixel data is not copied into the SDL_Surface structure me so it should no be freed until the Surface object has been destructed Parameters:
Surface SDLmm::Surface::CreateSurface (Uint32 flags, int w, int h, int d, Uint32 Rmask = 0, Uint32 Gmask = 0, Uint32 Bmask = 0, Uint32 Amask = 0) [inline, static]Allocate an empty RGB surface.If depth is 8 bits an empty palette is allocated for the surface, otherwise a 'packed-pixel' SDL_PixelFormat is created using the [RGBA]mask's provided. The flags specifies Parameters:
Surface SDLmm::Surface::CreateSurface (const BaseSurface & other) [inline, static]Surface SDLmm::Surface::Duplicate () const [inline]Surface SDLmm::Surface::LoadBMP (const std::string & file) [inline, static]Loads a Windows BMP and returns a new Surface.Parameters:
Returns:
Surface SDLmm::Surface::LoadBMP (const char * file) [inline, static]Loads a Windows BMP and returns it as a new Surface.If the image couldn't be loaded, the Surface will be invalid. You can check the success of the image loading using the Surface.valid() method like the example code below. SDLmm::Surface img(SDLmm::Surface::LoadBMP('myimage.bmp')); if(!img.valid()) { cerr << 'Loading of image myimage.bmp failed!0; exit(1); } Parameters:
Returns:
bool SDLmm::Surface::SetDisplayFormat () [virtual]Convert the surface to the display format.This function converts the surface to the pixel format and colors of the video framebuffer, making it suitable for fast blitting onto the display surface. If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function. Returns:
Note:
See also:
Reimplemented from SDLmm::BaseSurface. bool SDLmm::Surface::SetDisplayFormatAlpha () [virtual]Convert the surface to the display format.This function converts the surface to the pixel format and colors of the video framebuffer plus an alpha channel, making it suitable for fast blitting onto the display surface. If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function. Returns:
Note:
See also:
Reimplemented from SDLmm::BaseSurface. Surface & SDLmm::Surface::operator= (const Surface & other) [inline]Implementation of operator=.AUTHORGenerated automatically by Doxygen for SDLmm from the source code.
Visit the GSP FreeBSD Man Page Interface. |