OSDL::Video::VideoModule Class Reference

#include <OSDLVideo.h>

Collaboration diagram for OSDL::Video::VideoModule:

[legend]
List of all members.

Detailed Description

Root module for all video needs.

Notably manages the screen surface.

Note:
if the video subsystem has already been initialized, calling the static methods returning video informations will apply to the current video mode. If the video subsystem has not already been initialized, those static methods will return informations about the best available video mode.

Definition at line 75 of file OSDLVideo.h.

Public Member Functions

bool hasScreenSurface () const throw ()
 Returns whether a screen surface is available.
virtual SurfacegetScreenSurface () const throw ( VideoException )
 Returns the current screen surface, if any.
virtual void setScreenSurface (Surface &newScreenSurface) throw ( VideoException )
 Assigns a new surface to the screen surface.
virtual bool hasRenderer () const throw ()
 Tells whether this video module uses a (video) renderer.
virtual Rendering::VideoRenderergetRenderer () const throw ( VideoException )
 Returns the video renderer currently used.
virtual void setRenderer (Rendering::VideoRenderer &newRenderer) throw ()
 Sets a new video renderer.
virtual bool hasOpenGLContext () const throw ()
 Tells whether this video module has an OpenGL context.
virtual void setOpenGLContext (OpenGL::OpenGLContext &newOpenGLContext) throw ()
 Sets a new OpenGL context.
virtual OpenGL::OpenGLContextgetOpenGLContext () const throw ( VideoException )
 Returns the OpenGL context currently used.
virtual BitsPerPixel getBestColorDepthForMode (Length width, Length height, BitsPerPixel askedBpp, Ceylan::Flags flags) throw ()
 Returns what is the closest recommended bits per pixel choice for specified video mode, according to specified bits per pixel target.
virtual bool isDisplayInitialized () const throw ()
 Tells whether the display is currently running, i.e.
virtual Ceylan::Flags setMode (Length width, Length height, BitsPerPixel askedBpp, Ceylan::Flags flags, OpenGL::Flavour flavour=OpenGL::None) throw ( VideoException )
 Tries to sets up a video mode with the specified width, height and bits-per-pixel.
virtual void resize (Length newWidth, Length newHeight) throw ( VideoException )
 Does everything needed when the application is resized, including calling setMode and updating OpenGL state if necessary.
virtual void redraw () throw ( VideoException )
 This method should be called whenever the screen needs to be redrawn, for example if the window manager asks for it.
virtual void toggleFullscreen () throw ( VideoException )
 Toggles the application between windowed and fullscreen mode, if supported.
virtual bool getEndPointDrawState () const throw ()
 Tells whether line endpoint (final pixel) should be drawn.
virtual void setEndPointDrawState (bool newState) throw ()
 Sets the draw-endpoint mode.
virtual bool getAntiAliasingState () const throw ()
 Tells whether graphics should be anti-aliased, if possible.
virtual void setAntiAliasingState (bool newState) throw ()
 Sets the anti-aliasing mode.
virtual const std::string getDriverName () const throw ()
 Returns the name of the video driver being currently used (example : 'x11').
virtual void setWindowCaption (const std::string &newTitle, const std::string &iconName) throw ()
 Sets the window title and icon name.
virtual void getWindowCaption (std::string &title, std::string &iconName) throw ()
 Gets the window title and icon name.
virtual void setWindowIcon (const std::string &filename) throw ( VideoException )
 Sets the icon for the display window.
virtual bool iconifyWindow () throw ()
 Iconifies (minimizes) the window.
virtual bool getFrameAccountingState () throw ()
 Tells whether frames shoud be monitored to know the frame-per-second (FPS) indicator.
virtual void setFrameAccountingState (bool newState) throw ()
 Sets the frame-accounting mode.
virtual bool isUsingOpenGL () const throw ()
 Tells whether OpenGL is being used currently by this video module.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw ()
 Returns an user-friendly description of the state of this object.

Static Public Member Functions

static bool IsDisplayInitialized () throw ()
 Tells whether display has already been initialized (VideoModule::setMode called).
static bool GetEndPointDrawState () throw ()
 Tells whether the last pixel of a segment of line should be drawn.
static bool GetAntiAliasingState () throw ()
 Tells whether antialiasing is wanted.
