DbSetDisplayMode

This command sets the display mode for the current program.

Syntax
void dbSetDisplayMode ( int iWidth, int iHeight, int iDepth )

Usage
This command changes the display mode of the application to the specified mode. Here is an example of the command which sets the display mode to 640x480 resolution in 32-bit color: dbSetDisplayMode ( 640, 480, 32 );

Though the application will not crash if the mode is unsupported, it is best to check for availability of the mode with the dbCheckDisplayMode function.

if ( dbCheckDisplayMode ( 800, 600, 32 ) ) dbSetDisplayMode ( 800, 600, 32 );

Also, it is notable that this can be called anywhere in a program multiple times. For example: dbSetDisplayMode ( 640, 480, 32 );

/*large amounts of code*/

dbSetDisplayMode ( 800, 600, 32 );

This is very useful for in-game display options.