Top |
gboolean | grx_set_driver () |
gboolean | grx_set_mode () |
gboolean | grx_set_mode_default_graphics () |
guint | grx_get_dpi () |
GrxDeviceManager * | grx_get_device_manager () |
const GrxVideoDriver * | grx_get_current_video_driver () |
const GrxVideoMode * | grx_get_current_video_mode () |
const GrxVideoMode * | grx_get_virtual_video_mode () |
const GrxFrameDriver * | grx_get_current_frame_driver () |
const GrxFrameDriver * | grx_get_screen_frame_driver () |
const GrxVideoMode * | grx_get_first_video_mode () |
const GrxVideoMode * | grx_get_next_video_mode () |
GRX3 uses video "driver" plugins to provide the graphics back end. For most
programs using GRX3, the driver and it's parameters will be automatically
selected. The driver and parameters can be manually specified using the
GRX_DRIVER environment variable (see
for details). The
search path for the video driver plugins can also be manually specified using
the GRX_PLUGIN_PATH enviornment variable (useful for development).grx_set_driver()
Each video driver can have mutiple video modes. Video modes specify the
resolution (width and height in pixels) and the color depth (bits per pixel).
Most programs will just call grx_set_mode_default_graphics()
to automatically
select the default mode of the video driver.
Each video driver also has an associated device manager for interacting with input devices such as keyboards, mice and touchscreens.
gboolean grx_set_driver (const gchar *driver_spec
,GError **error
);
The driver spec is of the format "[<name>[::<flag>]] [gw <width>] [gh <height>] [gc <colors>] [dp <dpi>]".
"<name>" is the name of a video driver plugin.
"<flag>" is "fs" for fullscreen or "ww" for windowed (not supported by all drivers)
"<width>" is the default width
"<height>" is the default height
"<colors>" is the default color depth. "K" and "M" suffixes are recognized.
"<dpi>" the display resolution in dots per inch.
If driver_spec
is NULL
, then it will first check the GRX_DRIVER environment
variable for a driver spec. If the environment variable is not present, then
it will uses the driver with the highest number of modes.
gboolean grx_set_mode (GrxGraphicsMode mode
,GError **error
,...
);
Set the graphics mode.
If a driver has not already been set, this will attempt to load the best available driver (the one with the most modes). The driver will then try to find the mode that best fits the size and color depth parameters. The exact behavior will depend on the video driver.
[skip]
gboolean grx_set_mode_default_graphics (gboolean clear
,GError **error
);
Set the mode to the default graphics mode.
This is 640x480x16 by default but can be changed by grx_set_driver()
.
guint
grx_get_dpi (void
);
Gets the display resolution of the current graphics mode or GRX_DEFAULT_DPI if the current driver does not support getting the resolution.
The display resolution can also be manually specified using grx_set_driver()
or the GRX_DRIVER environment variable.
GrxDeviceManager *
grx_get_device_manager (void
);
Gets the device manager for the current video driver
the GrxDeviceManager or NULL
if a video driver has not be loaded yet.
[transfer none][nullable]
available video modes (for grx_set_mode()
)
Unknown mode / initial state |
||
Default text mode |
||
Standard 80x25 text mode |
||
Text mode with parameters int w, int h |
||
Text mode with parameters int w, int h, GrxColor nc |
||
Text mode with parameters int w, int h, int bpp |
||
Default graphics mode |
||
Graphics mode with parameters int w, int h |
||
Graphics mode with parameters int w, int h, GrxColor nc |
||
Graphics mode with parameters int w, int h, int bpp |
||
Graphics mode with parameters int w, int h, GrxColor nc, int vx, int vy |
||
Graphics mode with parameters int w, int h, int bpp, int vx, int vy |
||
Same as GRX_GRAPHICS_MODE_TEXT_DEFAULT but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_TEXT_80X25 but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_TEXT_WIDTH_HEIGHT but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_TEXT_WIDTH_HEIGHT_COLOR but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_TEXT_WIDTH_HEIGHT_BPP but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_GRAPHICS_DEFAULT but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_GRAPHICS_WIDTH_HEIGHT but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_GRAPHICS_WIDTH_HEIGHT_COLOR but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_GRAPHICS_WIDTH_HEIGHT_BPP but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_GRAPHICS_CUSTOM but does not clear video memory |
||
Same as GRX_GRAPHICS_MODE_GRAPHICS_CUSTOM_BPP but does not clear video memory |
typedef struct { } GrxVideoModeExt;
Video driver mode descriptor extension structure. This is a separate structure accessed via a pointer from the main mode descriptor. The reason for this is that frequently several modes can share the same extended info.