tbx  0.7.3
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
tbx::ModeInfo Class Reference

Class to return information on a screen mode. More...

#include <modeinfo.h>

Public Member Functions

 ModeInfo ()
 Constructor to retrieve information about the current screen mode.
 
 ModeInfo (int mode)
 Constructor to retrieve information about the given screen mode. More...
 
void mode (int mode=-1)
 Set the mode to return information about. More...
 
int mode () const
 Get the mode number information will be returned about.
 
int colours () const
 Return the number of colours for the mode. More...
 
Point eig () const
 Return the eigen factors for the mode. More...
 
Size screen_unit () const
 Get the size of one pixel in OS units. More...
 
Size pixel_size () const
 Get the screen size in pixels. More...
 
Size screen_size () const
 Get the screen size in OS units. More...
 

Static Public Member Functions

static int screen_mode ()
 Get to current sreen mode. More...
 

Protected Attributes

int _mode
 Screen mode number interrogated for details.
 

Detailed Description

Class to return information on a screen mode.

The mode number referred to in this class is either the standard screen mode number or for RISC OS 3.5 and above can be a mode specifier or a sprite mode word.

Constructor & Destructor Documentation

tbx::ModeInfo::ModeInfo ( int  mode)
inline

Constructor to retrieve information about the given screen mode.

Parameters
modescreen mode number

Member Function Documentation

int tbx::ModeInfo::colours ( ) const
inline

Return the number of colours for the mode.

Returns
number of colours (or 0 for 16M colour modes)
Point tbx::ModeInfo::eig ( ) const
inline

Return the eigen factors for the mode.

The eigen factors are the binary shift to convert from screen pixels to OS units.

e.g. and eigen factor of 2 will give 1 pixels = 1<<2 or 4 os units

Returns
eigin factors in a point
void tbx::ModeInfo::mode ( int  mode = -1)
inline

Set the mode to return information about.

Parameters
modescreen mode number
Size tbx::ModeInfo::pixel_size ( ) const
inline

Get the screen size in pixels.

Returns
screen size in pixels
int tbx::ModeInfo::screen_mode ( )
inlinestatic

Get to current sreen mode.

This is the actual mode value and not -1 (which is used in some APIs to mean the current mode).

This value is only avaliable on RISC OS 3.5 or later

Returns
the current screen mode
Size tbx::ModeInfo::screen_size ( ) const
inline

Get the screen size in OS units.

Returns
screen size in OS units
Size tbx::ModeInfo::screen_unit ( ) const
inline

Get the size of one pixel in OS units.

Returns
Size containing the size of one pixel in OS units

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