Root module for all video needs. More...
#include <OSDLVideo.h>
Public Member Functions | |
bool | hasScreenSurface () const |
Returns whether a screen surface is available. | |
virtual Surface & | getScreenSurface () const |
Returns the current screen surface, if any. | |
virtual void | setScreenSurface (Surface &newScreenSurface) |
Assigns a new surface to the screen surface. | |
virtual bool | hasRenderer () const |
Tells whether this video module uses a (video) renderer. | |
virtual Rendering::VideoRenderer & | getRenderer () const |
Returns the video renderer currently used. | |
virtual void | setRenderer (Rendering::VideoRenderer &newRenderer) |
Sets a new video renderer. | |
virtual bool | hasOpenGLContext () const |
Tells whether this video module has an OpenGL context. | |
virtual void | setOpenGLContext (OpenGL::OpenGLContext &newOpenGLContext) |
Sets a new OpenGL context. | |
virtual OpenGL::OpenGLContext & | getOpenGLContext () const |
Returns the OpenGL context currently used. | |
virtual BitsPerPixel | getBestColorDepthForMode (Length width, Length height, BitsPerPixel askedBpp, Ceylan::Flags flags) |
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 |
Tells whether the display is currently running, i.e. | |
virtual bool | isGUIEnabled () const |
Tells whether a GUI (Graphical User Interface) is being managed by this video module. | |
virtual void | setGUIEnableStatus (bool newStatus) |
Determines whether a GUI (Graphical User Interface) should be used. | |
virtual Ceylan::Flags | setMode (Length width, Length height, BitsPerPixel askedBpp, Ceylan::Flags flags, OpenGL::Flavour flavour=OpenGL::None) |
Tries to sets up a video mode with the specified width, height and bits-per-pixel. | |
virtual void | resize (Length newWidth, Length newHeight) |
Does everything needed when the application is resized, including calling setMode and updating OpenGL state if necessary. | |
virtual void | redraw () |
This method should be called whenever the screen needs to be redrawn, for example if the window manager asks for it. | |
virtual void | toggleFullscreen () |
Toggles the application between windowed and fullscreen mode, if supported. | |
virtual void | makeBMPScreenshot (const std::string &screenshotFilename) |
Performs a screenshot of onscreen content, and saves it in a BMP file whose name is specified. | |
virtual bool | getEndPointDrawState () const |
Tells whether line endpoint (final pixel) should be drawn. | |
virtual void | setEndPointDrawState (bool newState) |
Sets the draw-endpoint mode. | |
virtual bool | getAntiAliasingState () const |
Tells whether graphics should be anti-aliased, if possible. | |
virtual void | setAntiAliasingState (bool newState) |
Sets the anti-aliasing mode. | |
virtual std::string | getDriverName () const |
Returns the name of the video driver being currently used (example: 'x11'). | |
virtual void | setWindowCaption (const std::string &newTitle, const std::string &iconName) |
Sets the window title and icon name. | |
virtual void | getWindowCaption (std::string &title, std::string &iconName) |
Gets the window title and icon name. | |
virtual void | setWindowIcon (const std::string &filename) |
Sets the icon for the display window. | |
virtual bool | iconifyWindow () |
Iconifies (minimizes) the window. | |
virtual Ceylan::Float32 | getAverageRefreshRate () |
Returns the current average refresh rate (in frames per second) of the screen surface, since its creation. | |
virtual bool | isUsingOpenGL () const |
Tells whether OpenGL is being used currently by this video module. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns an user-friendly description of the state of this object. | |
Static Public Member Functions | |
static bool | IsDisplayInitialized () |
Tells whether display has already been initialized (VideoModule::setMode called). | |
static bool | GetEndPointDrawState () |
Tells whether the last pixel of a segment of line should be drawn. | |
static bool | GetAntiAliasingState () |
Tells whether antialiasing is wanted. | |
static std::string | GetDriverName () |
Returns the name of the video driver being currently used (example: 'x11'). | |
static std::string | InterpretFlags (Ceylan::Flags flags) |
Describes specified video flags according to the semantics used in setMode. | |
static bool | HardwareSurfacesCanBeCreated () |
Returns whether hardware surfaces can be created. | |
static bool | WindowManagerAvailable () |
Returns whether there is a window manager available. | |
static bool | HardwareToHardwareBlitsAccelerated () |
Returns whether hardware to hardware blits are accelerated. | |
static bool | HardwareToHardwareColorkeyBlitsAccelerated () |
Returns whether hardware to hardware colorkey blits are accelerated. | |
static bool | HardwareToHardwareAlphaBlitsAccelerated () |
Returns whether hardware to hardware alpha blits are accelerated. | |
static bool | SoftwareToHardwareBlitsAccelerated () |
Returns whether software to hardware blits are accelerated. | |
static bool | SoftwareToHardwareColorkeyBlitsAccelerated () |
Returns whether software to hardware colorkey blits are accelerated. | |
static bool | SoftwareToHardwareAlphaBlitsAccelerated () |
Returns whether software to hardware alpha blits are accelerated. | |
static bool | ColorFillsAccelerated () |
Returns whether color fills are accelerated. | |
static Ceylan::Uint32 | GetVideoMemorySize () |
Returns the total amount of video memory, in kilobytes. | |
static Pixels::PixelFormat | GetVideoDevicePixelFormat () |
Returns the native format of the video device. | |
static std::string | DescribeVideoCapabilities () |
Returns a summary of video chain capabilities. | |
static bool | AreDefinitionsRestricted (std::list< Definition > &definitions, Ceylan::Flags flags, Pixels::PixelFormat *pixelFormat=0) |
Tells whether definitions are restricted for the specified flags and pixel format. | |
static std::string | DescribeAvailableDefinitions (Ceylan::Flags flags, Pixels::PixelFormat *pixelFormat=0) |
Returns a summary of available screen definitions for specified flags and pixel format. | |
static StandardScreenSize | ToStandardScreenSize (const std::string &standardScreenSizeInText) |
Returns the standard screen size corresponding to the specified text. | |
static void | ToScreenDimensions (StandardScreenSize screenSize, Length &screenWidth, Length &screenHeight) |
Returns (in specified variables) the screen dimensions corresponding to the specified physical standard screen size. | |
static std::string | DescribeEnvironmentVariables () |
Returns a summary about the possible use of video-related environment variables, for the selected back-end, expressed in specified format. | |
static bool | IsUsingOpenGL () |
Returns whether OpenGL is being used, at least by one video module. | |
static bool | IsUsingDrawingPrimitives () |
Returns whether drawing primitives can be rendered. | |
Static Public Attributes | |
static const BitsPerPixel | UseCurrentColorDepth = 0 |
Tells setMode that the color depth of the current display should be used. | |
static const Ceylan::Flags | SoftwareSurface = 0x00000000 |
Indicates that the screen surface is to be stored in system memory. | |
static const Ceylan::Flags | HardwareSurface = 0x00000001 |
Indicates that the screen surface is to be stored in video memory. | |
static const Ceylan::Flags | AsynchronousBlit = 0x00000004 |
Enables the use of asynchronous updates of the display surface. | |
static const Ceylan::Flags | AnyPixelFormat = 0x10000000 |
Indicates that the screen surface may use any pixel format. | |
static const Ceylan::Flags | ExclusivePalette = 0x20000000 |
Indicates that a surface should have an exclusive palette. | |
static const Ceylan::Flags | DoubleBuffered = 0x40000000 |
Indicates that the screen surface is to be double buffered. | |
static const Ceylan::Flags | FullScreen = 0x80000000 |
Indicates that the screen surface is to be full screen, not windowed. | |
static const Ceylan::Flags | OpenGL = 0x00000002 |
Indicates that the screen surface should have an OpenGL context. | |
static const Ceylan::Flags | Resizable = 0x00000010 |
Indicates that the screen surface is to be resizable. | |
static const Ceylan::Flags | NoFrame = 0x00000020 |
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. | |
bool | _isGuiEnabled |
Tells whether a graphical user interface is to be managed. | |
Rendering::VideoRenderer * | _renderer |
The video renderer being used, if any. | |
Static Protected Attributes | |
static bool | _IsUsingOpenGL = false |
Caches the current state relative to the current use of OpenGL. | |
static bool | _DrawEndPoint = false |
Caches the current state relative to final pixel drawing for lines. | |
static bool | _AntiAliasing = true |
Caches the current state relative to antialiasing. | |
static const Ceylan::Uint16 | DriverNameMaximumLength = 50 |
The maximum length for the name of the display driver. | |
Private Member Functions | |
VideoModule () | |
Private constructor to be sure it will not be implicitly called. | |
virtual | ~VideoModule () throw () |
Basic virtual private destructor. | |
VideoModule (const VideoModule &source) | |
Copy constructor made private to ensure that it will never be called. | |
VideoModule & | operator= (const VideoModule &source) |
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. | |
Ceylan::System::Second | _screenStartingSecond |
Stores the second at which the screen surface (if any) was created, to compute its average refresh rate (frames per second). | |
Ceylan::System::Microsecond | _screenStartingMicrosecond |
Stores the microsecond at which the screen surface (if any) was created, to compute its average refresh rate (frames per second). | |
Static Private Attributes | |
static const std::string | _SDLEnvironmentVariables [] = {} |
Array of all known environment variables related to video, for SDL back-end. | |
Friends | |
class | OSDL::CommonModule |
Root module for all video needs.
Notably manages the screen surface.
Definition at line 123 of file OSDLVideo.h.
VideoModule::VideoModule | ( | ) | [private] |
Private constructor to be sure it will not be implicitly called.
VideoException | if the video subsystem initialization failed. |
Definition at line 218 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 284 of file OSDLVideo.cc.
References _openGLcontext, _renderer, _screen, getAverageRefreshRate(), OSDL::Video::Pixels::toString(), and OSDL::CommonModule::UseVideo.
OSDL::Video::VideoModule::VideoModule | ( | const VideoModule & | source | ) | [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.
bool VideoModule::AreDefinitionsRestricted | ( | std::list< Definition > & | definitions, | |
Ceylan::Flags | flags, | |||
Pixels::PixelFormat * | pixelFormat = 0 | |||
) | [static] |
Tells whether definitions are restricted for the specified flags and pixel format.
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. |
VideoException | if the operation failed or is not supported. |
Definition at line 1919 of file OSDLVideo.cc.
References LOG_DEBUG_VIDEO, LOG_TRACE_VIDEO, and OSDL::Video::Pixels::toString().
Referenced by DescribeAvailableDefinitions().
bool VideoModule::ColorFillsAccelerated | ( | ) | [static] |
Returns whether color fills are accelerated.
VideoException | if the information could not be obtained. |
Definition at line 1747 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
string VideoModule::DescribeAvailableDefinitions | ( | Ceylan::Flags | flags, | |
Pixels::PixelFormat * | pixelFormat = 0 | |||
) | [static] |
Returns a summary of available screen definitions for specified flags and pixel format.
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. |
VideoException | if the operation failed. |
Definition at line 2004 of file OSDLVideo.cc.
References AreDefinitionsRestricted(), LOG_TRACE_VIDEO, and OSDL::Video::Pixels::toString().
string VideoModule::DescribeEnvironmentVariables | ( | ) | [static] |
Returns a summary about the possible use of video-related environment variables, for the selected back-end, expressed in specified format.
Definition at line 2172 of file OSDLVideo.cc.
References _SDLEnvironmentVariables, and toString().
string VideoModule::DescribeVideoCapabilities | ( | ) | [static] |
Returns a summary of video chain capabilities.
VideoException | if video informations could not be retrieved. |
Definition at line 1821 of file OSDLVideo.cc.
References ColorFillsAccelerated(), GetVideoDevicePixelFormat(), GetVideoMemorySize(), HardwareSurfacesCanBeCreated(), HardwareToHardwareAlphaBlitsAccelerated(), HardwareToHardwareBlitsAccelerated(), HardwareToHardwareColorkeyBlitsAccelerated(), SoftwareToHardwareAlphaBlitsAccelerated(), SoftwareToHardwareBlitsAccelerated(), SoftwareToHardwareColorkeyBlitsAccelerated(), OSDL::Video::Pixels::toString(), and WindowManagerAvailable().
bool VideoModule::GetAntiAliasingState | ( | ) | [static] |
Tells whether antialiasing is wanted.
The need to retrieve the right module from scratch at each call is rather inefficient though.
Definition at line 1345 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::TwoDimensional::drawCircle(), OSDL::Video::TwoDimensional::drawEllipse(), OSDL::Video::TwoDimensional::drawPolygon(), OSDL::Video::TwoDimensional::drawTriangle(), and OSDL::Video::Surface::resize().
bool VideoModule::getAntiAliasingState | ( | ) | const [virtual] |
Tells whether graphics should be anti-aliased, if possible.
Definition at line 1041 of file OSDLVideo.cc.
References _antiAliasing.
Referenced by GetAntiAliasingState().
Ceylan::Float32 VideoModule::getAverageRefreshRate | ( | ) | [virtual] |
Returns the current average refresh rate (in frames per second) of the screen surface, since its creation.
VideoException | if the operation failed, including if no screen surface is actually available. |
Definition at line 1184 of file OSDLVideo.cc.
References _screen, _screenStartingMicrosecond, _screenStartingSecond, and OSDL::Video::Surface::getUpdateCount().
Referenced by ~VideoModule().
BitsPerPixel VideoModule::getBestColorDepthForMode | ( | Length | width, | |
Length | height, | |||
BitsPerPixel | askedBpp, | |||
Ceylan::Flags | flags | |||
) | [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.
Definition at line 429 of file OSDLVideo.cc.
string VideoModule::GetDriverName | ( | ) | [static] |
Returns the name of the video driver being currently used (example: 'x11').
VideoException | if the operation failed. |
Definition at line 1393 of file OSDLVideo.cc.
References DriverNameMaximumLength.
Referenced by getDriverName().
std::string VideoModule::getDriverName | ( | ) | const [virtual] |
Returns the name of the video driver being currently used (example: 'x11').
VideoException | if the operation failed. |
Definition at line 1062 of file OSDLVideo.cc.
References GetDriverName().
bool VideoModule::GetEndPointDrawState | ( | ) | [static] |
Tells whether the last pixel of a segment of line should be drawn.
The need to retrieve the right module from scratch at each call is rather inefficient though.
Definition at line 1295 of file OSDLVideo.cc.
References _DrawEndPoint, getEndPointDrawState(), OSDL::getExistingCommonModule(), OSDL::CommonModule::getVideoModule(), OSDL::hasExistingCommonModule(), OSDL::CommonModule::hasVideoModule(), and OSDL::Video::Pixels::toString().
bool VideoModule::getEndPointDrawState | ( | ) | const [virtual] |
Tells whether line endpoint (final pixel) should be drawn.
Definition at line 1020 of file OSDLVideo.cc.
References _drawEndPoint.
Referenced by GetEndPointDrawState().
OpenGL::OpenGLContext & VideoModule::getOpenGLContext | ( | ) | const [virtual] |
Returns the OpenGL context currently used.
VideoException | if no OpenGL context was being used. |
Definition at line 401 of file OSDLVideo.cc.
References _openGLcontext.
OSDL::Rendering::VideoRenderer & VideoModule::getRenderer | ( | ) | const [virtual] |
Returns the video renderer currently used.
VideoException | if no renderer was being used. |
Definition at line 367 of file OSDLVideo.cc.
References _renderer.
Surface & VideoModule::getScreenSurface | ( | ) | const [virtual] |
Returns the current screen surface, if any.
The video module keeps ownership of the returned surface: the caller should not deallocate it.
VideoException | if no screen surface is available. |
Definition at line 329 of file OSDLVideo.cc.
References _screen.
Referenced by makeBMPScreenshot(), and OSDL::Video::Overlay::Overlay().
Pixels::PixelFormat VideoModule::GetVideoDevicePixelFormat | ( | ) | [static] |
Returns the native format of the video device.
VideoException | if the information could not be obtained. |
Definition at line 1797 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
Ceylan::Uint32 VideoModule::GetVideoMemorySize | ( | ) | [static] |
Returns the total amount of video memory, in kilobytes.
VideoException | if the information could not be obtained. |
Definition at line 1773 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
void VideoModule::getWindowCaption | ( | std::string & | title, | |
std::string & | iconName | |||
) | [virtual] |
Gets the window title and icon name.
title | the current window title. | |
iconName | the icon name |
Definition at line 1085 of file OSDLVideo.cc.
bool VideoModule::HardwareSurfacesCanBeCreated | ( | ) | [static] |
Returns whether hardware surfaces can be created.
VideoException | if the information could not be obtained. |
Definition at line 1546 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
bool VideoModule::HardwareToHardwareAlphaBlitsAccelerated | ( | ) | [static] |
Returns whether hardware to hardware alpha blits are accelerated.
VideoException | if the information could not be obtained. |
Definition at line 1646 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
bool VideoModule::HardwareToHardwareBlitsAccelerated | ( | ) | [static] |
Returns whether hardware to hardware blits are accelerated.
VideoException | if the information could not be obtained. |
Definition at line 1594 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
bool VideoModule::HardwareToHardwareColorkeyBlitsAccelerated | ( | ) | [static] |
Returns whether hardware to hardware colorkey blits are accelerated.
VideoException | if the information could not be obtained. |
Definition at line 1620 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
bool VideoModule::hasOpenGLContext | ( | ) | const [virtual] |
Tells whether this video module has an OpenGL context.
Definition at line 392 of file OSDLVideo.cc.
References _openGLcontext.
Referenced by isUsingOpenGL(), and setMode().
bool VideoModule::hasRenderer | ( | ) | const [virtual] |
Tells whether this video module uses a (video) renderer.
Definition at line 358 of file OSDLVideo.cc.
References _renderer.
bool VideoModule::hasScreenSurface | ( | ) | const |
Returns whether a screen surface is available.
Definition at line 320 of file OSDLVideo.cc.
References _screen.
bool VideoModule::iconifyWindow | ( | ) | [virtual] |
Iconifies (minimizes) the window.
Definition at line 1166 of file OSDLVideo.cc.
string VideoModule::InterpretFlags | ( | Ceylan::Flags | flags | ) | [static] |
Describes specified video flags according to the semantics used in setMode.
Definition at line 1416 of file OSDLVideo.cc.
References AnyPixelFormat, AsynchronousBlit, DoubleBuffered, ExclusivePalette, FullScreen, HardwareSurface, NoFrame, OpenGL, Resizable, and toString().
Referenced by setMode().
bool VideoModule::IsDisplayInitialized | ( | ) | [static] |
Tells whether display has already been initialized (VideoModule::setMode called).
The need to retrieve the right module from scratch at each call is rather inefficient though.
Definition at line 1269 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(), and OSDL::Video::TwoDimensional::Image::LoadXPM().
bool VideoModule::isDisplayInitialized | ( | ) | const [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 447 of file OSDLVideo.cc.
References _displayInitialized.
Referenced by IsDisplayInitialized(), and setWindowIcon().
bool VideoModule::isGUIEnabled | ( | ) | const [virtual] |
Tells whether a GUI (Graphical User Interface) is being managed by this video module.
Definition at line 455 of file OSDLVideo.cc.
References _isGuiEnabled.
bool VideoModule::IsUsingDrawingPrimitives | ( | ) | [static] |
Returns whether drawing primitives can be rendered.
VideoException | if the information could not be obtained. |
Definition at line 2233 of file OSDLVideo.cc.
bool VideoModule::IsUsingOpenGL | ( | ) | [static] |
Returns whether OpenGL is being used, at least by one video module.
VideoException | if the information could not be obtained. |
Definition at line 2225 of file OSDLVideo.cc.
References _IsUsingOpenGL.
bool VideoModule::isUsingOpenGL | ( | ) | const [virtual] |
Tells whether OpenGL is being used currently by this video module.
Definition at line 1207 of file OSDLVideo.cc.
References hasOpenGLContext().
void VideoModule::makeBMPScreenshot | ( | const std::string & | screenshotFilename | ) | [virtual] |
Performs a screenshot of onscreen content, and saves it in a BMP file whose name is specified.
screenshotFilename | the target screenshot filename |
VideoException | if the operation failed. |
Definition at line 875 of file OSDLVideo.cc.
References getScreenSurface(), and OSDL::Video::Surface::saveBMP().
VideoModule& OSDL::Video::VideoModule::operator= | ( | const VideoModule & | source | ) | [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.
void VideoModule::redraw | ( | ) | [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 786 of file OSDLVideo.cc.
References _screen, and OSDL::Video::Surface::redraw().
Referenced by OSDL::Events::EventsModule::enterBasicMainLoop(), and OSDL::Events::EventsModule::onScreenNeedsRedraw().
Does everything needed when the application is resized, including calling setMode and updating OpenGL state if necessary.
newWidth | the new width of the application window. | |
newHeight | the new height of the application window. |
Definition at line 749 of file OSDLVideo.cc.
References _openGLcontext, _screen, OSDL::Video::Surface::getBitsPerPixel(), OSDL::Video::Surface::getFlags(), OSDL::Video::OpenGL::None, OSDL::Video::OpenGL::Reload, setMode(), and OSDL::Video::Pixels::toString().
Referenced by OSDL::Events::EventsModule::onResizedWindow().
void VideoModule::setAntiAliasingState | ( | bool | newState | ) | [virtual] |
Sets the anti-aliasing mode.
newState | the new anti-aliasing mode, activated if and only if true. |
Definition at line 1050 of file OSDLVideo.cc.
References _AntiAliasing, and _antiAliasing.
void VideoModule::setEndPointDrawState | ( | bool | newState | ) | [virtual] |
Sets the draw-endpoint mode.
newState | the new draw-endpoint mode, activated if and only if true. |
Definition at line 1029 of file OSDLVideo.cc.
References _DrawEndPoint, and _drawEndPoint.
void VideoModule::setGUIEnableStatus | ( | bool | newStatus | ) | [virtual] |
Determines whether a GUI (Graphical User Interface) should be used.
newStatus | the new enable status of the GUI. |
Definition at line 464 of file OSDLVideo.cc.
References _isGuiEnabled.
Referenced by OSDL::CommonModule::enableGUI().
Ceylan::Flags VideoModule::setMode | ( | Length | width, | |
Length | height, | |||
BitsPerPixel | askedBpp, | |||
Ceylan::Flags | flags, | |||
OpenGL::Flavour | flavour = OpenGL::None | |||
) | [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.
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. Flags must be OR'd together (ex: VideoModule::SoftwareSurface || VideoModule::Resizable), specify 0 if not wanting to activate any of these features. | |
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. |
VideoException | if the setting of the new mode failed. |
Definition at line 475 of file OSDLVideo.cc.
References _displayInitialized, _isGuiEnabled, _openGLcontext, _screen, _screenStartingMicrosecond, _screenStartingSecond, OSDL::Video::Surface::ClassicalScreenSurface, DoubleBuffered, OSDL::Utils::getBackendLastError(), OSDL::Video::Surface::getBitsPerPixel(), OSDL::Video::Surface::getFlags(), OSDL::Video::Surface::getHeight(), OSDL::Video::Surface::getPixelFormat(), OSDL::Video::Surface::getWidth(), hasOpenGLContext(), InterpretFlags(), LOG_WARNING_VIDEO, OSDL::Video::OpenGL::None, OpenGL, OSDL::Video::OpenGL::OpenGLFor2D, OSDL::Video::OpenGL::OpenGLFor3D, OSDL::Video::Surface::OpenGLScreenSurface, OSDL::Video::OpenGL::OpenGLContext::reload(), OSDL::Video::OpenGL::Reload, OSDL::Video::OpenGL::OpenGLContext::selectFlavour(), setOpenGLContext(), OSDL::Video::OpenGL::OpenGLContext::setViewPort(), OSDL::Video::OpenGL::OpenGLContext::toString(), toString(), OSDL::Video::Surface::toString(), and OSDL::Video::Pixels::toString().
Referenced by resize().
void VideoModule::setOpenGLContext | ( | OpenGL::OpenGLContext & | newOpenGLContext | ) | [virtual] |
Sets a new OpenGL context.
If a previous OpenGL context was used, it will be deleted first.
Definition at line 414 of file OSDLVideo.cc.
References _IsUsingOpenGL, and _openGLcontext.
Referenced by setMode().
void VideoModule::setRenderer | ( | Rendering::VideoRenderer & | newRenderer | ) | [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.
Definition at line 380 of file OSDLVideo.cc.
References _renderer.
void VideoModule::setScreenSurface | ( | Surface & | newScreenSurface | ) | [virtual] |
Assigns a new surface to the screen surface.
newScreenSurface | the new screen surface, which must already have a display type corresponding to a screen surface (i.e. not BackBuffer). |
VideoException | if the display type of the specified surface does not correspond to a screen surface. |
Definition at line 342 of file OSDLVideo.cc.
References _screen, OSDL::Video::Surface::BackBuffer, OSDL::Video::Surface::getDisplayType(), and OSDL::Video::Surface::toString().
void VideoModule::setWindowCaption | ( | const std::string & | newTitle, | |
const std::string & | iconName | |||
) | [virtual] |
Sets the window title and icon name.
newTitle | the new window title. | |
iconName | the new icon name. |
Definition at line 1071 of file OSDLVideo.cc.
void VideoModule::setWindowIcon | ( | const std::string & | filename | ) | [virtual] |
Sets the icon for the display window.
filename | the name of the file containing the icon. Its format (ex: PNG) should be auto-detected. |
Definition at line 1106 of file OSDLVideo.cc.
References OSDL::Video::Surface::getSDLSurface(), isDisplayInitialized(), OSDL::Video::TwoDimensional::Image::LoadIcon(), and LOG_DEBUG_VIDEO.
bool VideoModule::SoftwareToHardwareAlphaBlitsAccelerated | ( | ) | [static] |
Returns whether software to hardware alpha blits are accelerated.
VideoException | if the information could not be obtained. |
Definition at line 1721 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
bool VideoModule::SoftwareToHardwareBlitsAccelerated | ( | ) | [static] |
Returns whether software to hardware blits are accelerated.
VideoException | if the information could not be obtained. |
Definition at line 1671 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
bool VideoModule::SoftwareToHardwareColorkeyBlitsAccelerated | ( | ) | [static] |
Returns whether software to hardware colorkey blits are accelerated.
VideoException | if the information could not be obtained. |
Definition at line 1696 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
void VideoModule::toggleFullscreen | ( | ) | [virtual] |
Toggles the application between windowed and fullscreen mode, if supported.
Definition at line 806 of file OSDLVideo.cc.
References _screen, OSDL::Utils::getBackendLastError(), and OSDL::Video::Surface::getSDLSurface().
void VideoModule::ToScreenDimensions | ( | StandardScreenSize | screenSize, | |
Length & | screenWidth, | |||
Length & | screenHeight | |||
) | [static] |
Returns (in specified variables) the screen dimensions corresponding to the specified physical standard screen size.
screenSize | the screen size whose dimensions are to be determined (ex: Size_640x480). | |
screenWidth | the variable that will be set to the width corresponding to the specified size | |
screenHeight | the variable that will be set to the height corresponding to the specified size |
VideoException | if the operation failed, i.e. if the specified screen size is not known, or if it corresponds to a logical size (ex: Size_FullScreen) rather instead of a physical one (ex: Size_640x480). |
Definition at line 2122 of file OSDLVideo.cc.
References OSDL::Video::Size_1024x780, OSDL::Video::Size_1280x1024, OSDL::Video::Size_1680x1050, OSDL::Video::Size_640x480, OSDL::Video::Size_800x600, OSDL::Video::Size_FullScreen, and OSDL::Video::Pixels::toString().
StandardScreenSize VideoModule::ToStandardScreenSize | ( | const std::string & | standardScreenSizeInText | ) | [static] |
Returns the standard screen size corresponding to the specified text.
standardScreenSizeInText | the textual description of the standard screen size |
VideoException | if the operation failed, i.e. if the specified text could not be converted into a known screen size. |
Definition at line 2078 of file OSDLVideo.cc.
References OSDL::Video::Size_1024x780, OSDL::Video::Size_1280x1024, OSDL::Video::Size_1680x1050, OSDL::Video::Size_640x480, OSDL::Video::Size_800x600, OSDL::Video::Size_FullScreen, and OSDL::Video::Pixels::toString().
const string VideoModule::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Definition at line 1215 of file OSDLVideo.cc.
References _isGuiEnabled, _openGLcontext, _renderer, _screen, OSDL::Video::OpenGL::OpenGLContext::toString(), OSDL::Rendering::VideoRenderer::toString(), and OSDL::Video::Surface::toString().
Referenced by DescribeEnvironmentVariables(), InterpretFlags(), and setMode().
bool VideoModule::WindowManagerAvailable | ( | ) | [static] |
Returns whether there is a window manager available.
VideoException | if the information could not be obtained. |
Definition at line 1570 of file OSDLVideo.cc.
Referenced by DescribeVideoCapabilities().
friend class OSDL::CommonModule [friend] |
Definition at line 129 of file OSDLVideo.h.
bool OSDL::Video::VideoModule::_antiAliasing [private] |
Records the current antialiasing state.
Definition at line 1168 of file OSDLVideo.h.
Referenced by getAntiAliasingState(), and setAntiAliasingState().
bool VideoModule::_AntiAliasing = true [static, protected] |
Caches the current state relative to antialiasing.
Definition at line 1124 of file OSDLVideo.h.
Referenced by GetAntiAliasingState(), and setAntiAliasingState().
bool OSDL::Video::VideoModule::_displayInitialized [protected] |
Keeps tracks of setMode calls, be OpenGL used or not.
Definition at line 1073 of file OSDLVideo.h.
Referenced by isDisplayInitialized(), and setMode().
bool OSDL::Video::VideoModule::_drawEndPoint [private] |
Records the current state relative to final pixel drawing for lines.
Definition at line 1156 of file OSDLVideo.h.
Referenced by getEndPointDrawState(), and setEndPointDrawState().
bool VideoModule::_DrawEndPoint = false [static, protected] |
Caches the current state relative to final pixel drawing for lines.
Definition at line 1112 of file OSDLVideo.h.
Referenced by GetEndPointDrawState(), and setEndPointDrawState().
bool OSDL::Video::VideoModule::_isGuiEnabled [protected] |
Tells whether a graphical user interface is to be managed.
Definition at line 1081 of file OSDLVideo.h.
Referenced by isGUIEnabled(), setGUIEnableStatus(), setMode(), and toString().
bool VideoModule::_IsUsingOpenGL = false [static, protected] |
Caches the current state relative to the current use of OpenGL.
Definition at line 1099 of file OSDLVideo.h.
Referenced by IsUsingOpenGL(), and setOpenGLContext().
The current OpenGL context, if OpenGL is used.
Definition at line 1143 of file OSDLVideo.h.
Referenced by getOpenGLContext(), hasOpenGLContext(), resize(), setMode(), setOpenGLContext(), toString(), and ~VideoModule().
The video renderer being used, if any.
Definition at line 1086 of file OSDLVideo.h.
Referenced by getRenderer(), hasRenderer(), setRenderer(), toString(), and ~VideoModule().
Surface* OSDL::Video::VideoModule::_screen [protected] |
Internal surface corresponding to the screen.
Definition at line 1065 of file OSDLVideo.h.
Referenced by getAverageRefreshRate(), getScreenSurface(), hasScreenSurface(), redraw(), resize(), setMode(), setScreenSurface(), toggleFullscreen(), toString(), and ~VideoModule().
Ceylan::System::Microsecond OSDL::Video::VideoModule::_screenStartingMicrosecond [private] |
Stores the microsecond at which the screen surface (if any) was created, to compute its average refresh rate (frames per second).
Definition at line 1195 of file OSDLVideo.h.
Referenced by getAverageRefreshRate(), and setMode().
Ceylan::System::Second OSDL::Video::VideoModule::_screenStartingSecond [private] |
Stores the second at which the screen surface (if any) was created, to compute its average refresh rate (frames per second).
Definition at line 1186 of file OSDLVideo.h.
Referenced by getAverageRefreshRate(), and setMode().
const std::string VideoModule::_SDLEnvironmentVariables = {} [static, private] |
Array of all known environment variables related to video, for SDL back-end.
See http://sdldoc.csn.ul.ie/sdlenvvars.php.
Definition at line 1247 of file OSDLVideo.h.
Referenced by DescribeEnvironmentVariables().
const Ceylan::Flags VideoModule::AnyPixelFormat = 0x10000000 [static] |
Indicates that the screen surface may use any pixel format.
Definition at line 995 of file OSDLVideo.h.
Referenced by InterpretFlags().
const Ceylan::Flags VideoModule::AsynchronousBlit = 0x00000004 [static] |
Enables the use of asynchronous updates of the display surface.
Definition at line 990 of file OSDLVideo.h.
Referenced by InterpretFlags().
const Ceylan::Flags VideoModule::DoubleBuffered = 0x40000000 [static] |
Indicates that the screen surface is to be double buffered.
Works also if OpenGL is used.
Definition at line 1013 of file OSDLVideo.h.
Referenced by InterpretFlags(), and setMode().
const Ceylan::Uint16 VideoModule::DriverNameMaximumLength = 50 [static, protected] |
The maximum length for the name of the display driver.
Definition at line 1129 of file OSDLVideo.h.
Referenced by GetDriverName().
const Ceylan::Flags VideoModule::ExclusivePalette = 0x20000000 [static] |
Indicates that a surface should have an exclusive palette.
Definition at line 1000 of file OSDLVideo.h.
Referenced by InterpretFlags().
const Ceylan::Flags VideoModule::FullScreen = 0x80000000 [static] |
Indicates that the screen surface is to be full screen, not windowed.
Definition at line 1022 of file OSDLVideo.h.
Referenced by InterpretFlags().
const Ceylan::Flags VideoModule::HardwareSurface = 0x00000001 [static] |
Indicates that the screen surface is to be stored in video memory.
Definition at line 981 of file OSDLVideo.h.
Referenced by InterpretFlags().
const Ceylan::Flags VideoModule::NoFrame = 0x00000020 [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 1049 of file OSDLVideo.h.
Referenced by InterpretFlags().
const Ceylan::Flags VideoModule::OpenGL = 0x00000002 [static] |
Indicates that the screen surface should have an OpenGL context.
Definition at line 1031 of file OSDLVideo.h.
Referenced by InterpretFlags(), and setMode().
const Ceylan::Flags VideoModule::Resizable = 0x00000010 [static] |
Indicates that the screen surface is to be resizable.
Definition at line 1039 of file OSDLVideo.h.
Referenced by InterpretFlags().
const Ceylan::Flags VideoModule::SoftwareSurface = 0x00000000 [static] |
Indicates that the screen surface is to be stored in system memory.
Definition at line 972 of file OSDLVideo.h.
Referenced by OSDL::Video::OpenGL::GLTexture::setUpInternalSurfaceFrom().
const BitsPerPixel VideoModule::UseCurrentColorDepth = 0 [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 351 of file OSDLVideo.h.