View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gui/index.html.
sys_context: global system context
button: the button to update
timestamp: the current ticks (milliseconds)
Registers a "down" (press) event on a button.
Return value: none.
sys_context: global system context
button: the button to update
Registers a "up" (release) event on a button.
Return value: none.
sys_context: global system context
button: the button to query
Tells wether a button is pressed or not.
Return value: 1 if pressed, 0 if not.
sys_context: global system context
button: the button to query
Tells how many times the button has been pressed. Typical usage: the
button is pressed, released, pressed, released several times. Then,
after all this, you want to know how many times it has been pressed.
Querying its state with lw6gui_button_is_pressed
won’t tell you much
but this pop_press
function will return 1 for each press there’s been.
Return value: 1 if there’s a press event in the queue, 0 if empty.
sys_context: global system context
button: the button to query
Tells how many times the button has been simpleclicked. This is different from a simple press, in fact, there’s a delay, we must wait until the double-click delay is elapsed to make sure this is a simple click... Designed for use with mouse to differentiate fire and alternate fire.
Return value: 1 if there’s a simpleclick event in the queue, 0 if empty.
sys_context: global system context
button: the button to query
Tells how many times the button has been doubleclicked. Typical usage: the button is doubleclicked, released, doubleclicked, released several times. Then, after all this, you want to know how many times it has been doubleclicked.
Return value: 1 if there’s a doubleclick event in the queue, 0 if empty.
sys_context: global system context
button: the button to query
Tells how many times the button has been tripleclicked. Typical usage: the button is tripleclicked, released, tripleclicked, released several times. Then, after all this, you want to know how many times it has been tripleclicked.
Return value: 1 if there’s a tripleclick event in the queue, 0 if empty.
sys_context: global system context
button: the button to update
repeat_settings: the repeat settings
timestamp: the current ticks (milliseconds)
Updates the repeat informations for a button, must be called regularly, as often as possible.
Return value: none.
sys_context: global system context
dst: the target button object
src: the source button object
Synchronizes two button objects. This is typically used to pass data from one thread to another. This is not a simple copy, it will handle data such as "when was it pressed last" it an intelligent manner, popping src data to put it in dst, and clearing src.
Return value: 1 if success, O if failure.
sys_context: global system context
dst_x: the x coord to return
dst_y: the y coord to return
dst_x0: the x coord of point 0 in destination coord system
dst_y0: the y coord of point 0 in destination coord system
dst_w: the width of the area in destination coord system
dst_h: the width of the area in destination coord system
src_x: the x coord in source coord system
src_y: the y coord in source coord system
src_x0: the x coord of point 0 in source coord system
src_y0: the y coord of point 0 in source coord system
src_w: the width of the area in source coord system
src_h: the width of the area in source coord system
Registers a "down" (press) event on a button.
Return value: 1 if OK, 0 if error (unable to calculate).
sys_context: global system context
x: x coord (in/out param)
y: y coord (in/out param)
x_flip: flip on x (out param, -1 or +1)
y_flip: flip on y (out param, -1 or +1)
w: width
h: height
x_polarity: x polarity (-1, 0 or 1)
y_polarity: y polarity (-1, 0 or 1)
Same as lw6map_fix_coords
except it operates on floats.
Usefull for cursor and other rendering operations. Additionnally,
will keep track of inversions, that is to say if map is flip
in one or another way. Be carefull, the flip values are -1 or 1
so that it’s easy to multiply an offset by it, for instance, but
this means testing if flip is not 0 will always return true, you must
test if flip is stritly positive or negative.
Return value: none
sys_context: global system context
input: the input struct to initialise
Initialises an input structure, don’t use twice, it won’t free a previous init.
Return value: a pointer to the newly allocated object.
sys_context: global system context
input: the input struct to uninitialise
Unitialises an input structure, need to call it to free event queue.
Return value: a pointer to the newly allocated object.
sys_context: global system context
Creates an input structure, which can be used to handle input state & buffer.
Return value: a pointer to the newly allocated object.
sys_context: global system context
input: the input object to free.
Deletes an input structure.
Return value: none.
sys_context: global system context
input: the input struct to reset
Resets an input structure. Must have been initialized before. It will empty all queues and mark everything as unpressed.
Return value: 1 on success, 0 if failure.
sys_context: global system context
input: the input to update
repeat_settings: the repeat settings (delay + interval)
timestamp: the current ticks (milliseconds)
Updates the repeat informations for an input, must be called regularly, as often as possible.
Return value: none.
sys_context: global system context
input: the input to update
Tells an input object that one of its descendants has been
modified. This will affect the return value of lw6gui_input_need_sync
Return value: none.
sys_context: global system context
input: the input to test
Tests wether an input object contains was modified and needs synchronisation.
Return value: 1 if sync is need, 0 if not.
sys_context: global system context
dst: the target input object
src: the source input object
Synchronizes two input objects. This is typically used to pass data from one thread to another. This is not a copy, it will brute-force copy the static data such as mouse position, but anything like a queue will be treated in a "empty source and fill target with data" scheme. So source will be affected by this, the key buffer will be emptied, and so on. And if there are key in the target buffer, they won’t be overwritten but kept in front of the FIFO list.
Return value: 1 if success, O if failure.
sys_context: global system context
input: input object to modify
Enables auto_release mode, in this mode, it’s assummed after some time any key is automatically released.
Return value: none.
sys_context: global system context
i: index to check
Checks wether the index is correct. Does not mean the joystick exists, it’s just to avoid out of bounds errors.
Return value: 1 if within range, 0 if not.
sys_context: global system context
joystick: joystick to update
x: x-axis position, as returned by the driver
limit: the limit, under this, buttons are considered unpressed.
timestamp: current ticks (timestamp in ms)
Updates the x axis of a joystick, this will convert an information of analog type such as "joystick is here" to a pad-like information such as "pressed in that direction".
Return value: 1 if within range, 0 if not.
sys_context: global system context
joystick: joystick to update
limit: the limit, under this, buttons are considered unpressed.
timestamp: current ticks (timestamp in ms)
Updates the y axis of a joystick, this will convert an information of analog type such as "joystick is here" to a pad-like information such as "pressed in that direction".
Return value: 1 if within range, 0 if not.
sys_context: global system context
joystick: the joystick to update
repeat_settings: the repeat settings (delay + interval)
timestamp: the current ticks (milliseconds)
Updates the repeat informations for a joystick, must be called regularly, as often as possible.
Return value: none.
sys_context: global system context
dst: the target joystick object
src: the source joystick object
Synchronizes two joystick objects. This is typically used to pass data from one thread to another.
Return value: 1 if success, O if failure.
sys_context: global system context
joystick: the joystick to query
move_pad: the structure which will contain the results
Returns the state of the joystick in a uniform, non-device specific structure containing only the up/down/left/right information.
Return value: none, the value are stored in move_pad
.
sys_context: global system context
keysym: the keysym to check
Tells wether the keysym is valid or not.
Return value: 1 if valid, 0 if not
sys_context: global system context
keyboard: the keyboard structure which stores keyboard state
Pops (in FIFO mode) a keypress stored in the keyboard buffer. You must free the obtained keypress object after you’re done with it.
Return value: a newly allocated pointer, or NULL if no keypress pending.
sys_context: global system context
keyboard: the keyboard structure which stores keyboard state
Tells wether a key is pressed or not. The function will test out of bound values.
Return value: 1 if pressed, 0 if not.
sys_context: global system context
keyboard: the keyboard structure which will store the keypress
keysym: the keysym for the keypress
unicode: the ASCII/unicode code for the keypress
label: the label for the keypress
timestamp: the current ticks (timestamp in ms)
Registers a keypress event, that is, puts it in the event queue. This
function does not take an lw6gui_keypress_t
structure but separated
args, this is because it will construct the object internally. You
may free label
after calling this, an internal copy will be done.
This function will also maintain the array of key states up to date.
Return value: 1 if success, O if failure.
sys_context: global system context
keyboard: the keyboard structure which will store the keypress
keysym: the keysym for the keypress
Registers a key release event.
Return value: 1 if success, O if failure.
sys_context: global system context
keyboard: the keyboard to update
repeat_settings: the repeat settings (delay + interval)
timestamp: the current ticks (milliseconds)
Updates the repeat informations for a keyboard, must be called regularly, as often as possible.
Return value: none.
sys_context: global system context
dst: the target keyboard object
src: the source keyboard object
Synchronizes two keyboard objects. This is typically used to pass data from one thread to another. Will pop the src queue to fill the dst queue.
Return value: 1 if success, O if failure.
sys_context: global system context
keyboard: the keyboard to query
move_pad: the structure which will contain the results
Returns the state of the keyboard in a uniform, non-device specific structure containing only the up/down/left/right information.
Return value: none, the value are stored in move_pad
.
sys_context: global system context
keysym: the keysym to use
unicode: the unicode value for this keysym
label: the label (optional, might be NULL)
Creates a keypress structure, the only reason for needing a contructor is that the label field needs be duplicated.
Return value: a pointer to the newly allocated object.
sys_context: global system context
keypress: the keypress object to free.
Deletes a keypress structure.
Return value: none.
sys_context: global system context
keypress: the keypress to work on
Returns a human-readable representation of the keypress.
Return value: a newly allocated string
sys_context: global system context
map_style: map_style to use as a base
Create a new look object, a look is basically a style plus some dynamic parameters.
Return value: newly created object.
sys_context: global system context
look: look object to free
Frees a look and all its members.
Return value: none.
sys_context: global system context
look: look object to query
Gives the memory taken by this object in memory.
Return value: number of bytes.
sys_context: global system context
look: look object to describe
Returns a readable description of the object.
Return value: newly allocated string.
sys_context: global system context
look: look object to modify
key: the key to change
value: the new value for the key
Sets a new value for a given key in the look. The value is always a string, it will be converted/casted to the right type if needed.
Return value: 1 on success, 0 on failure.
sys_context: global system context
look: look object to query
key: the key to get
Gets a new value for a given key in the look. The value is always a string, it will be converted/casted from the right type if needed.
Return value: dynamically allocated string.
sys_context: global system context
look_a: first object to compare
look_b: second object to compare
Compares two look objects, doing recursive comparisons. This can be very usefull if, for instance, a graphics renderer is using some contextual objects that depend on the look (colors?) and need to be updated/regenerated on a look change
Return value: 1 if they are the same, 0 if not.
sys_context: global system context
look: object to duplicate
Duplicates a look object, performing recursive copies.
Return value: newly allocated object.
sys_context: global system context
look: look object to modify
Peforms sanity checks and modifies the look if needed, to make all values fit within acceptable ranges, among other things.
Return value: none.
sys_context: global system context
look: look object to act upon
zoom_step: how much we should zoom, 2.0 means 2 times bigger
Zooms in, the function does not only multiplicates the current zoom, it also performs sanity checks.
Return value: 1 if zoom was changed, 0 if not.
sys_context: global system context
look: look object to act upon
zoom_step: how much we should zoom, 2.0 means 2 times smaller
Zooms out, the function does not only divides the current zoom, it also performs sanity checks.
Return value: 1 if zoom was changed, 0 if not.
sys_context: global system context
title: the string to be displayed, what the user sees. Can be freed after the call is done, function will make a copy internally.
help: a string introducing the menu, describing what it does, giving hints on how to use it.
popup: a string to be displayed in popup mode when menu is displayed for the first time.
esc: the label to be displayed in the ESC button
enable_esc: wether to enable the escape button.
Constructs a new menu object. Note that you can always call other functions to modify it afterwards.
Return value: a pointer to the newly allocated object.
sys_context: global system context
menu: a pointer to the menu.
Frees the menu, checking if things are OK before doing so.
Return value: none.
sys_context: global system context
menu: a pointer to the menu.
Gets the memory occupied by the menu. Could be usefull to help a garbage collector taking decisions or reporting erros, for instance.
Return value: the number of bytes used.
sys_context: global system context
menu: a pointer to the menu.
Constructs a readable description of the object. Usefull for debugging, or to introspect things using scripts, at run-time. Does not necessarly describe all the informations about the object, but helps knowing what it is.
Return value: a string describing the object, must be freed.
sys_context: global system context
menu: a pointer to the menu.
title: the new title, you can free it after calling the function, an internal copy will be made.
Change the title of the menu. Use this function to change the title, don’t try to access the struct directly. The idea is to have safe memory management.
Return value: none
sys_context: global system context
menu: a pointer to the menu.
help: the new help, you can free it after calling the function, an internal copy will be made.
Change the help of the menu. Use this function to change the help, don’t try to access the struct directly. The idea is to have safe memory management.
Return value: none
sys_context: global system context
menu: a pointer to the menu.
popup: the new popup, you can free it after calling the function, an internal copy will be made.
Change the popup of the menu. That is to say, its popup. Use this function to change the popup, don’t try to access the struct directly. The idea is to have safe memory management.
Return value: none
sys_context: global system context
menu: a pointer to the menu.
Closes the popup, in practice, this is equivalent to setting the popup string to "" or NULL.
Return value: none
sys_context: global system context
menu: a pointer to the menu.
Tells wether a popup is defined. Behavior is simplistic, at creation (when a non-NULL non-empty popup string has been set) then the popup is displayed. In this state, popup is considered to be defined. Then it can be close, and after this action the popup ain’t here anymore, program continues the way it started.
Return value: 1 if has popup, 0 if does not
sys_context: global system context
menu: the menu we want to query
position: the order of the item we want
Gets the menu item at the given position. First item is 0, last is N-1. Returns a pointer on the real object, not a copy.
Return value: a pointer to a menu item, NULL if out of range.
sys_context: global system context
menu: the menu we want to modify
position: the position of the item we want to select
allow_scroll: wether scrolling should be allowed when displaying it
now: the current time, as a timestamp.
Selects the item at the given position. Use this function to be sure that only one item is selected, and all other states are consistent. Timestamp is needed for the sake of eye-candy.
Return value: 1 if success, 0 if failure (out of range).
sys_context: global system context
menu: the menu we want to modify
state: 1 to select, 0 to unselect
now: the current time, as a timestamp.
Selects the escape item, this does not affect other items, it’s mostly. to handle eye candy.
Return value: none.
sys_context: global system context
menu: the menu we want to modify
state: 1 to enable, 0 to disable
now: the current time, as a timestamp.
Enables the escape item, this does not affect other items, it’s mostly. to handle eye candy.
Return value: none.
sys_context: global system context
menu: the menu to scroll
Scrolls a menu up, used as a callback for mouse wheel up for instance. The idea is just to decrement the first displayed item index.
Return value: 1 if OK, 0 if failed (out of range).
sys_context: global system context
menu: the menu to scroll
Scrolls a menu down, used as a callback for mouse wheel down for instance. The idea is just to increment the first displayed item index.
Return value: 1 if OK, 0 if failed (out of range).
sys_context: global system context
menu: the menu to scroll
breadcrumbs: list of strings containing breadcrumbs
Set the breadcrumbs, that’s to say the readable, logical path to get to a given menu. This is just eye candy, not linked to any logic at this level.
Return value: 1 if OK, 0 if failed.
sys_context: global system context
menu: the menu to center
position: the position of the menuitem to be put in the center
max_displayed_items: the maximum number of items displayed
Centers the menu on a given menuitem. Typically used when pushing a menu with a menuitem selected ’anywhere’ in the list.
Return value: none.
sys_context: global system context
menu: the menu we want to modify
menuitem: the item to insert
position: the position the new item will occupy ("insert before" mode)
now: the current time, as a timestamp.
Inserts the given item in the menu. All items starting at the insert position will be "pushed" (that is, their position incremented by 1). Once the menuitem is inserted, the menu object will take care of memory management and automatically free it when needed.
Return value: 1 if success, 0 if failure (memory problem, out of range).
sys_context: global system context
menu: the menu we want to modify
menuitem: the item to insert
now: the current time, as a timestamp.
Appends the given item to the menu. Once the menuitem is appended, the menu object will take care of memory management and automatically free it when needed.
Return value: 1 if success, 0 if failure (memory problem).
sys_context: global system context
menu: the menu we want to modify
position: the item to insert
now: the current time, as a timestamp.
Removes an item from the menu. It will automatically be freed.
Return value: 1 if success, 0 if failure (out of range).
sys_context: global system context
menu: the menu we want to modify
now: the current time, as a timestamp.
Removes all items from the menu, usefull when one wants to repopulate the items completely, from scratch.
Return value: 1 if success, 0 if failure.
sys_context: global system context
menu: the menu concerned
max_displayed_items: the maximum number of items to display at once
Updates the display range. The reason for having this is that the
first item, that is, how far we scroll in a very long menu, depends
on the previous position. Plus you have to handle limit cases (begin/end).
Thus, this function, which will automatically pick-up a suitable
position. Of course, first_item_displayed
is not necessarly
equal to selected_item
.
Return value: none.
sys_context: global system context
menu: the menu to work on
label: the label of the menuitem to append
tooltip: the tooltip of the menuitem to append
value: the value of the menuitem to append
enabled: wether the inserted menuitem should be enabled
selected: wether the inserted menuitem should be selected
colored: wether the inserted menuitem should use value as its color
now: current time (timestamp)
Inserts a menu item at the given position. The idea is that the menu item object is automatically constructed on the fly, and an id is returned, which can be passed to ’_using_id’ menu-related functions. This is typically for using in scripts. The idea is that the script just keeps a copy of the id returned, and can this way operate directly on the menuitem without keeping a pointer, a smob or anything internally. From the C point of view, having a real C structure enables persistent data from one display to the other, and this is nice and conveninent. I acknowledge the prototype is scary.
Return value: 0 if error, or else an id which will later be used with ’_using_id’ functions.
sys_context: global system context
menu: the menu to work on
label: the label of the menuitem to append
tooltip: the tooltip of the menuitem to append
value: the value of the menuitem to append
enabled: wether the appended menuitem should be enabled
selected: wether the appended menuitem should be selected
colored: wether the appended menuitem should use value as its color
now: current time (timestamp)
Appends a menuitem using the same logic as lw6gui_menu_insert_for_id_use
that is to say a parameter is returned which can later be used to
directly operate on a given menuitem, without having its pointer,
and even if its position changes.
Return value: 0 if error, or else an id which will later be used with ’_using_id’ functions.
sys_context: global system context
menu: the menu to work on
menuitem_id: the id of the menuitem to remove
now: current time (timestamp)
Deletes the menuitem with the given id. Very important: the id is not the position. Id are arbitrary numbers that stick to menuitems, but they are not directly linked with the position. This function is practical to use if, for some reason, you don’t have the pointer on the menuitem.
Return value: 1 if success, 0 if failure (out of range).
sys_context: global system context
menu: the menu to work on
menuitem_id: the id of the menuitem to synchronize
label: menu label
tooltip: menu tooltip
value: value
enabled: wether it’s usable or not
selected: 1 if the menuite is current item
colored: wether to use color
now: current time (timestamp)
Updates the menuitem with the given id. Very important: the id is not
the position. Id are arbitrary numbers that stick to menuitems, but
they are not directly linked with the position. This function is practical
to use if, for some reason, you don’t have the pointer on the menuitem.
In practice, it’s heavily used in the game to transmit informations from
the scripts to the core C engine. Additionnaly, this function will
automatically synchronize the selected_item
field of the menu struct.
Return value: 1 if success, 0 if failure (out of range).
sys_context: global system context
menu_a: first item to compare
menu_b: second item to compare
Compares two menus.
Return value: 1 if they are the same, 0 if not
sys_context: global system context
menu: the menu to duplicate
Duplicates a menu structure.
Return value: a pointer to the new menu.
sys_context: global system context
dst: the target menu
src: the source menu
Synchronizes two menus, this supposes that they represent the same menu, but
simply in a different state. This function does not really copy src to dst, it
has a special behavior, indeed everything is copied from src to dst, except
the first_item_displayed
and nb_items_displayed
which are taken from dst
and copied to src. This is because in practise, those values are updated
in the display loop/thread, which is the one which uses the target. This is
not very orthodox, but should work.
Return value: 1 if success, 0 if failure
sys_context: global system context
label: the string to be displayed, what the user sees. Can be freed after the call is done, function will make a copy internally.
tooltip: the string to be displayed as a tooltip, describing the menu item in detail. Can be NULL if you don’t want to use this feature.
value: the value. No GUI function uses this, this is the "real" value associated to the item.
enabled: wether the menu item can be selected, used, and so on
selected: wether the menu item is the item selected among all menu items.
colored: wetherr the menu item must, when drawn, be colored according to its value.
Constructs a new menuitem object. Note that you can always call other
functions to modify these values afterwards, this might change rendering
since lw6gui_menuitem_set_value
or lw6gui_menuitem_set_label
will,
for instance, modify the "when was that item last modified" information.
Return value: a pointer to the newly allocated object.
sys_context: global system context
menuitem: a pointer to the menuitem.
Frees the menuitem, checking if things are OK before doing so.
Return value: none.
sys_context: global system context
menuitem: a pointer to the menuitem.
Gets the memory occupied by the menuitem. Could be usefull to help a garbage collector taking decisions or reporting erros, for instance.
Return value: the number of bytes used.
sys_context: global system context
menuitem: a pointer to the menuitem.
Constructs a readable description of the object. Usefull for debugging, or to introspect things using scripts, at run-time. Does not necessarly describe all the informations about the object, but helps knowing what it is.
Return value: a string describing the object, must be freed.
sys_context: global system context
menuitem: a pointer to the menuitem.
label: the new label, you can free it after calling the function, an internal copy will be made.
now: the current time, as a timestamp.
Change the label of the menu item. That is to say, what the user sees.
Use this function to change the menuitem
value, don’t try to access the struct directly. The idea is 1) to have safe
memory management and 2) to keep the last_change
member up to date.
It can be later used for eye-candy effects.
Return value: none
sys_context: global system context
menuitem: a pointer to the menuitem.
tooltip: the new tooltip, you can free it after calling the function, an internal copy will be made.
now: the current time, as a timestamp.
Change the tooltip of the menu item (the explanation of what the item is about)
Use this function to change the menuitem
value, don’t try to access the struct directly. The idea is 1) to have safe
memory management and 2) to keep the last_change
member up to date.
It can be later used for eye-candy effects.
Return value: none
sys_context: global system context
menuitem: a pointer to the menuitem.
value: the new value.
now: the current time, as a timestamp.
Changes the value of a menuitem. This is the internal value, not what
the user sees. Use this function to change the menuitem
value, don’t try to access the struct directly. The idea is to keep
the last_change
member up to date.
It can be later used for eye-candy effects.
Return value: none
sys_context: global system context
menuitem: a pointer to the menuitem.
state: 1 to select, 0 to unselect
now: the current time, as a timestamp.
Switches the menuitem to (un)selected state. Use this function, don’t try
to modify the struct members directly. The idea is to have
the last_select
parameter up to date.
It can be later used for eye-candy effects.
Return value: none
sys_context: global system context
menuitem: a pointer to the menuitem.
state: 1 to enable, 0 to disable
now: the current time, as a timestamp.
Switches the menuitem to enabled/disabled state. Use this function, don’t try
to modify the struct members directly. The idea is to have
the last_select
parameter up to date.
It can be later used for eye-candy effects.
Return value: none
sys_context: global system context
menuitem: the menuitem we want to identify
Returns a checksum which can be used to know, for instance, wether the menuitem has changed or not, and if we should redraw it.
Return value: a checksum.
sys_context: global system context
menuitem_a: first item to compare
menuitem_b: second item to compare
Compares two menuitems.
Return value: 1 if they are the same, 0 if not
sys_context: global system context
menuitem: the menuitem to duplicate
The menuitem to duplicate.
Return value: a pointer to the duplicted menuitem.
sys_context: global system context
dst: the target menuitem
src: the source menuitem
Synchronizes two menuitems, this supposes that they represent the same item, but simply in a different state.
Return value: 1 if success, 0 if failure
sys_context: global system context
mouse: the mouse object to work on
screen_pos_x: the x position on screen
screen_pos_y: the y position on screen
timestamp: current timestamp
Registers a mouse move event.
Return value: note.
sys_context: global system context
mouse: the mouse object to poll
screen_pos_x: pointer to the x position (can be NULL), will be updated even if no move
screen_pos_y: pointer to the y position (can be NULL), will be updated even if no move
Asks wether the mouse has moved or not.
Return value: 1 if mouse was moved since last call, 0 if not.
mouse: the mouse to update
repeat_settings: the repeat settings (delay + interval)
timestamp: the current ticks (milliseconds)
Updates the repeat informations for a mouse, must be called regularly, as often as possible.
Return value: none.
sys_context: global system context
dst: the target mouse object
src: the source mouse object
Synchronizes two mouse objects. This is typically used to pass data from one thread to another. Will handle "mouse move" attribute and clear it in src if needed while setting it in dst.
Return value: 1 if success, O if failure.
sys_context: global system context
mouse: mouse struct to update
To be called when one wants to start recording a drag session, typically when left button is pressed.
Return value: none.
sys_context: global system context
mouse: mouse struct to update
To be called when one wants to stop recording a drag session, typically when left button is released.
Return value: none.
sys_context: global system context
mouse: mouse struct to query
delta_x: x movement (on screen, out param can be NULL)
delta_y: y movement (on screen, out param can be NULL)
pos_x: x pos (on screen, out param can be NULL)
pos_y: y pos (on screen, out param can be NULL)
speed_x: x speed (on screen, out param can be NULL)
speed_y: y speed (on screen, out param can be NULL)
To be called when one wants to stop recording a drag session, typically when left button is released.
Return value: none.
sys_context: global system context
point: point to test
rect: rectangle in which point is supposed to be
Tests wether a point is inside a rectangle, this is typically used to know if a point is inside the right texture or if we’re outside.
Return value: 1 if OK, 0 if outside
sys_context: global system context
input: the value to approach
Finds the closest power of two, which is at least greater or equal to input. Typically used to size textures.
Return value: a power of two.
sys_context: global system context
input: the value to approach
Finds the closest power of two, which is equal of inferior to input. Typically used to size textures.
Return value: a power of two.
sys_context: global system context
quad: quad to test
rect: rectangle in which quad is supposed to be
Tests wether a quad is inside a rectangle, this is typically used to know if a quad is inside the right texture or if we’re outside.
Return value: 1 if OK, 0 if outside
sys_context: global system context
rect_array: the rectangle array to initializae
w: width of the zone to initialize
h: height of the zone to initialize
tile_size: tile size, that is, width and height of sub rectangles
border_size: border to add so that sub rectangles overlap
Initializes a rect array structure, this is usefull for texture handling, it builds an array of sub-rectangle which slightly overlap each other.
Return value: 1 on success, 0 on failure.
sys_context: global system context
rect_array: the rectangle array to initializae
rect: the sub-rectangle (out param)
i: the index of the sub-rectangle (out param)
source_x: the x position on the global rect array
source_y: the y position on the global rect array
Finds out which sub-rectangle is the right one, given a source position. The output values are a correctly initialized sub-rectangle with relative position set plus its index within the container rectangle array.
Return value: 1 on success, 0 on failure.
sys_context: global system context
rect_array: the rectangle array to initializae
rect: the sub-rectangle (out param)
i: the index of the sub-rectangle
Finds out which sub-rectangle is the right one, given a source position. The output value is a correctly initialized sub-rectangle with relative position set.
Return value: 1 on success, 0 on failure.
sys_context: global system context
rect_array: the rectangle array to initializae
rect: the sub-rectangle (out param)
i: the index of the sub-rectangle (out param)
quad: the 4 corresponding points within the sub-rectangle (out param)
source_quad: 4 points within the container rectangle array
x_polarity: polarity along the X axis
y_polarity: polarity along the Y axis
Finds out which sub-rectangle is the right one, given 4 points as an input, and places these 4 points on the sub-rectangle, taking in account the polarity. This is typically used for texture mapping. Note that a rectangle array can’t handle all requests, it need have the good size, granularity.
Return value: 1 on success, 0 on failure.
sys_context: global system context
rect: the structure to initialize
x1: x for top left corner
y1: y for top left corner
x2: x for bottom right corner
y2: y for bottom right corner
Initializes a rect structure, will calculate w & h.
Return value: none.
sys_context: global system context
rect: the structure to initialize
x: x for top left corner
y: y for top left corner
w: width
h: height
Initializes a rect structure, will calculate x2 & y2.
Return value: none.
sys_context: global system context
dst: the structure which will contain the result
src: the source rect
clip: the clipping rect (boundaries)
Clips a rect (think of rectangle clips).
Return value: none.
sys_context: global system context
segment: segment to test
rect: rectangle in which segment is supposed to be
Tests wether a segment is inside a rectangle, this is typically used to know if a segment is inside the right texture or if we’re outside.
Return value: 1 if OK, 0 if outside
sys_context: global system context
smoother: the structure to initialize
value: the value to use for now
duration: the duration of a standard move, in ticks (msec)
Initializes a smoother object, with a default value. The important point is the duration which will condition all the behavior of the object.
Return value: none.
sys_context: global system context
smoother: the structure to use
value: the target value
Forces a smoother object to immediately point on a value.
Return value: none.
sys_context: global system context
smoother: the structure to use
value: the target value
now: the current timestamp
Sets a new target, will automatically calculate current speed to smooth the next returned values.
Return value: none.
sys_context: global system context
smoother: the structure to use
now: the current timestamp
Returns the current value of the smoother.
Return value: a float.
sys_context: global system context
smoother: object to modify
step: step size, typically twice the map size
Companion function of lw6pil_coords_fix_x10
, this one will fix
a smoother target to avoid crazy scrolls when cursor is on a map
edge.
Return value: none.
sys_context: global system context
mode: test mode (bitmask)
Registers all tests for the libgui module.
Return value: 1 if test is successfull, 0 on error.
sys_context: global system context
mode: test mode (bitmask)
Runs the gui
module test suite, testing most (if not all...)
functions.
Return value: 1 if test is successfull, 0 on error.
sys_context: global system context
triangle: triangle to test
rect: rectangle in which triangle is supposed to be
Tests wether a triangle is inside a rectangle, this is typically used to know if a triangle is inside the right texture or if we’re outside.
Return value: 1 if OK, 0 if outside
sys_context: global system context
closest: the closest video_mode found
wished: the wished video_mode
available: a list of available video_modes (list of lw6gui_video_mode_t *)
Finds the closest video_mode available, this is just a small utility to cope with different screen shapes and avoid requesting 640x480 when it’s just not available but there’s a 640x400 instead.
Return value: 1 if the wished video_mode exists in available list and was found, else 0 if the wished video_mode doesn’t exist and an approximative match was picked.
sys_context: global system context
mode_a: first mode to compare
mode_b: second mode to compare
Compares two video modes, to know if they’re the same.
Return value: 1 if equal, 0 if not.
sys_context: global system context
dst: the target video mode
src: the source video mode
Applies the ratio of src to dst, for instance if src is 16/9, then dst will be made 16/9 too, trying to keep the same surface.
Return value: 1 on success, 0 on failure
sys_context: global system context
viewport: the viewport to initalize
screen_w: screen width
screen_h: screen height
drawable_x1: viewport min x
drawable_y1: viewport min y
drawable_x2: viewport max x
drawable_y2: viewport max y
center_x: center of display (in map coordinates)
center_y: center of display (in map coordinates)
map_w: map width (shape)
map_h: map height (shape)
x_polarity: x polarity
y_polarity: y polarity
x_wrap: wether to wrap horizontally
y_wrap: wether to wrap vertically
keep_ratio: wether to adapt to viewport shape or keep original
global_zoom: global zoom is style_zoom * dynamic_zoom
scroll_limit: inside this zone, don’t scroll
use_old_center: wether to take previous center in account
Initializes all the (jumbo?) viewport structure which will contain valuable informations for a simple "flat" display. Special renderers might not find usefull some fields and handle wrapping and zooming their own way, but this offers a basic skeleton.
Return value: 1 if ok, 0 on failure
sys_context: global system context
viewport: the viewport to use
screen_x: the x coord on the screen
screen_y: the y coord on the screen
map_x: the x coord in map coordinates
map_y: the y coord in map coordinates
clip: wether to clip returned values
Translates from map coords to screen coords. Returned values might be outside screen boundaries if clip is 0. If screen coords are outside drawable area anc clip is 1, then they will be clipped.
Return value: NULL
sys_context: global system context
viewport: the viewport to use
map_x: the x coord in map coordinates
map_y: the y coord in map coordinates
screen_x: the x coord on the screen
screen_y: the y coord on the screen
wrap: wether to use polarity informations to wrap coords.
Translates from screen coords to map coords. If wrap is set, it will
interpret coords the way lw6map_coords_fix_xy
would, only it can still
be formally outside map boundaries for it can return a value exactly
equal to w,h while in interger mode it would be w-1,h-1.
Return value: NULL
sys_context: global system context
viewport: viewport to work on
map_dst_x: map det x coord (out param)
map_dst_y: map dst y coord (out param)
map_src_x: map src x coord
map_src_y: map src y coord
screen_dx: drag x (on screen)
screen_dy: drag y (on screen)
Used to calculate the new "center" when in drag mode.
Return value: none.
sys_context: global system context
zone: the structure to initialize
x1: x for top left corner
y1: y for top left corner
x2: x for bottom right corner
y2: y for bottom right corner
Initializes a zone structure, will calculate w & h.
Return value: none.
sys_context: global system context
zone: the structure to initialize
x: x for top left corner
y: y for top left corner
w: width
h: height
Initializes a zone structure, will calculate x2 & y2.
Return value: none.
sys_context: global system context
dst: the structure which will contain the result
src: the source zone
clip: the clipping zone (boundaries)
Clips a zone (think of rectangle clips).
Return value: none.
Used to store a complete button state, along with repeat informations, queues. It might be overkill for basic cases, having different types of buttons (union?) for different cases might be a good idea.
Type: int
Definition: int lw6gui_button_s::is_pressed
Wether button is pressed, 1 means pressed, 0 unpressed.
Type: int
Definition: int lw6gui_button_s::press_queue
Each time the button is pressed, this increases, each times one "pops" a press from it, it’s decreased. This allows for button buffering, as events might take some time to go through the pipeline given the heavily multithreaded nature of the dsp/gfx couple.
Type: int
Definition: int lw6gui_button_s::simple_click_queue
Simple-click counter, as opposed to double-click. A "simple-click" is validated when one has pressed the button, and then waiting long enough to discard the possibility to double-click. This is not really buffered, queue will ignore simple-clicks if one is already buffered.
Type: int
Definition: int lw6gui_button_s::double_click_queue
Double-click counter. This is not really buffered, queue will ignore double-clicks if one is already buffered.
Type: int
Definition: int lw6gui_button_s::triple_click_queue
Triple-click counter. This is not really buffered, queue will ignore triple-clicks if one is already buffered.
Type: int64_t
Definition: int64_t lw6gui_button_s::last_press
Timestamp of last key press.
Type: int64_t
Definition: int64_t lw6gui_button_s::last_repeat
Timestamp of last key repeat.
Type: int64_t
Definition: int64_t lw6gui_button_s::double_click_t1
Used to handle multiple-clicks, this is the timestamp of the click "2 clicks ago".
Type: int64_t
Definition: int64_t lw6gui_button_s::double_click_t2
Used to handle multiple-clicks, this is the timestamp of the click just before the last click.
Type: int64_t
Definition: int64_t lw6gui_button_s::double_click_t3
Used to handle multiple-clicks, this is the timestamp of the last click.
Contains information about available fullscreen modes.
Type: lw6gui_video_mode_t
Definition: lw6gui_video_mode_t lw6gui_fullscreen_modes_s::low
Low resolution mode.
Type: lw6gui_video_mode_t
Definition: lw6gui_video_mode_t lw6gui_fullscreen_modes_s::standard
Standard resolution mode.
Type: lw6gui_video_mode_t
Definition: lw6gui_video_mode_t lw6gui_fullscreen_modes_s::high
High resolution mode.
Global input state, contains informations about the keyboard, mouse and joystick. This is the macro object used to exchange data and transmit input information from the rendering thread which gathers it to the logical thread which computes the game state.
Type: int
Definition: int lw6gui_input_s::need_sync
Wether this input struct has changed and needs to be synchronized.
Type: lw6gui_keyboard_t
Definition: lw6gui_keyboard_t lw6gui_input_s::keyboard
Keyboard information.
Type: lw6gui_mouse_t
Definition: lw6gui_mouse_t lw6gui_input_s::mouse
Mouse information.
Type: lw6gui_joystick_t
Definition: lw6gui_joystick_t lw6gui_input_s::joysticks[LW6GUI_NB_JOYSTICKS]
Joysticks information.
Joystick information, contains detailed joystick state. This structure uses a pad-like interface, there’s no knowledge of analog interfaces, it transforms everything to a binary "up or down" and "left or right". This interface only knows about 6 buttons, this is done on purpose, the logic behind it is that more than 6 buttons makes the control way too complicated. Actually, most common functions are and should be available through the 4 first (a,b,c,d) buttons. The e and f are here for additionnal not-so-important features.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::pad_up
Joystick up button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::pad_down
Joystick down button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::pad_left
Joystick left button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::pad_right
Joystick right button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::button_a
Joystick a button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::button_b
Joystick b button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::button_c
Joystick c button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::button_d
Joystick d button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::button_e
Joystick e button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_joystick_s::button_f
Joystick f button state.
Stores a complete keyboard state.
Type: int
Definition: int lw6gui_keyboard_s::auto_release_enabled
Wether auto_release mode is set.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::arrow_up
State of keyboard up arrow. This can be the combination of several keys, for instance the numeric pad up arrow, and the corresponding arrow pad key.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::arrow_down
State of keyboard down arrow. This can be the combination of several keys, for instance the numeric pad down arrow, and the corresponding arrow pad key.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::arrow_left
State of keyboard left arrow. This can be the combination of several keys, for instance the numeric pad left arrow, and the corresponding arrow pad key.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::arrow_right
State of keyboard right arrow. This can be the combination of several keys, for instance the numeric pad right arrow, and the corresponding arrow pad key.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::key_enter
State of keyboard ENTER key. This can be the combination of several keys, for instance both the numeric pad ENTER and the standard, default one.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::key_esc
State of keyboard ESC key. This can be the combination of several keys, for instance both the standard ESC key and another key.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::key_ctrl
State of keyboard ESC key. This can be the combination of several keys, for instance both left and right CTRL keys.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::key_alt
State of keyboard ESC key. This can be the combination of several keys, for instance both left and right ALT keys.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::key_pgup
State of keyboard PAGE UP key. This can be the combination of several keys.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::key_pgdown
State of keyboard PAGE UP key. This can be the combination of several keys.
Type: lw6sys_list_t *
Definition: lw6sys_list_t* lw6gui_keyboard_s::queue
List of events, contains keypress objects.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_keyboard_s::keys_state[LW6GUI_NB_KEYS]
Array of button states, indexed by keycodes.
Keypress information, contains more than just a keycode but also meta/readable informations about it.
Type: int
Definition: int lw6gui_keypress_s::keysym
The keysym, note that this is implementation specific. In practice, SDL uniformizes this, but there’s no garantee all graphics engine are SDL based, so don’t rely on this too much outside the graphics backend.
Type: int
Definition: int lw6gui_keypress_s::unicode
Unicode code for this letter/key.
Type: char *
Definition: char* lw6gui_keypress_s::label
Readable label for the key, typically usable in a "choose keyboard settings" interface.
The look structure contains everything the renderer needs to skin the display. This is where one specifies the color set, dynamic zoom effect, and possibly other things.
Type: u_int32_t
Definition: u_int32_t lw6gui_look_s::id
The id of the object, this is non-zero and unique within one run session, incremented at each object creation.
Type: float
Definition: float lw6gui_look_s::dynamic_zoom
Dynamic zoom, this is multiplicated by the map zoom, and gives the global zoom, the one finally used.
Type: int
Definition: int lw6gui_look_s::gfx_quality
Overall graphics quality, the higher the better, will trigger various parameters, depending on the renderer.
Type: lw6map_style_t
Definition: lw6map_style_t lw6gui_look_s::style
A style structure which will override the one from the map, depending on the local options (config file, environnement, command-line options).
Menu item object. Basically, a menu is an array of these items, it’s up to the gfx backend to render this as accurately as possible. The most important field is probably the label.
Type: u_int32_t
Definition: u_int32_t lw6gui_menuitem_s::id
The id of the object, this is non-zero and unique within one run session, incremented at each object creation.
Type: char *
Definition: char* lw6gui_menuitem_s::label
What is displayed in the menu item.
Type: char *
Definition: char* lw6gui_menuitem_s::tooltip
An additionnal tooltip explaining what the item is about.
Type: int
Definition: int lw6gui_menuitem_s::value
The value for this item, can typically be used for booleans and integer values, in addition to the information conveyed by the label. One special case is colored items, in that case the value will be used as a color index.
Type: int
Definition: int lw6gui_menuitem_s::enabled
Wether the item is valid and can be used.
Type: int
Definition: int lw6gui_menuitem_s::selected
Wether the item is the current selection.
Type: int
Definition: int lw6gui_menuitem_s::colored
Wether to colorize the item, and in that case, use the value field to know which color to use.
Type: int
Definition: int lw6gui_menuitem_s::last_change
Timestamp of last time the menu item was updated and changed.
Type: int
Definition: int lw6gui_menuitem_s::last_select
Timestamp of last time the menu was selected.
Type: int
Definition: int lw6gui_menuitem_s::last_unselect
Timestamp of last time the menu was unselected.
Menu item object. Basically, a menu is an array of menu items, it’s up to the gfx backend to render this as accurately as possible. The most important field is probably the items labels. The menu object also stores state information such as what was the first item displayed lately.
Type: u_int32_t
Definition: u_int32_t lw6gui_menu_s::id
The id of the object, this is non-zero and unique within one run session, incremented at each object creation.
Type: char *
Definition: char* lw6gui_menu_s::title
Title of the menu, used for breadcrumbs.
Type: char *
Definition: char* lw6gui_menu_s::help
Additionnal help text, explaining what the menu is about.
Type: char *
Definition: char* lw6gui_menu_s::popup
Popup text, will be displayed when the menu is first displayed, and then disappear.
Type: int
Definition: int lw6gui_menu_s::nb_items
Number of items.
Type: lw6gui_menuitem_t *
Definition: lw6gui_menuitem_t* lw6gui_menu_s::esc_item
Special item describing the ESC button.
Type: lw6gui_menuitem_t **
Definition: lw6gui_menuitem_t** lw6gui_menu_s::items
Array of items, containing all the menu items.
Type: int
Definition: int lw6gui_menu_s::selected_item
The current selection.
Type: int
Definition: int lw6gui_menu_s::first_item_displayed
The first item displayed, this is mandatory if we want the menus to be displayable in different states, for instance with first item being 2 and items displayed from 2 to 10 or with first item being 5 and items displayed from 2 to 10. In the first case the 1st item is selected, in the second case it’s the 4th.
Type: int
Definition: int lw6gui_menu_s::nb_items_displayed
Number of items displayed.
Type: int
Definition: int lw6gui_menu_s::order_of_selected_on_display
Index, display-based (that is, 0 here means first displayed and not necessarly first in the items array), of the selected item.
Type: int
Definition: int lw6gui_menu_s::allow_scroll
Wether scrolling is allowed.
Type: lw6sys_list_t *
Definition: lw6sys_list_t* lw6gui_menu_s::breadcrumbs
List of strings containing the breadcrumbs, that is to say all the menu titles that one must use to get here.
Use to store mouse pointer information.
Type: int
Definition: int lw6gui_mouse_pointer_s::pos_x
Mouse X position (pixels).
Type: int
Definition: int lw6gui_mouse_pointer_s::pos_y
Mouse Y position (pixels).
Type: int
Definition: int lw6gui_mouse_pointer_s::speed_x
Mouse X speed. The unit is pixels per second. This is based on the last move, for instance if between two moves 100 msec have elapsed, and mouse moved 13 pixels, then speed is 130.
Type: int
Definition: int lw6gui_mouse_pointer_s::speed_y
Mouse Y speed. The unit is pixels per second. This is based on the last move, for instance if between two moves 100 msec have elapsed, and mouse moved 13 pixels, then speed is 130.
Mouse information, contains detailed mouse state, including mouse position and button states but also keeps track of mouse speed as well as its corresponding map coordinates. That is, given the current screen position, what does it mean on the logical map/battlefield.
Type: int
Definition: int lw6gui_mouse_s::moved
Wether mouse was moved lately. 1 means yes, 0 no.
Type: int64_t
Definition: int64_t lw6gui_mouse_s::last_moved
Timestamp of last move.
Type: lw6gui_mouse_pointer_t
Definition: lw6gui_mouse_pointer_t lw6gui_mouse_s::screen_pointer
Information about the mouse pointer, using screen coordinates, the unit being pixels.
Type: lw6gui_mouse_pointer_t
Definition: lw6gui_mouse_pointer_t lw6gui_mouse_s::map_pointer
Information about the mouse pointer, using map coordinates, the unit being the map slot. This is possibly very different from screen coordinates, they can be inverted, have a different scale, and globally it’s just something else, even if it refers to the same physical move.
Type: lw6gui_mouse_pointer_t
Definition: lw6gui_mouse_pointer_t lw6gui_mouse_s::screen_drag_start
Information about the mouse pointer when drag mode was entered. The unit is screen pixels.
Type: lw6gui_drag_mode_t
Definition: lw6gui_drag_mode_t lw6gui_mouse_s::drag_mode
The current drag state.
Type: int
Definition: int lw6gui_mouse_s::menu_position
The index of the menu item the mouse is on. This is the only was to know when to select an item, one should not use mouse coords outside the gfx renderer code for this purpose, it’s the renderer which has knowledge about where menu items are.
Type: int
Definition: int lw6gui_mouse_s::menu_scroll
Set to -1 if one needs to scroll up (decrease menu index) to +1 if one needs to scroll down (increase menu index) and 0 if one needs to do nothing as far as scrolling is concerned.
Type: int
Definition: int lw6gui_mouse_s::menu_esc
Wether mouse pointer is over the ESC button.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_mouse_s::button_left
Mouse left button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_mouse_s::button_right
Mouse right button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_mouse_s::button_middle
Mouse middle button state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_mouse_s::wheel_up
Mouse wheel up state.
Type: lw6gui_button_t
Definition: lw6gui_button_t lw6gui_mouse_s::wheel_down
Mouse wheel down state.
Standard interface for joypad-like interfaces, can also be used to map keyboard arrows.
Type: int
Definition: int lw6gui_move_pad_s::up
Up button (boolean).
Type: int
Definition: int lw6gui_move_pad_s::down
Down button (boolean).
Type: int
Definition: int lw6gui_move_pad_s::left
Left button (boolean).
Type: int
Definition: int lw6gui_move_pad_s::right
Right button (boolean).
Basic point type, 3 floating point coords.
Type: float
Definition: float lw6gui_point_s::x
X position.
Type: float
Definition: float lw6gui_point_s::y
Y position.
Type: float
Definition: float lw6gui_point_s::z
Z position.
Basic quad type, composed of 4 points (floating point values).
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_quad_s::p1
1st point.
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_quad_s::p2
2nd point.
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_quad_s::p3
3rd point.
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_quad_s::p4
4th point.
Array of rectangles. This is typically used to make tiles that overlap. It’s mostly used to display fighters/maps using multiple textures when the whole stuff does not fit in one single OpenGL texture and needs to be splitted. Technically, when one needs to split textures, performance is poor, but still better than relying on software renderer only.
Type: lw6sys_whd_t
Definition: lw6sys_whd_t lw6gui_rect_array_s::source
Size of original source data.
Type: lw6gui_rect_t
Definition: lw6gui_rect_t lw6gui_rect_array_s::limits
Boundary limits of the rect array, this is typically bigger that source size, it starts at negative values and finishes outside the source. It’s interesting to cover that big an area to enable both the water effect and proper wrapping/clamping.
Type: int
Definition: int lw6gui_rect_array_s::tile_size
Width and height of the tiles, this is typically a power of two, as it’s designed to match an OpenGL low-level texture object.
Type: int
Definition: int lw6gui_rect_array_s::border_size
The border size one needs to cut from the tile_size (on both sides, up and down or left and right) to get the real usable size of the tile.
Type: int
Definition: int lw6gui_rect_array_s::tile_spacing
The tile spacing, difference of X or Y between two tiles, this is typically smaller that tile_size.
Type: int
Definition: int lw6gui_rect_array_s::nb_tiles_w
Number of tiles on the X axis (width).
Type: int
Definition: int lw6gui_rect_array_s::nb_tiles_h
Number of tiles on the Y axis (height).
Type: int
Definition: int lw6gui_rect_array_s::nb_tiles
Overall number of tiles.
A basic rectangle data. The idea is to store both corner positions and width and height to cache the values and avoid always recalculating them. Values are integer based, for a floating point equivalent, see the zone struct.
Type: int
Definition: int lw6gui_rect_s::x1
Top-left corner X position.
Type: int
Definition: int lw6gui_rect_s::y1
Top-left corner Y position.
Type: int
Definition: int lw6gui_rect_s::x2
Bottom-right corner X position.
Type: int
Definition: int lw6gui_rect_s::y2
Bottom-right corner Y position.
Type: int
Definition: int lw6gui_rect_s::w
Width.
Type: int
Definition: int lw6gui_rect_s::h
Height.
Parameters used to handle repeat. This is used both by keys and buttons (joystick buttons and mouse buttons).
Type: int
Definition: int lw6gui_repeat_settings_s::delay
Delay, in milliseconds, after which a given key/button enters repeat mode.
Type: int
Definition: int lw6gui_repeat_settings_s::interval
Interval, in milliseconds, between two key/button press events in repeat mode.
Type: int
Definition: int lw6gui_repeat_settings_s::double_click_delay
If pressed twice within this delay (in milliseconds) then a double-click event is generated.
Type: int
Definition: int lw6gui_repeat_settings_s::auto_release_delay
After this delay (milliseconds) any key will be considered be unpressed, that is, it will be released automatically. This is usefull when the input library (depends on the gfx backend) does not send proper "key up" events. The workarround is to automatically consider the key is released after some time. Usually, this would typically be set just below the repeat delay.
Basic segment type, composed of 2 points (floating point values).
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_segment_s::p1
1st point.
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_segment_s::p2
2nd point.
Statefull object used to make transitions between 2 floats. Basically, one needs to choose a target, which is y2, and give a start, which is defined by s1 and y1 (speed and y value). Then with t1 (start timestamp) and duration the object has functions which enables interpolation between those two values, knowing at the end the value will be y2 and the speed 0. To some extent, this is a primitive bezier-like tool.
Type: float
Definition: float lw6gui_smoother_s::s1
Speed at startup.
Type: float
Definition: float lw6gui_smoother_s::y1
Y value at startup.
Type: float
Definition: float lw6gui_smoother_s::y2
Y target value.
Type: int64_t
Definition: int64_t lw6gui_smoother_s::t1
Timestamp at startup.
Type: int
Definition: int lw6gui_smoother_s::duration
Duration (in milliseconds) of the transition.
Basic triangle type, composed of 3 points (floating point values).
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_triangle_s::p1
1st point.
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_triangle_s::p2
2nd point.
Type: lw6gui_point_t
Definition: lw6gui_point_t lw6gui_triangle_s::p3
3rd point.
Contains the parameters for a video mode, regardless of driver used.
Type: int
Definition: int lw6gui_video_mode_s::width
Width, in pixels.
Type: int
Definition: int lw6gui_video_mode_s::height
Height, in pixels.
Type: int
Definition: int lw6gui_video_mode_s::fullscreen
1 for fullscreen mode, 0 for windowed mode.
Macro object used to store viewport information. Viewport here means "what part of the map should we display, on which part of the screen, and with which parameters".
Type: lw6sys_whd_t
Definition: lw6sys_whd_t lw6gui_viewport_s::map_shape
Shape of the map to display, unit is map slot.
Type: lw6sys_whd_t
Definition: lw6sys_whd_t lw6gui_viewport_s::screen_shape
Shape of the screen, unit is pixels.
Type: float
Definition: float lw6gui_viewport_s::center_x
X coord of the point we want to display at the center of the screen. This is typically our main cursor if we’re using the keyboard to move it. Unit is map slot.
Type: float
Definition: float lw6gui_viewport_s::center_y
Y coord of the point we want to display at the center of the screen. This is typically our main cursor if we’re using the keyboard to move it. Unit is map slot.
Type: float
Definition: float lw6gui_viewport_s::old_center_x
Previous X coord of the point we wanted to display at the center of the screen. This is typically our main cursor if we’re using the keyboard to move it. Unit is map slot.
Type: float
Definition: float lw6gui_viewport_s::old_center_y
Previous Y coord of the point we wanted to display at the center of the screen. This is typically our main cursor if we’re using the keyboard to move it. Unit is map slot.
Type: float
Definition: float lw6gui_viewport_s::speed_x
Speed at which the viewport is moving on the X axis, unit is map slot per second.
Type: float
Definition: float lw6gui_viewport_s::speed_y
Speed at which the viewport is moving on the Y axis, unit is map slot per second.
Type: int
Definition: int lw6gui_viewport_s::x_polarity
X-polarity parameter (1=on, 0=off, -1=invert).
Type: int
Definition: int lw6gui_viewport_s::y_polarity
Y-polarity parameter (1=on, 0=off, -1=invert).
Type: int
Definition: int lw6gui_viewport_s::x_wrap
Wether to wrap map on the X axis.
Type: int
Definition: int lw6gui_viewport_s::y_wrap
Wether to wrap map on the Y axis.
Type: lw6gui_zone_t
Definition: lw6gui_zone_t lw6gui_viewport_s::drawable
Drawable zone, this is the physical on-screen viewport. Unit is pixels.
Type: lw6gui_zone_t
Definition: lw6gui_zone_t lw6gui_viewport_s::map_main
Zone corresponding to the map, if it was to be drawn as a whole, regardless of drawable size, wrapping and polarity.
Type: lw6gui_zone_t
Definition: lw6gui_zone_t lw6gui_viewport_s::map_main_clipped
Zone corresponding to the map, only the main map, ignoring wrapping and polarity, but clipped with drawable zone.
Type: lw6gui_zone_t
Definition: lw6gui_zone_t lw6gui_viewport_s::map_visible
Actual visible zone of the map, including wrapping, polarity, and drawable clip aware.
A basic rectangle data. The idea is to store both corner positions and width and height to cache the values and avoid always recalculating them. Values are float based, for an integer point equivalent, see the rect struct.
Type: float
Definition: float lw6gui_zone_s::x1
Top-left corner X position.
Type: float
Definition: float lw6gui_zone_s::y1
Top-left corner Y position.
Type: float
Definition: float lw6gui_zone_s::x2
Bottom-right corner X position.
Type: float
Definition: float lw6gui_zone_s::y2
Bottom-right corner Y position.
Type: float
Definition: float lw6gui_zone_s::w
Width.
Type: float
Definition: float lw6gui_zone_s::h
Height.