static const std::string GetDriverName () throw ()
 Returns the name of the video driver being currently used (example : 'x11').
static std::string InterpretFlags (Ceylan::Flags flags) throw ()
 Describes specified video flags according to the semantics used in setMode.
static bool HardwareSurfacesCanBeCreated () throw ( VideoException )
 Returns whether hardware surfaces can be created.
static bool WindowManagerAvailable () throw ( VideoException )
 Returns whether there is a window manager available.
static bool HardwareToHardwareBlitsAccelerated () throw ( VideoException )
 Returns whether hardware to hardware blits are accelerated.
static bool HardwareToHardwareColorkeyBlitsAccelerated () throw ( VideoException )
 Returns whether hardware to hardware colorkey blits are accelerated.
static bool HardwareToHardwareAlphaBlitsAccelerated () throw ( VideoException )
 Returns whether hardware to hardware alpha blits are accelerated.
static bool SoftwareToHardwareBlitsAccelerated () throw ( VideoException )
 Returns whether software to hardware blits are accelerated.
static bool SoftwareToHardwareColorkeyBlitsAccelerated () throw ( VideoException )
 Returns whether software to hardware colorkey blits are accelerated.
static bool SoftwareToHardwareAlphaBlitsAccelerated () throw ( VideoException )
 Returns whether software to hardware alpha blits are accelerated.
static bool ColorFillsAccelerated () throw ( VideoException )
 Returns whether color fills are accelerated.
static Ceylan::Uint32 GetVideoMemorySize () throw ( VideoException )
 Returns the total amount of video memory, in kilobytes.
static Pixels::PixelFormat GetVideoDevicePixelFormat () throw ( VideoException )
 Returns the native format of the video device.
static std::string DescribeVideoCapabilities () throw ( VideoException )
 Returns a summary of video chain capabilities.
static bool AreDefinitionsRestricted (std::list< Definition > &definitions, Ceylan::Flags flags, Pixels::PixelFormat *pixelFormat=0) throw ()
 Tells whether definitions are restricted for the specified flags and pixel format.
static std::string DescribeAvailableDefinitions (Ceylan::Flags flags, Pixels::PixelFormat *pixelFormat=0) throw ()
 Returns a summary of available screen definitions for specified flags and pixel format.
static std::string DescribeEnvironmentVariables () throw ()
 Returns a summary about the possible use of video-related environment variables, for the selected back-end, expressed in specified format.
static bool IsUsingOpenGL () throw ( VideoException )
 Returns whether OpenGL is being used, at least by one video module.

Static Public Attributes

static const BitsPerPixel UseCurrentColorDepth
 Tells setMode that the color depth of the current display should be used.
static const Ceylan::Flags SoftwareSurface
 Indicates that the screen surface is to be stored in system memory.
static const Ceylan::Flags HardwareSurface
 Indicates that the screen surface is to be stored in video memory.
static const Ceylan::Flags AsynchronousBlit
 Enables the use of asynchronous updates of the display surface.
static const Ceylan::Flags AnyPixelFormat
 Indicates that the screen surface may use any pixel format.
static const Ceylan::Flags ExclusivePalette
 Indicates that a surface should have an exclusive palette.
static const Ceylan::Flags DoubleBuffered
 Indicates that the screen surface is to be double buffered.
static const Ceylan::Flags FullScreen
 Indicates that the screen surface is to be full screen, not windowed.
static const Ceylan::Flags OpenGL
 Indicates that the screen surface should have an OpenGL context.
static const Ceylan::Flags Resizable
 Indicates that the screen surface is to be resizable.
static const Ceylan::Flags NoFrame
 Indicates that a window which would correspond to a screen surface should have no title bar nor frame decoration, if possible.

Protected Attributes

Surface_screen
 Internal surface corresponding to the screen.
bool _displayInitialized
 Keeps tracks of setMode calls, be OpenGL used or not.
Rendering::VideoRenderer_renderer
 The video renderer being used, if any.
bool _frameAccountingState
 Records the current frame-accounting state, which tells if frame rate is to be monitored.

Static Protected Attributes

static bool _IsUsingOpenGL
 Caches the current state relative to the current use of OpenGL.
static bool _DrawEndPoint
 Caches the current state relative to final pixel drawing for lines.
