Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

nglVideoMode Class Reference

#include <nglVideoMode.h>

List of all members.


Detailed Description

Video mode management.

This class let you find suitable resolutions for fullscreen rendering windows (see nglWindowInfo for more details).


Public Member Functions

Life cycle
 nglVideoMode ()
 nglVideoMode (const nglVideoMode &rMode)
 ~nglVideoMode ()
Properties
uint GetWidth () const
uint GetHeight () const
uint GetDepth () const
uint GetFrequency () const
nglString Dump () const

Static Public Member Functions

Requesters
static bool Enum (nglVideoMode &rMode, uint Index)
static bool Find (nglVideoMode &rMode, uint Width, uint Height, uint Depth=0, uint Frequency=0)

Friends

class nglApplication
class nglWindow


Constructor & Destructor Documentation

nglVideoMode::nglVideoMode  ) 
 

Get the current video mode. If you want to request other video modes, you must use the static 'requesters' methods Enum() or Find().

The current video mode is useful to obtain the current desktop dimensions, and/or to switch to fullscreen mode without changing the desktop resolution.

nglVideoMode::nglVideoMode const nglVideoMode rMode  ) 
 

Copy constructor.

nglVideoMode::~nglVideoMode  ) 
 


Member Function Documentation

nglString nglVideoMode::Dump  )  const
 

Dumps a textual description.

static bool nglVideoMode::Enum nglVideoMode rMode,
uint  Index
[static]
 

Enumerate available video modes.

Parameters:
rMode video mode information is written here
Index mode index
Returns:
if true, rMode contains valid information
Video modes are numbered consecutively, starting from 0. To list available video mode, you shoul call Get() with a zero-based growing index until the method returns false. Example :

nglVideoMode mode;
int i = 0;

while (nglVideoMode::Get(i, mode))
{
  i++;
  NGL_OUT("Mode #%d: %dx%dx%d - vertical refreh: %d Hz", i,
    mode.GetWidth(), pmode.GetHeight(), pmode.GetDepth(), pmode.GetVFrequency());
}

static bool nglVideoMode::Find nglVideoMode rMode,
uint  Width,
uint  Height,
uint  Depth = 0,
uint  Frequency = 0
[static]
 

Find a video mode.

Parameters:
rMode Video mode information is written here
Width Desired width, must be non zero
Height Desired height, must be non zero
Depth Desired bitdepth. If set to zero, use current desktop bitdepth
Frequency Desired vertical refresh frequency. If set to zero, try to match at least current desktop frequency
Returns:
if true, rMode contains valid information

uint nglVideoMode::GetDepth  )  const
 

Color bits per pixel.

uint nglVideoMode::GetFrequency  )  const
 

Vertical monitor refresh rate in Hz.

uint nglVideoMode::GetHeight  )  const
 

Vertical resolution in pixels.

uint nglVideoMode::GetWidth  )  const
 

Horizontal resolution in pixels.


Friends And Related Function Documentation

friend class nglApplication [friend]
 

friend class nglWindow [friend]
 


Generated on Thu Feb 3 22:26:10 2005 for NGL by  doxygen 1.4.1