SetupScreen

static bool SetupScreen(
int width, int height,
bool fullscreen = true,
int colorDepth = 32, int zDepth = 8,
int refreshRate = [automatic] );

Sets up the program window or the fullscreen mode with the given color depth and Z depth. Returns true in success.

You can pass FULLSCREEN or WINDOWED as the fullscreen parameter instead of a boolean. Width and height tell the screen resolution (fullscreen mode) or the window size (windowed mode) in pixels. The color depth should be 16 or 32.

Generally this function should be called right after Setup::SetupProgram because you can't use any Bitmaps or TextRenderers before you've set up the screen!

zDepth is the accuracy of the built-in depth sorting and should be 8, 16 or 32, but you don't usually have to worry about it unless you know what you're doing. You can simply leave it to be the default value.

Examples

// Setup 32-bit fullscreen mode with the resolution of 1024 x 768 //
Setup::SetupScreen1024768true32 );

// Does the same as above but by using the FULLSCREEN constant //
Setup::SetupScreen1024768, FULLSCREEN, 32 );


// Setup 32-bit windowed mode with the window size of 800 x 600 //
Setup::SetupScreen800600false32 );

// Does the same as above but by using the WINDOWED constant //
Setup::SetupScreen800600, WINDOWED, 32 );


// You can also leave the color depth parameter out if you want 32-bit graphics //
Setup::SetupScreen800600, WINDOWED );

// Setup 32-bit fullscreen mode with the window size of 800 x 600 //
// and the maxium Z buffer accuracy //
Setup::SetupScreen800600, FULLSCREEN, 3232 );


Other functions of the class Setup
SetupProgram
Sets up OpenLayer and the other libraries
SetupScreen
Sets up the program window or the fullscreen mode
GetWindowWidth
Returns the width of the program window
GetWindowHeight
Returns the height of the program window
GetColorDepth
Returns the color depth of the program window
GetExecutablePath
Returns the path of the program executable
ToAbsolutePathname
Converts the relative pathname to an absolute one

Advanced functions

IsProgramSetUp
Returns true if SetupProgram is called
IsScreenSetUp
Returns true if SetupScreen is called


Questions about SetupScreen? Click here.