static bool _AntiAliasing
 Caches the current state relative to antialiasing.
static const Ceylan::Uint16 DriverNameMaximumLength
 The maximum length for the name of the display driver.

Private Member Functions

 VideoModule () throw ( VideoException )
 Private constructor to be sure it will not be implicitly called.
virtual ~VideoModule () throw ()
 Basic virtual private destructor.
 VideoModule (const VideoModule &source) throw ()
 Copy constructor made private to ensure that it will never be called.
VideoModuleoperator= (const VideoModule &source) throw ()
 Assignment operator made private to ensure that it will never be called.

Private Attributes

OpenGL::OpenGLContext_openGLcontext
 The current OpenGL context, if OpenGL is used.
bool _drawEndPoint
 Records the current state relative to final pixel drawing for lines.
bool _antiAliasing
 Records the current antialiasing state.

Static Private Attributes

static std::string _SDLEnvironmentVariables []
 Array of all known environment variables related to video, for SDL back-end.

Friends

class OSDL::CommonModule


Constructor & Destructor Documentation

VideoModule::VideoModule (  )  throw ( VideoException ) [private]

Private constructor to be sure it will not be implicitly called.

Exceptions:
VideoException if the video subsystem initialization failed.

Definition at line 89 of file OSDLVideo.cc.

References OSDL::CommonModule::BackendSuccess, OSDL::Utils::getBackendLastError(), and OSDL::CommonModule::UseVideo.

VideoModule::~VideoModule (  )  throw () [private, virtual]

Basic virtual private destructor.

Definition at line 123 of file OSDLVideo.cc.

References _openGLcontext, _renderer, _screen, and OSDL::CommonModule::UseVideo.

OSDL::Video::VideoModule::VideoModule ( const VideoModule source  )  throw () [explicit, private]

Copy constructor made private to ensure that it will never be called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

bool VideoModule::hasScreenSurface (  )  const throw ()

Returns whether a screen surface is available.

Definition at line 146 of file OSDLVideo.cc.

References _screen.

Surface & VideoModule::getScreenSurface (  )  const throw ( VideoException ) [virtual]

Returns the current screen surface, if any.

The video module keeps ownership of the returned surface : the caller should not deallocate it.

Exceptions:
VideoException if no screen surface is available.

Definition at line 154 of file OSDLVideo.cc.

References _screen.

Referenced by OSDL::Video::Overlay::Overlay().

void VideoModule::setScreenSurface ( Surface newScreenSurface  )  throw ( VideoException ) [virtual]

Assigns a new surface to the screen surface.

Parameters:
newScreenSurface the new screen surface, which must already have a display type corresponding to a screen surface (i.e. not BackBuffer).
See also:
Surface::setDisplayType
Exceptions:
VideoException if the display type of the specified surface does not correspond to a screen surface.

Definition at line 166 of file OSDLVideo.cc.

References OSDL::Video::Surface::BackBuffer.

bool VideoModule::hasRenderer (  )  const throw () [virtual]

Tells whether this video module uses a (video) renderer.

Definition at line 183 of file OSDLVideo.cc.

References _renderer.

OSDL::Rendering::VideoRenderer & VideoModule::getRenderer (  )  const throw ( VideoException ) [virtual]

Returns the video renderer currently used.

Returns:
the current video renderer.
Exceptions:
VideoException if no renderer was being used.

Definition at line 189 of file OSDLVideo.cc.

References _renderer.

void VideoModule::setRenderer ( Rendering::VideoRenderer newRenderer  )  throw () [virtual]

Sets a new video renderer.

This renderer will be in charge of all the subsequently view graphical rendering.

If a previous renderer was used, it will be deleted.

Note:
The renderer will be owned by this Video module and deallocated as such.

Definition at line 202 of file OSDLVideo.cc.

bool VideoModule::hasOpenGLContext (  )  const throw () [virtual]

Tells whether this video module has an OpenGL context.

Definition at line 214 of file OSDLVideo.cc.

References _openGLcontext.

Referenced by isUsingOpenGL().

void VideoModule::setOpenGLContext ( OpenGL::OpenGLContext newOpenGLContext  )  throw () [virtual]

Sets a new OpenGL context.

If a previous OpenGL context was used, it will be deleted first.

