Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/gf/dev_guide/api/gf_display_set_mode.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/gf/dev_guide/api/gf_display_set_mode.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/gf/dev_guide/api/gf_display_set_mode.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/gf/dev_guide/api/gf_display_set_mode.html on line 8

gf_display_set_mode()

Set the display mode

Synopsis:

#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 );

Arguments:

display
The handle for a display that you want to set the mode for.
xres, yres
The new screen resolution.
refresh
The new refresh rate.
format
The pixel format of the display; this pertains to the main layer only.
flags
No flags are currently defined; pass as 0.

Library:

gf

Description:

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.


WARNING: 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:

  1. Notification via IPC. Using an application-specific inter-process communication mechanism, the application that initiated the mode-switch notifies all other client applications in the system which may be rendering to this device, that a mode-switch has occured. Upon receiving notification, the applications destroy all their surfaces and re-created them, resizing them as required by the new display resolution.
  2. Applications can detect if a surface has been destroyed when they attempt to render to it. For 2D rendering, gf_draw_begin() returns GF_ERR_SURFDESTROYED if the surface has been destroyed. For 3D rendering, eglSwapBuffers() returns EGL_FALSE, and generates the error EGL_BAD_SURFACE is generated.

    Note: The vsync and gears sample applications shipped with QNX Advanced Graphics demonstrate the second method.


Note: 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.

Returns:

GF_ERR_OK
Success.
GF_ERR_NOSUPPORT
The specified display mode isn't supported.

Classification:

QNX Graphics Framework

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

gf_display_query_mode(), gf_draw_begin()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/gf/dev_guide/api/gf_display_set_mode.html on line 185

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/gf/dev_guide/api/gf_display_set_mode.html on line 185