SetDisplayStart

Sets the currently visible display start address.

Declaration

void NAPI GA_driverFuncs::SetDisplayStart(
N_int32 offset,
N_int32 waitVRT)

Prototype In

snap/graphics.h

Parameters

offset | Offset to start of display memory to make visible
waitVRT | Wait for retrace flag (true or false)

Description

This function sets the currently visible hardware display start address as a byte offset from the start of physical display memory. Hence to display data beginnig at the start of video memory you would set the offset parameter to 0. To display the second page for double buffered animation you would set the offset parameter to 'YResolution * BytesPerScanLine' for the current video mode. The waitVRT flag determines if the function will wait for the vertical retrace when programming the hardware display start address and the following are valid values:

value | Description
0 | Schedule change for next retrace and return immediately not 0 - Wait for vertical retrace during programming

Generally you need to wait for a vertical retrace to enable flicker free animation when doing double buffered animation. However if you have set up three visible display buffers for hardware triple buffering (check that the gaHaveTripleBuffer flag is set in the GA_modeInfo structure) and you pass a value of 0 for waitVRT. In this case the function will schedule the display start address and return immediately, and you can then call the GetDisplayStartStatus function at a later date to determine if the previous display start address has taken hold yet or not. In order for this to work properly, before you need to access the next buffer for rendering, you should also loop until GetDisplayStartStatus indicates that the last flip has taken place (by default this will always be the case when a mode is first initialized).

Note: The value passed into this function is always in units of bytes for 8bpp and above display modes (and text modes). For 4bpp display modes the value is defined in units of pixels so that pixel perfect scrolling can be achieved.

Note: If you have enabled the buffer manager, please use the buffer manager function FlipToBuffer to change the display start address instead.

See Also

SetDisplayStartXY, SetStereoDisplayStart, GetDisplayStartStatus, SetActiveBuffer, FlipToBuffer

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com