OpenScreen()

Syntax

Result = OpenScreen(Width, Height, Depth, Title$ [, FlipMode [, RefreshRate]])
Description
Opens a new screen according to the specified 'Width', 'Height' and 'Depth'. The opened screen is created with 2 video buffers to allows you to do double buffering, especially useful for games. The buffers can be manipulated with the FlipBuffers() function. If the screen fails to open the result is zero.

Width and Height should be standard combinations: 640*480, 800*600, 1024*768...

Depth can take the following values:
  4 :    16 colors, independent palette available
  8 :   256 colors, independent palette available
  16: 65000 colors, fixed palette
  24: 16 Mo colors, fixed palette
  32: 16 Mo colors, faster than 24-bit mode
The optional 'FlipMode' parameter allows to wait or not for the screen synchronization before flipping the buffers with FlipBuffers() (also known as 'Vertical blank synchronization'). It can have one of the following values:
   #PB_Screen_NoSynchronization   : disable synchronization 
   #PB_Screen_WaitSynchronization : enable synchronization (default value)
   #PB_Screen_SmartSynchronization: enable synchronization, with a CPU saver routine when the program doesn't consume
                                    all the CPU time (full screen mode only)
Waiting for the screen synchronization allows the flip to be perfect (no 'tearing' or other visible artifacts) because the flip is performed when the screen has been fully drawn (and when the screen spot is outside of visible screen area). This also link the flip frequence to the actual screen refresh, ie: for 60Hz screen it could have at most 60 flip per seconds, etc.

An optional 'RefreshRate' (in Hz) can be set for the new screen. If it can't be handled, then OpenScreen() will fail.
Note: on Windows, the refresh rate could be locked or forced by the video card drivers, so it could be inaccurate.

Note: on Windows, the 'Title$' parameter will be displayed in the taskbar, so it's recommended to use a title related to the application name. Also, the Requester functions cannot be used on screens created with OpenScreen.

To open a screen area on a regular window, see OpenWindowedScreen().

Supported OS

Windows, Linux (OpenGl), MacOS X

<- NextScreenMode() - Sprite Index - OpenWindowedScreen() ->