CreateBasicDisplay

Does everything needed to create a simple display.

Synopsis

Item CreateBasicDisplay (ScreenContext *sc, uint32 displayType, uint32 numScreens)

Description

Prepares a screen display on the 3DO system: Opens the graphics folio, creates a screen group, and adds the screen group. When you are ready, call DisplayScreen() to view the screen display on the monitor.

Using this function, you can create a display suitable for NTSC or PAL. This is controlled using the displayType argument. The different display types are defined in graphics.h and currently include:

DI_TYPE_DEFAULT-Specifying this value results in a display which matches the current defaults for the system. If the system is PAL, it opens a PAL display, and if the machine is NTSC, it opens an NTSC display. Note that additional display types that can be the default are likely to be added in the future. If your code can only deal with either NTSC or PAL, specify the modes explicitly.

DI_TYPE_NTSC-Opens a 320-x-240 display running at 60Hz.

DI_TYPE_PAL1-Opens a 320-x-240 display running at 50Hz.

DI_TYPE_PAL2-Opens a 384-x-288 display running at 50Hz.

If your application includes both NTSC and PAL artwork, you can use the following approach to determine which set of artwork to use:

QueryGraphics(QUERYGRAF_TAG_DEFAULTDISPLAYTYPE,&displayType); 
if ((displayType == DI_TYPE_PAL1) || (displayType == DI_TYPE_PAL2)) {
     displayType = DI_TYPE_PAL2; } 
else { displayType = DI_TYPE_NTSC; } 

You can then supply the displayType parameter to CreateBasicDisplay(). The above code protects you against any new display types that can be added to the system. Essentially, if the system says the default is PAL, you will use the PAL artwork. Any other condition results in an NTSC display.

Arguments

sc
This structure is used for output only. It contains various fields that describe the display. This includes the sc_DisplayType field which indicates the actual display type of the display. If this pointer is NULL, the function returns an error code.
displayType
Type of display to open. See the explanation under Description.
numScreens
Number of screen buffers to allocate; typically 1 or 2. Allocate two screen buffers to do double-buffering.

Return Value

Item number of the screen group that was created, or a negative error code upon failure.

Associated Files

lib3do.lib, displayutils.h

See Also

DeleteBasicDisplay