.TH "SDLmm::Display" 3 "16 Jul 2001" "SDLmm" \" -*- nroff -*- .ad l .nh .SH NAME SDLmm::Display \- The video frame buffer surface. .SH SYNOPSIS .br .PP \fC#include \fP .PP Inherits \fBSDLmm::BaseSurface\fP. .PP .SS "Public Methods" .in +1c .ti -1c .RI "\fB~Display\fP ()" .br .ti -1c .RI "bool \fBSetVideoMode\fP (int w, int h, int bpp=0, Uint32 flags=0)" .br .RI "\fISetup the video mode with the specified width, height and color depth.\fP" .ti -1c .RI "bool \fBSetDisplayFormat\fP ()" .br .RI "\fIConvert the surface to the display format.\fP" .ti -1c .RI "bool \fBSetDisplayFormatAlpha\fP ()" .br .RI "\fIConvert the surface to the display format.\fP" .in -1c .PP .RI "\fBMethods updating the screen\fP" .br .in +1c .in +1c .ti -1c .RI "void \fBUpdateRect\fP (Sint32 x=0, Sint32 y=0, Sint32 w=0, Sint32 h=0)" .br .RI "\fIMakes sure the given area is updated on the screen.\fP" .ti -1c .RI "void \fBUpdate\fP ()" .br .RI "\fIMakes sure the entire screen is updated.\fP" .ti -1c .RI "void \fBUpdateRect\fP (\fBSDL_Rect\fP &rect)" .br .RI "\fIMakes sure the given area is updated on the display.\fP" .ti -1c .RI "void \fBUpdateRects\fP (int numrects, \fBSDL_Rect\fP *rects)" .br .RI "\fIMakes sure the given list of rectangles is updated on the display.\fP" .ti -1c .RI "bool \fBFlip\fP ()" .br .RI "\fISwaps screen buffers.\fP" .in -1c .in -1c .PP .RI "\fBWindow Management\fP" .br .in +1c .in +1c .ti -1c .RI "void \fBSetCaption\fP (const char *title, const char *icon)" .br .RI "\fISets the window title and icon name of the application.\fP" .ti -1c .RI "void \fBSetCaption\fP (const std::string &title, const std::string &icon)" .br .RI "\fISets the window title and icon name of the application.\fP" .ti -1c .RI "void \fBGetCaption\fP (char **title, char **icon)" .br .RI "\fIGets the window title and icon name.\fP" .ti -1c .RI "void \fBGetCaption\fP (std::string &title, std::string &icon)" .br .RI "\fIGets the window title and icon name.\fP" .ti -1c .RI "void \fBSetIcon\fP (\fBBaseSurface\fP &icon, Uint8 *mask=0)" .br .RI "\fISets the icon for the display window.\fP" .ti -1c .RI "bool \fBIconify\fP ()" .br .RI "\fIIconify / minimize the application.\fP" .ti -1c .RI "bool \fBToggleFullScreen\fP ()" .br .RI "\fIToggles between fullscreen and windowed mode.\fP" .ti -1c .RI "SDL_GrabMode \fBGrabInput\fP (SDL_GrabMode mode)" .br .RI "\fIGrabs mouse and keyboard input.\fP" .in -1c .in -1c .SS "Static Public Methods" .in +1c .ti -1c .RI "Display& \fBGetDisplay\fP ()" .br .RI "\fIThe one and only display.\fP" .in -1c .PP .RI "\fBVideo Modes / Setup\fP" .br .in +1c .in +1c .ti -1c .RI "bool \fBInit\fP ()" .br .RI "\fIInitializes the video subsystem.\fP" .ti -1c .RI "void \fBQuit\fP ()" .br .RI "\fIShut down the video subsystem.\fP" .ti -1c .RI "int \fBVideoModeOK\fP (int w, int h, int bpp, Uint32 flags)" .br .RI "\fICheck to see if a particular video mode is supported.\fP" .ti -1c .RI "\fBSDL_Rect\fP** \fBListModes\fP (SDL_PixelFormat *format=0, Uint32 flags=0)" .br .RI "\fIReturns a pointer to an array of available screen dimensions for the given format and video flags.\fP" .in -1c .in -1c .SS "Protected Methods" .in +1c .ti -1c .RI "Display& \fBoperator=\fP (Display &)" .br .RI "\fIDummy implementation of \fBoperator=\fP() to stop initialization.\fP" .ti -1c .RI "\fBDisplay\fP (Display &)" .br .ti -1c .RI "\fBDisplay\fP ()" .br .RI "\fIA NOOP constructor.\fP" .in -1c .SH "DETAILED DESCRIPTION" .PP The video frame buffer surface. .PP This class represents the actual video frame buffer memory. If you are using hardware video support, the actual memory is stored on the graphics card. Please note that if you create more than one \fBDisplay\fP instance, they will all reference the same actual surface (i.e the current display). .PP \fBNote: \fP .in +1c Since the actual SDL_Surface representation is shared among all \fBDisplay\fP instances, they will always reference the correct surface. .PP .SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION" .PP .SS "SDLmm::Display::Display (Display &)\fC [protected]\fP" .PP .SS "SDLmm::Display::Display ()\fC [inline, protected]\fP" .PP A NOOP constructor. .PP .SS "SDLmm::Display::~Display ()\fC [inline]\fP" .PP .SH "MEMBER FUNCTION DOCUMENTATION" .PP .SS "bool SDLmm::Display::Flip ()\fC [inline]\fP" .PP Swaps screen buffers. .PP On hardware that supports double-buffering, this function sets up a flip and returns. The hardware will wait for vertical retrace, and then swap video buffers before the next video surface Blit or Lock will return. On hardware that doesn't support double-buffering, this is equivalent to calling \fBUpdateRect\fP() (i.e w/o parameters). .PP The SDL_DOUBLEBUF flag must have been passed to SetVideoMode, when setting the video mode for this function to perform hardware flipping. .PP \fBReturns: \fP .in +1c true for success, false for failure. .SS "void SDLmm::Display::GetCaption (std::string & title, std::string & icon)" .PP Gets the window title and icon name. .PP \fBParameters: \fP .in +1c .TP \fB\fItitle, icons\fP\fP references to strings which will be set to the title and icon titles. .SS "void SDLmm::Display::GetCaption (char ** title, char ** icon)" .PP Gets the window title and icon name. .PP \fBParameters: \fP .in +1c .TP \fB\fItitle, icons\fP\fP pointers to char * which will be set to the title and icon titles. .SS "Display & SDLmm::Display::GetDisplay ()\fC [static]\fP" .PP The one and only display. .PP .SS "SDL_GrabMode SDLmm::Display::GrabInput (SDL_GrabMode mode)" .PP Grabs mouse and keyboard input. .PP Grabbing means that the mouse is confined to the application window, and nearly all keyboard input is passed directly to the application, and not interpreted by a window manager, if any. .PP When mode is SDL_GRAB_QUERY the grab mode is not changed, but the current grab mode is returned. .PP \fBParameters: \fP .in +1c .TP \fB\fImode\fP\fP one of the following: .PP .nf typedef enum { SDL_GRAB_QUERY, // Query the current mode SDL_GRAB_OFF, // Ungrab the mouse and keyboard SDL_GRAB_ON // Grab the mouse and keyboard } SDL_GrabMode; .fi .SS "bool SDLmm::Display::Iconify ()" .PP Iconify / minimize the application. .PP If the application is running in a window managed environment SDL attempts to iconify / minimize it. If \fBIconify\fP() is successful, the application will receive a SDL_APPACTIVE loss event. .PP \fBSee also: \fP .in +1c \fBEventHandler::HandleActiveEvent\fP() .PP \fBReturns: \fP .in +1c true on success or false if iconification isn't supported or was refused by the window manager. .SS "bool SDLmm::Display::Init ()\fC [static]\fP" .PP Initializes the video subsystem. .PP Call this method to setup the video subsystem. .PP \fBReturns: \fP .in +1c true on success, false on error .SS "\fBSDL_Rect\fP ** SDLmm::Display::ListModes (SDL_PixelFormat * format = 0, Uint32 flags = 0)\fC [static]\fP" .PP Returns a pointer to an array of available screen dimensions for the given format and video flags. .PP Return a pointer to an array of available screen dimensions for the given format and video flags, sorted largest to smallest. Returns 0 if there are no dimensions available for a particular format, or -1 if any dimension is okay for the given format. .PP If \fIformat\fP is 0, the mode list will be for the format returned by VideoInfo()->vfmt(). The \fIflag\fP parameter is an OR'd combination of surface flags. The flags are the same as those used SetVideoMode and they play a strong role in deciding what modes are valid. For instance, if you pass SDL_HWSURFACE as a flag only modes that support hardware video surfaces will be returned. .PP \fBSee also: \fP .in +1c \fBSetVideoMode\fP, \fBVideoInfo\fP, \fBSRect\fP .SS "void SDLmm::Display::Quit ()\fC [static]\fP" .PP Shut down the video subsystem. .PP .SS "void SDLmm::Display::SetCaption (const std::string & title, const std::string & icon)" .PP Sets the window title and icon name of the application. .PP \fBParameters: \fP .in +1c .TP \fB\fItitle\fP\fP the new title .TP \fB\fIicon\fP\fP the new icon title .SS "void SDLmm::Display::SetCaption (const char * title, const char * icon)" .PP Sets the window title and icon name of the application. .PP \fBParameters: \fP .in +1c .TP \fB\fItitle\fP\fP the new title .TP \fB\fIicon\fP\fP the new icon title .SS "bool SDLmm::Display::SetDisplayFormat ()\fC [inline, virtual]\fP" .PP Convert the surface to the display format. .PP 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. .PP 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. .PP \fBReturns: \fP .in +1c The functions returns true if the conversion succeeded or false otherwise. If the conversion failed, the \fBBaseSurface\fP object will not have changed. .PP \fBNote: \fP .in +1c Please note that this function doesn't return a new, modified object like the SDL_DisplayFormat() function does. Thus there is no need to manually free the old surface. .PP \fBSee also: \fP .in +1c \fBSetDisplayFormatAlpha\fP(), \fBSetAlpha\fP(), \fBSetColorKey\fP() .PP Reimplemented from \fBSDLmm::BaseSurface\fP. .SS "bool SDLmm::Display::SetDisplayFormatAlpha ()\fC [inline, virtual]\fP" .PP Convert the surface to the display format. .PP 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. .PP 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. .PP \fBReturns: \fP .in +1c The functions returns true if the conversion succeeded or false otherwise. If the conversion failed, the \fBBaseSurface\fP object will not have changed. .PP \fBNote: \fP .in +1c Please note that this function doesn't return a new, modified object like the SDL_DisplayFormatAlpha() function does. Thus there is no need to manually free the old surface. .PP \fBSee also: \fP .in +1c \fBSetDisplayFormat\fP(), \fBSetAlpha\fP(), \fBSetColorKey\fP() .PP Reimplemented from \fBSDLmm::BaseSurface\fP. .SS "void SDLmm::Display::SetIcon (\fBBaseSurface\fP & icon, Uint8 * mask = 0)" .PP Sets the icon for the display window. .PP This function must be called before the first call to \fBSetVideoMode\fP(). .PP It takes an \fIicon\fP surface, and a \fImask\fP in MSB format. .PP If mask is zero (default), the entire icon surface will be used as the icon. .SS "bool SDLmm::Display::SetVideoMode (int w, int h, int bpp = 0, Uint32 flags = 0)" .PP Setup the video mode with the specified width, height and color depth. .PP If bpp is zero, the color depth uses is that of the current display. .PP \fBReturns: \fP .in +1c Returns true for success and false for failure. .PP \fBParameters: \fP .in +1c .TP \fB\fIw, h\fP\fP width and height .TP \fB\fIbpp\fP\fP color depth in bits-per-pixel .TP \fB\fIflags\fP\fP the video flags .SS "bool SDLmm::Display::ToggleFullScreen ()" .PP Toggles between fullscreen and windowed mode. .PP Toggles the application between windowed and fullscreen mode, if supported. (X11 is the only target currently supported, BeOS support is experimental). .PP \fBReturns: \fP .in +1c true on success, false on failure. .SS "void SDLmm::Display::Update ()\fC [inline]\fP" .PP Makes sure the entire screen is updated. .PP This call is identical to calling \fBUpdateRect\fP() without arguments. .PP This function should not be called if \fBDisplay\fP is locked! .PP \fBSee also: \fP .in +1c \fBUpdateRect\fP, \fBUpdateRects\fP, \fBSRect\fP .SS "void SDLmm::Display::UpdateRect (\fBSDL_Rect\fP & rect)" .PP Makes sure the given area is updated on the display. .PP This function should not be called if \fBDisplay\fP is locked! .PP \fBParameters: \fP .in +1c .TP \fB\fIrect\fP\fP the rectangle to update. .PP \fBSee also: \fP .in +1c \fBUpdateRects\fP, \fBSRect\fP .SS "void SDLmm::Display::UpdateRect (Sint32 x = 0, Sint32 y = 0, Sint32 w = 0, Sint32 h = 0)" .PP Makes sure the given area is updated on the screen. .PP If '\fIx\fP', '\fIy\fP', '\fIw\fP' and '\fIh\fP' are all 0 (the default), \fBUpdateRect\fP() will update the entire display. .PP This function should not be called if \fBDisplay\fP is locked! .PP \fBParameters: \fP .in +1c .TP \fB\fIx, y\fP\fP the top left corner of the rectangle to update .TP \fB\fIw, h\fP\fP the width and height of the rectangle. .PP \fBSee also: \fP .in +1c \fBUpdateRect\fP(SDL_Rect& rect), \fBUpdateRects\fP, \fBSRect\fP .SS "void SDLmm::Display::UpdateRects (int numrects, \fBSDL_Rect\fP * rects)" .PP Makes sure the given list of rectangles is updated on the display. .PP This function should not be called if \fBDisplay\fP is locked! .PP \fBNote: \fP .in +1c It is adviced to call this function only once per frame, since each call has some processing overhead. This is no restriction since you can pass any number of rectangles each time. .PP The rectangles are not automatically merged or checked for overlap. In general, the programmer can use his knowledge about his particular rectangles to merge them in an efficient way, to avoid overdraw. .PP \fBParameters: \fP .in +1c .TP \fB\fInumrects\fP\fP the number of rectangles in the array. .TP \fB\fIrects\fP\fP the array of rectangles to update .PP \fBSee also: \fP .in +1c \fBUpdateRect\fP, \fBSRect\fP, \fBUpdate\fP .SS "int SDLmm::Display::VideoModeOK (int w, int h, int bpp, Uint32 flags)\fC [static]\fP" .PP Check to see if a particular video mode is supported. .PP VideoModeOK returns 0 if the requested mode is not supported under any bit depth, or returns the bits-per-pixel of the closest available mode with the given width, height and requested surface flags (see SetVideoMode). .PP The bits-per-pixel value returned is only a suggested mode. You can usually request any bpp you want when setting the video mode and SDL will emulate that color depth with a shadow video surface. .PP The arguments to VideoModeOK are the same ones you would pass to SetVideoMode. .PP \fBSee also: \fP .in +1c \fBSetVideoMode\fP, \fBVideoInfo\fP .SS "Display & SDLmm::Display::operator= (Display &)\fC [protected]\fP" .PP Dummy implementation of \fBoperator=\fP() to stop initialization. .PP .SH "AUTHOR" .PP Generated automatically by Doxygen for SDLmm from the source code.