Set the display mode
#include <gf/gf.h> int gf_display_set_mode( gf_display_t display, int xres, int yres, int refresh, gf_format_t format, unsigned flags );
gf
This function sets the display mode. Depending on the driver, when you call this function, some or all surfaces pertaining to the device may be destroyed. Futhermore, there may be multiple applications in the system which might be affected by the modeswitch.
Threads should not call this function between calls to gf_draw_begin() and gf_draw_end(), or a deadlock will occur. |
It is up to you to ensure that all apps running on the display whose resolution has changed behave appropriately. A modeswitch could be dealt with in one of two ways:
The vsync and gears sample applications shipped with QNX Advanced Graphics demonstrate the second method. |
When a surface is destroyed, any layer which is displaying that surface is automatically disabled, and needs to be explicitly re-enabled by the application when the surface is re-created. This avoids temporarily displaying junk on the screen. |
If Photon is part of the system, we recommend you initiate the mode-switch via the Photon API, to ensure that the Photon display is refreshed properly.
QNX Graphics Framework
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
gf_display_query_mode(), gf_draw_begin()