GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SDLmm::Display(3) FreeBSD Library Functions Manual SDLmm::Display(3)

SDLmm::Display - The video frame buffer surface.

#include <sdlmm_display.h>

Inherits SDLmm::BaseSurface.


~Display ()
bool SetVideoMode (int w, int h, int bpp=0, Uint32 flags=0)
Setup the video mode with the specified width, height and color depth. bool SetDisplayFormat ()
Convert the surface to the display format. bool SetDisplayFormatAlpha ()
Convert the surface to the display format.

Methods updating the screen



void UpdateRect (Sint32 x=0, Sint32 y=0, Sint32 w=0, Sint32 h=0)
Makes sure the given area is updated on the screen. void Update ()
Makes sure the entire screen is updated. void UpdateRect (SDL_Rect &rect)
Makes sure the given area is updated on the display. void UpdateRects (int numrects, SDL_Rect *rects)
Makes sure the given list of rectangles is updated on the display. bool Flip ()
Swaps screen buffers.

Window Management



void SetCaption (const char *title, const char *icon)
Sets the window title and icon name of the application. void SetCaption (const std::string &title, const std::string &icon)
Sets the window title and icon name of the application. void GetCaption (char **title, char **icon)
Gets the window title and icon name. void GetCaption (std::string &title, std::string &icon)
Gets the window title and icon name. void SetIcon (BaseSurface &icon, Uint8 *mask=0)
Sets the icon for the display window. bool Iconify ()
Iconify / minimize the application. bool ToggleFullScreen ()
Toggles between fullscreen and windowed mode. SDL_GrabMode GrabInput (SDL_GrabMode mode)
Grabs mouse and keyboard input.


Display& GetDisplay ()
The one and only display.

Video Modes / Setup



bool Init ()
Initializes the video subsystem. void Quit ()
Shut down the video subsystem. int VideoModeOK (int w, int h, int bpp, Uint32 flags)
Check to see if a particular video mode is supported. SDL_Rect** ListModes (SDL_PixelFormat *format=0, Uint32 flags=0)
Returns a pointer to an array of available screen dimensions for the given format and video flags.


Display& operator= (Display &)
Dummy implementation of operator=() to stop initialization. Display (Display &)
Display ()
A NOOP constructor.

The video frame buffer surface.

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 Display instance, they will all reference the same actual surface (i.e the current display).

Note:
Since the actual SDL_Surface representation is shared among all Display instances, they will always reference the correct surface.

A NOOP constructor.

Swaps screen buffers.

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 UpdateRect() (i.e w/o parameters).

The SDL_DOUBLEBUF flag must have been passed to SetVideoMode, when setting the video mode for this function to perform hardware flipping.

Returns:
true for success, false for failure.

Gets the window title and icon name.

Parameters:

title, icons
references to strings which will be set to the title and icon titles.

Gets the window title and icon name.

Parameters:

title, icons
pointers to char * which will be set to the title and icon titles.

The one and only display.

Grabs mouse and keyboard input.

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.

When mode is SDL_GRAB_QUERY the grab mode is not changed, but the current grab mode is returned.

Parameters:

mode
one of the following:

      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;

Iconify / minimize the application.

If the application is running in a window managed environment SDL attempts to iconify / minimize it. If Iconify() is successful, the application will receive a SDL_APPACTIVE loss event.

See also:
EventHandler::HandleActiveEvent()

Returns:
true on success or false if iconification isn't supported or was refused by the window manager.

Initializes the video subsystem.

Call this method to setup the video subsystem.

Returns:
true on success, false on error

Returns a pointer to an array of available screen dimensions for the given format and video flags.

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.

If format is 0, the mode list will be for the format returned by VideoInfo()->vfmt(). The flag 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.

See also:
SetVideoMode, VideoInfo, SRect

Shut down the video subsystem.

Sets the window title and icon name of the application.

Parameters:

title
the new title
icon
the new icon title

Sets the window title and icon name of the application.

Parameters:

title
the new title
icon
the new icon title

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:
The functions returns true if the conversion succeeded or false otherwise. If the conversion failed, the BaseSurface object will not have changed.

Note:
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.

See also:
SetDisplayFormatAlpha(), SetAlpha(), SetColorKey()

Reimplemented from SDLmm::BaseSurface.

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:
The functions returns true if the conversion succeeded or false otherwise. If the conversion failed, the BaseSurface object will not have changed.

Note:
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.

See also:
SetDisplayFormat(), SetAlpha(), SetColorKey()

Reimplemented from SDLmm::BaseSurface.

Sets the icon for the display window.

This function must be called before the first call to SetVideoMode().

It takes an icon surface, and a mask in MSB format.

If mask is zero (default), the entire icon surface will be used as the icon.

Setup the video mode with the specified width, height and color depth.

If bpp is zero, the color depth uses is that of the current display.

Returns:
Returns true for success and false for failure.

Parameters:

w, h
width and height
bpp
color depth in bits-per-pixel
flags
the video flags

Toggles between fullscreen and windowed mode.

Toggles the application between windowed and fullscreen mode, if supported. (X11 is the only target currently supported, BeOS support is experimental).

Returns:
true on success, false on failure.

Makes sure the entire screen is updated.

This call is identical to calling UpdateRect() without arguments.

This function should not be called if Display is locked!

See also:
UpdateRect, UpdateRects, SRect

Makes sure the given area is updated on the display.

This function should not be called if Display is locked!

Parameters:

rect
the rectangle to update.

See also:
UpdateRects, SRect

Makes sure the given area is updated on the screen.

If 'x', 'y', 'w' and 'h' are all 0 (the default), UpdateRect() will update the entire display.

This function should not be called if Display is locked!

Parameters:

x, y
the top left corner of the rectangle to update
w, h
the width and height of the rectangle.

See also:
UpdateRect(SDL_Rect& rect), UpdateRects, SRect

Makes sure the given list of rectangles is updated on the display.

This function should not be called if Display is locked!

Note:
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.

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.

Parameters:

numrects
the number of rectangles in the array.
rects
the array of rectangles to update

See also:
UpdateRect, SRect, Update

Check to see if a particular video mode is supported.

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).

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.

The arguments to VideoModeOK are the same ones you would pass to SetVideoMode.

See also:
SetVideoMode, VideoInfo

Dummy implementation of operator=() to stop initialization.

Generated automatically by Doxygen for SDLmm from the source code.
16 Jul 2001 SDLmm

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.