Miscellaneous functions
Functions for using hashmaps, multilanguage text, and other useful staff.
- Structures and Enumerations
- Error functions
Set and get error messages. - VG3_seterror()
Set an errno-value and an error text. - VG3_error()
Return last error text. - VG3_errmsg()
Return last errno-value and error text. - Hashmaps
Hashmaps are like arrays with the key being a string instead of an integer. - VG3_hash_new()
Return an initialized empty hashmap. - VG3_hash_free()
Destroy a hashmap. - VG3_hash_set()
Set a new entry into a hashmap. - VG3_hash_del()
Delete an entry from a hashmap. - VG3_hash_clear()
Empty a hashmap. - VG3_hash_isset()
Return if an entry of a key is in the hashmap. - VG3_hash_get()
Return the value of a key from a hashmap. - VG3_hash_list()
Iterate over the hashmap: return the key of the next entry. - Multilanguage text
Store text for serveral languages into text files. - VG3_multilang_new()
Return an initialized empty multilanguage structure. - VG3_multilang_free()
Destroy a multilanguage structure. - VG3_multilang_clear()
Empty a multilanguage structure. - VG3_multilang_add()
Add texts from a file into a multilanguage structure. - VG3_multilang_get()
Return a text of the given language by a key. - Helpful drawing functions
- VG3_draw_textline()
Draw a line of text at current position and update position for drawing next line. - VG3_input_box()
Show an input-box for entering a textline. - VG3_input_select()
Show a menu-box for selecting an element. - VG3_output_text()
Show a box containing text. - Needful functions
- VG3_version()
Return version of VgaGames3. - VG3_wait_time()
Wait each game-loop, until the loop consumed a defined time. - VG3_pause()
Pause the game (if no network-game). - VG3_color_brightness()
Return a color of reduced brightness. - VG3_utf8_to_iso()
Convert a UTF-8 text into a ISO-8859-1 text (to use fontfiles). - Useful functions
These function may simplify programming the game. - VG3_correct_imageposition()
Adjust rectangle of a resized image for being drawn onto the same position. - VG3_init_windowpos_on_bgimage()
Drawing a section of the background-image which is larger than the window:
Initialize the positioning structure. - VG3_get_windowpos_on_bgimage()
Drawing a section of the background-image which is larger than the window:
Return delta x-/y-coordinates which have to be added drawing the background-image. - VG3_get_xy_direction_from_angle()
Return x-/y-directions of a given angle. - VG3_get_angle_from_xy_direction()
Return the angle of given x-/y-directions. - VG3_move_object_check_collision()
Function to simplify moving an instance of a VgaGames3-object and checking for collisions.