Note:
The OpenGL context will be owned by this Video module and deallocated as such.

Definition at line 235 of file OSDLVideo.cc.

OpenGL::OpenGLContext & VideoModule::getOpenGLContext (  )  const throw ( VideoException ) [virtual]

Returns the OpenGL context currently used.

Returns:
the current OpenGL context.
Exceptions:
VideoException if no OpenGL context was being used.

Definition at line 222 of file OSDLVideo.cc.

References _openGLcontext.

virtual BitsPerPixel OSDL::Video::VideoModule::getBestColorDepthForMode ( Length  width,
Length  height,
BitsPerPixel  askedBpp,
Ceylan::Flags  flags 
) throw () [virtual]

Returns what is the closest recommended bits per pixel choice for specified video mode, according to specified bits per pixel target.

Parameters are the same, and have the same meaning, as setMode's ones.

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.

bool VideoModule::isDisplayInitialized (  )  const throw () [virtual]

Tells whether the display is currently running, i.e.

if it has already been initialized and not been shut down at the moment.

Definition at line 261 of file OSDLVideo.cc.

References _displayInitialized.

Referenced by IsDisplayInitialized().

virtual Ceylan::Flags OSDL::Video::VideoModule::setMode ( Length  width,
Length  height,
BitsPerPixel  askedBpp,
Ceylan::Flags  flags,
OpenGL::Flavour  flavour = OpenGL::None 
) throw ( VideoException ) [virtual]

Tries to sets up a video mode with the specified width, height and bits-per-pixel.

Requested flags will be respected on a best effort basis, actually obtained flags will be returned.

