FreeBASIC
0.91.0
|
#include <fb_gfx.h>
Data Fields | |
char * | name |
Name of the graphics driver. More... | |
int(* | init )(char *title, int w, int h, int depth, int refresh_rate, int flags) |
Driver initialization function pointer. More... | |
void(* | exit )(void) |
Driver exit function pointer. More... | |
void(* | lock )(void) |
Driver lock function pointer. More... | |
void(* | unlock )(void) |
Driver unlock function pointer. More... | |
void(* | set_palette )(int index, int r, int g, int b) |
Driver set palette function pointer. More... | |
void(* | wait_vsync )(void) |
Driver wait for vertical synchronization function pointer. More... | |
int(* | get_mouse )(int *x, int *y, int *z, int *buttons, int *clip) |
Driver get mouse state function pointer. More... | |
void(* | set_mouse )(int x, int y, int cursor, int clip) |
Driver set mouse state function pointer. More... | |
void(* | set_window_title )(char *title) |
Driver set window title function pointer. More... | |
int(* | set_window_pos )(int x, int y) |
Driver set/get window position function pointer. More... | |
int *(* | fetch_modes )(int depth, int *size) |
Driver fetch mode list function pointer. More... | |
void(* | flip )(void) |
Driver page flip function pointer. More... | |
void(* | poll_events )(void) |
Driver poll events function pointer. More... | |
void(* GFXDRIVER::exit)(void) |
Driver exit function pointer.
This function is called when a driver should clean up all allocated resources and restore the graphics device to its state before the driver was initialized.
In some cases this function will be called even when a driver failed to initialize. It is the driver's responsibility to track which resources it has or has not allocated so that such resources are not released twice if the exit function is called when the init function failed.
This function pointer must not be NULL.
int*(* GFXDRIVER::fetch_modes)(int depth, int *size) |
Driver fetch mode list function pointer.
This function returns a list of available modes for this driver. The list need not be sorted or ordered in any way.
Can be NULL if this driver cannot obtain a list of available modes.
[in] | depth | bits per pixel for which to retrieve modes |
[in] | size | count of ints returned |
void(* GFXDRIVER::flip)(void) |
int(* GFXDRIVER::get_mouse)(int *x, int *y, int *z, int *buttons, int *clip) |
Driver get mouse state function pointer.
The driver should fill the parameters with the current mouse state. The driver can assume that all of the pointers are valid (non-null).
Can be NULL if the driver cannot get the mouse state.
[out] | x | x position in pixels relative to the graphics drawing area |
[out] | y | y position in pixels relative to the graphics drawing area |
[out] | z | scroll wheel position; initially 0 |
[out] | buttons | bitfield with each bit representing the state of one button (1 if the button is pressed, 0 if not) |
[out] | clip | current mouse clipping status (1 if the mouse is currently clipped to the graphics drawing area; 0 if it is not) |
int(* GFXDRIVER::init)(char *title, int w, int h, int depth, int refresh_rate, int flags) |
Driver initialization function pointer.
This function is called from fb_GfxScreen or fb_GfxScreenRes; the driver should first check to see if there are any flags that it does not support (for example, DRIVER_OPENGL). If all flags specified are supported by this driver, the driver should attempt to set the requested mode.
This function pointer must not be NULL.
[in] | title | initial window title |
[in] | w | desired display mode width in pixels |
[in] | h | desired display mode height in pixels |
[in] | refresh_rate | desired refresh rate in Hz |
[in] | flags | DRIVER_ flags |
void(* GFXDRIVER::lock)(void) |
char* GFXDRIVER::name |
Name of the graphics driver.
This string is compared case-insensitively with the FBGFX environment variable and/or the ScreenControl SET_DRIVER_NAME string, if those have been set, to override the automatic driver selection.
This string must also be human-readable.
void(* GFXDRIVER::poll_events)(void) |
void(* GFXDRIVER::set_mouse)(int x, int y, int cursor, int clip) |
Driver set mouse state function pointer.
Can be NULL if the driver cannot set the mouse state.
[in] | x | x position in pixels relative to the graphics drawing area; if >= 0, the mouse cursor should be moved here; otherwise, this parameter should be ignored |
[in] | y | y position in pixels relative to the graphics drawing area; if >= 0, the mouse cursor should be moved here; otherwise, this parameter should be ignored |
[in] | cursor | cursor visibility state; if 0, the mouse cursor should be hidden; if > 0, the mouse cursor should be shown; otherwise, this parameter should be ignored |
[in] | clip | cursor clip state; if 0, the mouse cursor should be unclipped; if > 0, the mouse cursor should be clipped to the graphics drawing area; otherwise, this parameter should be ignored |
void(* GFXDRIVER::set_palette)(int index, int r, int g, int b) |
int(* GFXDRIVER::set_window_pos)(int x, int y) |
Driver set/get window position function pointer.
[in] | x | x position in pixels to move the window to, relative to the display device; if 0x80000000, ignore |
[in] | y | y position in pixels to move the window to, relative to the display device; if 0x80000000, ignore |
void(* GFXDRIVER::set_window_title)(char *title) |
void(* GFXDRIVER::unlock)(void) |
void(* GFXDRIVER::wait_vsync)(void) |
Driver wait for vertical synchronization function pointer.
This function should block until the next vertical retrace period. If it is not possible to use the actual hardware vertical retrace, this function should wait an amount of time equivalent to 1 / refresh_rate seconds.
Can be NULL if the driver cannot wait for vsync.