Expand description
minifb is a cross platform library written in Rust that makes it easy to open windows (usually native to the running operating system) and can optionally show a 32-bit buffer. minifb also support keyboard, mouse input and menus on selected operating systems.
Structs§
- Menu
- Menu holds info for menus
- Menu
Item - Holds info about each item in a menu
- Unix
Menu - Used on POSIX systems (Linux, FreeBSD, etc) as menus aren’t supported in a native way there. This structure can be used by calling [#get_posix_menus] on Window.
- Unix
Menu Item - Used on POSIX systems (Linux, FreeBSD, etc) as menus aren’t supported in a native way there. This structure holds info for each item in a #UnixMenu
- Window
- Window is used to open up a window. It’s possible to optionally display a 32-bit buffer when the widow is set as non-resizable.
- Window
Options - WindowOptions is creation settings for the window. By default the settings are defined for displayng a 32-bit buffer (no scaling of window is possible)
Enums§
- Cursor
Style - Different style of cursors that can be used
- Error
- Errors that can be returned from various operations
- Icon
- Represents a window icon
- Key
- Key is used by the get key functions to check if some keys on the keyboard has been pressed
- KeyRepeat
- Used for is_key_pressed and get_keys_pressed() to indicated if repeat of presses is wanted
- Mouse
Button - The various mouse buttons that are availible
- Mouse
Mode - The different modes that can be used to decide how mouse coordinates should be handled
- Scale
- Scale will scale the frame buffer and the window that is being sent in when calling the update function. This is useful if you for example want to display a 320 x 256 window on a screen with much higher resolution which would result in that the window is very small.
- Scale
Mode - On some OS (X11 for example) it’s possible a window can resize even if no resize has been set. This causes some issues depending on how the content of an input buffer should be displayed then it’s possible to set this scaling mode to get a better behavior.
Constants§
- MENU_
KEY_ ALT - Alt key
- MENU_
KEY_ COMMAND - Command key on Mac OS
- MENU_
KEY_ CTRL - Control key
- MENU_
KEY_ SHIFT - Shift key
- MENU_
KEY_ WIN - Windows key on Windows
Traits§
- HasWindow
Handle - A handle to a window.
- Input
Callback - This trait can be implemented and set with
set_input_callback
to receive a callback when there is inputs.