Parameters:
width the client width (not counting window manager decorations) of the application window.
height the client height (not counting window manager decorations) of the application window.
askedBpp the requested color depth, in bits per pixel. If UseCurrentColorDepth (null) is specified, then the color depth of the display will be used.
flags describes the desired features, such as SoftwareSurface, Resizable, etc. One particularly useful feature is DoubleBuffered, since it allows to suppress most of the tearing on most platforms.
flavour the selected OpenGL flavour, if any, and if OpenGL is being used (see VideoModule::OpenGL setMode flag). Flavours have to be selected no later than this call.
Returns:
the flags that were actually obtained
Exceptions:
VideoException if the new setting of the new mode failed.
See also:
SDL counter-part, SDL_SetVideoMode (defined in http://sdldoc.csn.ul.ie/sdlsetvideomode.php)
Note:
If OpenGL is used, then asking for double-buffering (flag DoubleBuffered) is strongly recommended since it prevents nasty visual tearing.

void VideoModule::resize ( Length  newWidth,
Length  newHeight 
) throw ( VideoException ) [virtual]

Does everything needed when the application is resized, including calling setMode and updating OpenGL state if necessary.

Parameters:
newWidth the new width of the application window.
newHeight the new height of the application window.

Definition at line 448 of file OSDLVideo.cc.

References OSDL::Video::OpenGL::None, OSDL::Video::OpenGL::Reload, and OSDL::Video::Pixels::toString().

Referenced by OSDL::Events::EventsModule::onResizedWindow().

void VideoModule::redraw (  )  throw ( VideoException ) [virtual]

This method should be called whenever the screen needs to be redrawn, for example if the window manager asks for it.

Depending on a renderer being used or not, the screen will be managed.

Definition at line 485 of file OSDLVideo.cc.

References _screen, and OSDL::Video::Surface::redraw().

Referenced by OSDL::Events::EventsModule::enterBasicMainLoop(), and OSDL::Events::EventsModule::onScreenNeedsRedraw().

void VideoModule::toggleFullscreen (  )  throw ( VideoException ) [virtual]

Toggles the application between windowed and fullscreen mode, if supported.

Note:
X11 is the only target currently supported, BeOS support is experimental.

Definition at line 504 of file OSDLVideo.cc.

References _screen, OSDL::Utils::getBackendLastError(), and OSDL::Video::Surface::getSDLSurface().

bool VideoModule::getEndPointDrawState (  )  const throw () [virtual]

Tells whether line endpoint (final pixel) should be drawn.

Note:
Belongs to the state machine settings.
Returns:
true if draw-endpoint mode is set, false otherwise.

Definition at line 519 of file OSDLVideo.cc.

References _drawEndPoint.

Referenced by GetEndPointDrawState().

void VideoModule::setEndPointDrawState ( bool  newState  )  throw () [virtual]

Sets the draw-endpoint mode.

Note:
Belongs to the state machine settings.
Parameters:
newState the new draw-endpoint mode, activated if and only if true.

Definition at line 527 of file OSDLVideo.cc.

bool VideoModule::getAntiAliasingState (  )  const throw () [virtual]

Tells whether graphics should be anti-aliased, if possible.

Note:
Belongs to the state machine settings.
Returns:
true if anti-aliasing mode is set, false otherwise.

Definition at line 539 of file OSDLVideo.cc.

References _antiAliasing.

Referenced by GetAntiAliasingState().

void VideoModule::setAntiAliasingState ( bool  newState  )  throw () [virtual]

Sets the anti-aliasing mode.

Note:
Belongs to the state machine settings.
Parameters:
newState the new anti-aliasing mode, activated if and only if true.

Definition at line 547 of file OSDLVideo.cc.

const std::string VideoModule::getDriverName (  )  const throw () [virtual]

Returns the name of the video driver being currently used (example : 'x11').

See also:
GetDriverName

Definition at line 558 of file OSDLVideo.cc.

References DriverNameMaximumLength.

virtual void OSDL::Video::VideoModule::setWindowCaption ( const std::string &  newTitle,
const std::string &  iconName 
) throw () [virtual]

Sets the window title and icon name.

Parameters:
newTitle the new window title.
iconName the new icon name.

virtual void OSDL::Video::VideoModule::getWindowCaption ( std::string &  title,
std::string &  iconName 
) throw () [virtual]

Gets the window title and icon name.

Parameters:
title the current window title.
iconName the icon name
Note:
Uses the specified strings to return title and icon.

void VideoModule::setWindowIcon ( const std::string &  filename  )  throw ( VideoException ) [virtual]

Sets the icon for the display window.

Parameters:
filename the name of the file containing the icon. Its format (ex : PNG) should be auto-detected.
Note:
Win32 icons must be 32x32.

This function must be called before the first call to setMode.

The specified surface will have to be deallocated on exit by the user code.

See also:
LoadImage

Definition at line 597 of file OSDLVideo.cc.

References OSDL::Video::Surface::getSDLSurface(), and OSDL::Video::TwoDimensional::Image::LoadIcon().

bool VideoModule::iconifyWindow (  )  throw () [virtual]

Iconifies (minimizes) the window.

Note:
If the application is running in a window managed environment, this method attempts to iconify (minimise) it. If this call is successful, the application will receive an ApplicationFocus loss event.
Returns:
true on success, false if iconification is not supported or was refused by the window manager.

Definition at line 652 of file OSDLVideo.cc.

bool VideoModule::getFrameAccountingState (  )  throw () [virtual]

Tells whether frames shoud be monitored to know the frame-per-second (FPS) indicator.

Note:
Belongs to the state machine settings.
Returns:
true if frame accounting mode is set, false otherwise.

Definition at line 661 of file OSDLVideo.cc.

References _frameAccountingState.

void VideoModule::setFrameAccountingState ( bool  newState  )  throw () [virtual]

Sets the frame-accounting mode.

If activated, the frame rate will be computed.

Note:
Belongs to the state machine settings.
Parameters:
newState the new frame-counting mode, activated if and only if true.

Definition at line 669 of file OSDLVideo.cc.

bool VideoModule::isUsingOpenGL (  )  const throw () [virtual]

Tells whether OpenGL is being used currently by this video module.

Definition at line 677 of file OSDLVideo.cc.

References hasOpenGLContext().

const string VideoModule::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const throw () [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Definition at line 685 of file OSDLVideo.cc.

References OSDL::Video::Pixels::toString().

bool VideoModule::IsDisplayInitialized (  )  throw () [static]

Tells whether display has already been initialized (VideoModule::setMode called).

Note:
This method is static so that calling it is convenient : no need to explicitly retrieve the common module, then the video module, before knowing the result.
The need to retrieve the right module from scratch at each call is rather inefficient though.

Definition at line 734 of file OSDLVideo.cc.

References OSDL::getExistingCommonModule(), OSDL::CommonModule::getVideoModule(), OSDL::hasExistingCommonModule(), OSDL::CommonModule::hasVideoModule(), and isDisplayInitialized().

Referenced by OSDL::Video::TwoDimensional::Image::Load(), OSDL::Video::TwoDimensional::Image::LoadBMP(), OSDL::Video::TwoDimensional::Image::LoadGIF(), OSDL::Video::TwoDimensional::Image::LoadJPG(), OSDL::Video::TwoDimensional::Image::LoadLBM(), OSDL::Video::TwoDimensional::Image::LoadPCX(), OSDL::Video::TwoDimensional::Image::LoadPNG(), OSDL::Video::TwoDimensional::Image::LoadPNM(), OSDL::Video::TwoDimensional::Image::LoadTGA(), OSDL::Video::TwoDimensional::Image::LoadXPM(), and OSDL::Video::OpenGL::OpenGLContext::selectFlavour().

bool VideoModule::GetEndPointDrawState (  )  throw () [static]

Tells whether the last pixel of a segment of line should be drawn.

Note:
This method is static so that calling it is convenient : no need to explicitly retrieve the common module, then the video module, before knowing the result.
The need to retrieve the right module from scratch at each call is rather inefficient though.

Definition at line 759 of file OSDLVideo.cc.

References _DrawEndPoint, getEndPointDrawState(), OSDL::getExistingCommonModule(), OSDL::CommonModule::getVideoModule(), OSDL::hasExistingCommonModule(), OSDL::CommonModule::hasVideoModule(), and OSDL::Video::Pixels::toString().

bool VideoModule::GetAntiAliasingState (  )  throw () [static]

Tells whether antialiasing is wanted.

Note:
This method is static so that calling it is convenient : no need to explicitly retrieve the common module, then the video module, before knowing the result.
The need to retrieve the right module from scratch at each call is rather inefficient though.

Definition at line 808 of file OSDLVideo.cc.

References _AntiAliasing, getAntiAliasingState(), OSDL::getExistingCommonModule(), OSDL::CommonModule::getVideoModule(), OSDL::hasExistingCommonModule(), OSDL::CommonModule::hasVideoModule(), and OSDL::Video::Pixels::toString().

Referenced by OSDL::Video::Surface::resize().

const string VideoModule::GetDriverName (  )  throw () [static]

Returns the name of the video driver being currently used (example : 'x11').

See also:
getDriverName.

Definition at line 856 of file OSDLVideo.cc.

References DriverNameMaximumLength.

static std::string OSDL::Video::VideoModule::InterpretFlags ( Ceylan::Flags  flags  )  throw () [static]

Describes specified video flags according to the semantics used in setMode.

Note:
One shall not call this method on flags used with a surface. Use Surface::interpretFlags instead, since their meaning is different.
See also:
setMode.

bool VideoModule::HardwareSurfacesCanBeCreated (  )  throw ( VideoException ) [static]

Returns whether hardware surfaces can be created.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 999 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

bool VideoModule::WindowManagerAvailable (  )  throw ( VideoException ) [static]

Returns whether there is a window manager available.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1013 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

bool VideoModule::HardwareToHardwareBlitsAccelerated (  )  throw ( VideoException ) [static]

Returns whether hardware to hardware blits are accelerated.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1027 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

bool VideoModule::HardwareToHardwareColorkeyBlitsAccelerated (  )  throw ( VideoException ) [static]

Returns whether hardware to hardware colorkey blits are accelerated.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1041 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

bool VideoModule::HardwareToHardwareAlphaBlitsAccelerated (  )  throw ( VideoException ) [static]

Returns whether hardware to hardware alpha blits are accelerated.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1056 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

bool VideoModule::SoftwareToHardwareBlitsAccelerated (  )  throw ( VideoException ) [static]

Returns whether software to hardware blits are accelerated.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1071 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

bool VideoModule::SoftwareToHardwareColorkeyBlitsAccelerated (  )  throw ( VideoException ) [static]

Returns whether software to hardware colorkey blits are accelerated.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1085 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

bool VideoModule::SoftwareToHardwareAlphaBlitsAccelerated (  )  throw ( VideoException ) [static]

Returns whether software to hardware alpha blits are accelerated.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1100 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

bool VideoModule::ColorFillsAccelerated (  )  throw ( VideoException ) [static]

Returns whether color fills are accelerated.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1115 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

Ceylan::Uint32 VideoModule::GetVideoMemorySize (  )  throw ( VideoException ) [static]

Returns the total amount of video memory, in kilobytes.

Exceptions:
VideoException if the information could not be obtained.

Definition at line 1129 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

Pixels::PixelFormat VideoModule::GetVideoDevicePixelFormat (  )  throw ( VideoException ) [static]

Returns the native format of the video device.

Returns:
If the graphics system has already been initialized (using setMode), returns the pixel format of the current video mode, otherwise returns the pixel format of the "best" available video mode.
Exceptions:
VideoException if the information could not be obtained.

Definition at line 1143 of file OSDLVideo.cc.

Referenced by DescribeVideoCapabilities().

string VideoModule::DescribeVideoCapabilities (  )  throw ( VideoException ) [static]

Returns a summary of video chain capabilities.

Exceptions:
VideoException if video informations could not be retrieved.

Definition at line 1158 of file OSDLVideo.cc.

References ColorFillsAccelerated(), GetVideoDevicePixelFormat(), GetVideoMemorySize(), HardwareSurfacesCanBeCreated(), HardwareToHardwareAlphaBlitsAccelerated(), HardwareToHardwareBlitsAccelerated(), HardwareToHardwareColorkeyBlitsAccelerated(), SoftwareToHardwareAlphaBlitsAccelerated(), SoftwareToHardwareBlitsAccelerated(), SoftwareToHardwareColorkeyBlitsAccelerated(), OSDL::Video::Pixels::toString(), and WindowManagerAvailable().

static bool OSDL::Video::VideoModule::AreDefinitionsRestricted ( std::list< Definition > &  definitions,
Ceylan::Flags  flags,
Pixels::PixelFormat pixelFormat = 0 
) throw () [static]

Tells whether definitions are restricted for the specified flags and pixel format.

Returns:
false if all definitions are possible for the given pixel format, true if dimensions are restricted, and in this case in the specified list (definitions) available dimension pairs are stored, if any.
Parameters:
definitions an empty list in which dimension pairs will be stored, if not all dimensions are allowed for the given pixel format. The list may remain empty, if nothing is available for specified choice.
flags describes the desired screen surface, with the same meaning as the setMode flags.
format : desired pixel format. If format is null (0), the definition list will correspond to the "best" mode available.

static std::string OSDL::Video::VideoModule::DescribeAvailableDefinitions ( Ceylan::Flags  flags,
Pixels::PixelFormat pixelFormat = 0 
) throw () [static]

Returns a summary of available screen definitions for specified flags and pixel format.

Parameters:
flags describes a target screen surface, with the same meaning as the setMode flags.
format : desired pixel format. If format is null (0), the definition list will correspond to the "best" mode available.

string VideoModule::DescribeEnvironmentVariables (  )  throw () [static]

Returns a summary about the possible use of video-related environment variables, for the selected back-end, expressed in specified format.

Note:
The SDL back-end can be partly driven by a set of environment variables.

Definition at line 1366 of file OSDLVideo.cc.

References _SDLEnvironmentVariables, and OSDL::Video::Pixels::toString().

static bool OSDL::Video::VideoModule::IsUsingOpenGL (  )  throw ( VideoException ) [static]

Returns whether OpenGL is being used, at least by one video module.

Exceptions:
VideoException if the information could not be obtained.

VideoModule& OSDL::Video::VideoModule::operator= ( const VideoModule source  )  throw () [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.


Friends And Related Function Documentation

friend class OSDL::CommonModule [friend]

Definition at line 80 of file OSDLVideo.h.


Member Data Documentation

const BitsPerPixel VideoModule::UseCurrentColorDepth [static]

Tells setMode that the color depth of the current display should be used.

Convenient for applications running into a window. This value is equal to zero.

Definition at line 274 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::SoftwareSurface [static]

Indicates that the screen surface is to be stored in system memory.

Definition at line 806 of file OSDLVideo.h.

Referenced by OSDL::Video::OpenGL::GLTexture::upload().

const Ceylan::Flags VideoModule::HardwareSurface [static]

Indicates that the screen surface is to be stored in video memory.

Definition at line 814 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::AsynchronousBlit [static]

Enables the use of asynchronous updates of the display surface.

Definition at line 821 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::AnyPixelFormat [static]

Indicates that the screen surface may use any pixel format.

Definition at line 825 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::ExclusivePalette [static]

Indicates that a surface should have an exclusive palette.

Definition at line 829 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::DoubleBuffered [static]

Indicates that the screen surface is to be double buffered.

Works also if OpenGL is used.

Definition at line 838 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::FullScreen [static]

Indicates that the screen surface is to be full screen, not windowed.

Definition at line 846 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::OpenGL [static]

Indicates that the screen surface should have an OpenGL context.

Definition at line 854 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::Resizable [static]

Indicates that the screen surface is to be resizable.

Definition at line 861 of file OSDLVideo.h.

const Ceylan::Flags VideoModule::NoFrame [static]

Indicates that a window which would correspond to a screen surface should have no title bar nor frame decoration, if possible.

Definition at line 870 of file OSDLVideo.h.

Surface* OSDL::Video::VideoModule::_screen [protected]

Internal surface corresponding to the screen.

Definition at line 884 of file OSDLVideo.h.

Referenced by getScreenSurface(), hasScreenSurface(), redraw(), toggleFullscreen(), and ~VideoModule().

bool OSDL::Video::VideoModule::_displayInitialized [protected]

Keeps tracks of setMode calls, be OpenGL used or not.

Definition at line 891 of file OSDLVideo.h.

Referenced by isDisplayInitialized().

Rendering::VideoRenderer* OSDL::Video::VideoModule::_renderer [protected]

The video renderer being used, if any.

Definition at line 895 of file OSDLVideo.h.

Referenced by getRenderer(), hasRenderer(), and ~VideoModule().

bool VideoModule::_IsUsingOpenGL [static, protected]

Caches the current state relative to the current use of OpenGL.

Note:
This cached value can be used to avoid overhead in case of very frequent reads with only one video module instanciated (the general case).

Definition at line 908 of file OSDLVideo.h.

bool VideoModule::_DrawEndPoint [static, protected]

Caches the current state relative to final pixel drawing for lines.

Note:
This cached value can be used to avoid overhead in case of very frequent reads with only one video module instanciated (the general case).

Definition at line 920 of file OSDLVideo.h.

Referenced by GetEndPointDrawState().

bool VideoModule::_AntiAliasing [static, protected]

Caches the current state relative to antialiasing.

Note:
This cached value can be used to avoid overhead in case of very frequent reads with only one video module instanciated (the general case).

Definition at line 931 of file OSDLVideo.h.

Referenced by GetAntiAliasingState().

bool OSDL::Video::VideoModule::_frameAccountingState [protected]

Records the current frame-accounting state, which tells if frame rate is to be monitored.

Note:
Default value : true.

Definition at line 942 of file OSDLVideo.h.

Referenced by getFrameAccountingState().

const Ceylan::Uint16 VideoModule::DriverNameMaximumLength [static, protected]

The maximum length for the name of the display driver.

Definition at line 946 of file OSDLVideo.h.

Referenced by GetDriverName(), and getDriverName().

OpenGL::OpenGLContext* OSDL::Video::VideoModule::_openGLcontext [private]

The current OpenGL context, if OpenGL is used.

Note:
Private to ensure cache consistency is enforced.

Definition at line 992 of file OSDLVideo.h.

Referenced by getOpenGLContext(), hasOpenGLContext(), and ~VideoModule().

bool OSDL::Video::VideoModule::_drawEndPoint [private]

Records the current state relative to final pixel drawing for lines.

Note:
Default value : false.

Private to ensure cache consistency is enforced.

Definition at line 1004 of file OSDLVideo.h.

Referenced by getEndPointDrawState().

bool OSDL::Video::VideoModule::_antiAliasing [private]

Records the current antialiasing state.

Note:
Default value : true.

Private to ensure cache consistency is enforced.

Definition at line 1015 of file OSDLVideo.h.

Referenced by getAntiAliasingState().

string VideoModule::_SDLEnvironmentVariables [static, private]

Array of all known environment variables related to video, for SDL back-end.

Definition at line 1065 of file OSDLVideo.h.

Referenced by DescribeEnvironmentVariables().


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 14:47:31 2007 for OSDL by  doxygen 1.5.1