Supported Browsers Home   
MGL_setViewportOrgDC Previous   
MGL_setWriteMode Next   
External Functions Up   

MGL_setVisualPage

Sets the currently visible hardware video page for a display device context.

Declaration

void MGLAPI MGL_setVisualPage(
    MGLDC *dc,
    int page,
    int waitVRT)

Prototype In

mgraph.h

Parameters

dc

Display device context

page

New hardware display page

waitVRT

Wait for retrace flag (MGL_waitVRTFlagType)

 

Description

This function sets the currently visible hardware video page for a display device context. The first hardware video page is number 0, the second is 1 and so on. The number of available hardware video pages depends on the type of underlying hardware, the video mode resolution and amount of video memory installed. Thus not all video modes support multiple hardware video pages.

When the visible display page is changed, you should normally allow MGL to sync to the vertical retrace by passing a value of MGL_waitVRT in the waitVRT parameter to ensure that the change occurs in the correct place, and that you don't get flicker effects on the display. If you have more than two display pages for your display device context, you can also pass in a value of MGL_tripleBuffer, and if the hardware supports triple buffering the MGL will implement proper support for triple buffering. If the hardware does not support triple buffering, MGL_tripleBuffer behaves the same as MGL_waitVRT. Triple buffering is a mechanism that allows the MGL to return immediately without waiting for the vertical sync period after changing the visual display page, but ensure thats if the application runs at a frame rate higher than the refresh rate of the graphics adapter (ie: 60fps if the refresh is 60Hz), the frame rate will lock to the vertical refresh frequency and you will not get any flicker.

You may however want to turn off the vertical retrace synching if you are synching up with the retrace period using some other means by passing a value of MGL_dontWait to the waitVRT parameter. This is also useful if you are measuring the performance of your application and you want it to run at full speed without without the overhead of waiting for the vertical retrace.

Note that if you wish to implement both double buffering and hardware scrolling or panning, you should call the MGL_setDisplayStart function first with waitVRT set to -1, and then call this function with waitVRT set to MGL_waitVRT or MGL_tripleBuffer to actually update the hardware. The first call to MGL_setDisplayStart simply updates the internal display start variables but does not program the hardware. For more information please see the MGL_setDisplayStart function.

See Also

MGL_getVisualPage, MGL_getActivePage, MGL_setActivePage, MGL_swapBuffers, MGL_setDisplayStart

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