Back to index

libsfml  1.6+dfsg2
Static Public Member Functions
sf::priv::VideoModeSupport Class Reference

Cocoa implementation of VideoModeSupport Give access to video mode related OS-specific functions /////////////////////////////////////////////////////////. More...

#include <VideoModeSupport.hpp>

List of all members.

Static Public Member Functions

static void GetSupportedVideoModes (std::vector< VideoMode > &Modes)
 Get supported video modes.
static VideoMode GetDesktopVideoMode ()
 Get current desktop video mode.
static void GetSupportedVideoModes (std::vector< VideoMode > &Modes)
 Get supported video modes.
static VideoMode GetDesktopVideoMode ()
 Get current desktop video mode.
static void GetSupportedVideoModes (std::vector< VideoMode > &Modes)
 Get supported video modes.
static VideoMode GetDesktopVideoMode ()
 Get current desktop video mode.
static void GetSupportedVideoModes (std::vector< VideoMode > &Modes)
 Get supported video modes.
static VideoMode GetDesktopVideoMode ()
 Get current desktop video mode.

Detailed Description

Cocoa implementation of VideoModeSupport Give access to video mode related OS-specific functions /////////////////////////////////////////////////////////.

Win32 implementation of VideoModeSupport Give access to video mode related OS-specific functions /////////////////////////////////////////////////////////.

XXX implementation of VideoModeSupport Give access to video mode related OS-specific functions /////////////////////////////////////////////////////////.

Linux implementation of VideoModeSupport Give access to video mode related OS-specific functions /////////////////////////////////////////////////////////.

Definition at line 43 of file VideoModeSupport.hpp.


Member Function Documentation

Get current desktop video mode.

Get current desktop video mode /////////////////////////////////////////////////////////.

Returns:
Current desktop video mode

/////////////////////////////////////////////////////////

Definition at line 71 of file VideoModeSupport.cpp.

{
       // Ceylo -- using same implementation as in OSXCarbon
       
       CFDictionaryRef CurrentVideoMode = CGDisplayCurrentMode(kCGDirectMainDisplay);
       
       VideoMode DesktopMode;
       
       
       // Get video mode width
    CFNumberGetValue((CFNumberRef)CFDictionaryGetValue(CurrentVideoMode, kCGDisplayWidth),
                                    kCFNumberIntType,
                                    &(DesktopMode.Width));
       
       // Get video mode height
    CFNumberGetValue((CFNumberRef)CFDictionaryGetValue(CurrentVideoMode, kCGDisplayHeight),
                                    kCFNumberIntType,
                                    &(DesktopMode.Height));
       
       // Get video mode depth
    CFNumberGetValue((CFNumberRef)CFDictionaryGetValue(CurrentVideoMode, kCGDisplayBitsPerPixel),
                                    kCFNumberIntType,
                                    &(DesktopMode.BitsPerPixel));
       
       
       return DesktopMode;
}
static VideoMode sf::priv::VideoModeSupport::GetDesktopVideoMode ( ) [static]

Get current desktop video mode.

Returns:
Current desktop video mode

/////////////////////////////////////////////////////////

static VideoMode sf::priv::VideoModeSupport::GetDesktopVideoMode ( ) [static]

Get current desktop video mode.

Returns:
Current desktop video mode

/////////////////////////////////////////////////////////

static VideoMode sf::priv::VideoModeSupport::GetDesktopVideoMode ( ) [static]

Get current desktop video mode.

Returns:
Current desktop video mode

/////////////////////////////////////////////////////////

static void sf::priv::VideoModeSupport::GetSupportedVideoModes ( std::vector< VideoMode > &  Modes) [static]

Get supported video modes.

Parameters:
Modes: Array to fill with available video modes

/////////////////////////////////////////////////////////

void sf::priv::VideoModeSupport::GetSupportedVideoModes ( std::vector< VideoMode > &  Modes) [static]

Get supported video modes.

Get supported video modes /////////////////////////////////////////////////////////.

Parameters:
Modes: Array to fill with available video modes

/////////////////////////////////////////////////////////

Definition at line 39 of file VideoModeSupport.cpp.

{
       // Ceylo -- using same implementation as in OSXCarbon
       
    // First, clear array to fill
    Modes.clear();
       
    // Enumerate all available video modes for primary display adapter
    CFArrayRef DisplayModes = CGDisplayAvailableModes( kCGDirectMainDisplay );
    CFIndex DisplayModeCount = CFArrayGetCount( DisplayModes );
    CFDictionaryRef CurrentMode;
       
    for (int Count = 0; Count < DisplayModeCount; ++Count)
    {
        CurrentMode = (CFDictionaryRef)CFArrayGetValueAtIndex( DisplayModes, Count );
              
              VideoMode Mode;
              
        CFNumberGetValue((CFNumberRef)CFDictionaryGetValue(CurrentMode, kCGDisplayWidth), kCFNumberIntType, &(Mode.Width));
        CFNumberGetValue((CFNumberRef)CFDictionaryGetValue(CurrentMode, kCGDisplayHeight), kCFNumberIntType, &(Mode.Height));
        CFNumberGetValue((CFNumberRef)CFDictionaryGetValue(CurrentMode, kCGDisplayBitsPerPixel), kCFNumberIntType, &(Mode.BitsPerPixel));
              
        // Add it only if it is not already in the array
        if (std::find(Modes.begin(), Modes.end(), Mode) == Modes.end())
            Modes.push_back(Mode);
    }
}
static void sf::priv::VideoModeSupport::GetSupportedVideoModes ( std::vector< VideoMode > &  Modes) [static]

Get supported video modes.

Parameters:
Modes: Array to fill with available video modes

/////////////////////////////////////////////////////////

static void sf::priv::VideoModeSupport::GetSupportedVideoModes ( std::vector< VideoMode > &  Modes) [static]

Get supported video modes.

Parameters:
Modes: Array to fill with available video modes

/////////////////////////////////////////////////////////


The documentation for this class was generated from the following files: