cubos::core::io namespace

Input and output module.

Classes

class Cursor
Handle for a custom mouse cursor.
struct GamepadState
Holds the state of a gamepad.
struct KeyEvent
Event sent when a key is pressed or released.
struct ModifiersEvent
Event sent when the modifiers change.
struct MouseButtonEvent
Event sent when a mouse button state changes.
struct MouseMoveEvent
Event sent when the mouse cursor moves.
struct MouseScrollEvent
Event sent when the mouse wheel is scrolled.
struct ResizeEvent
Event sent when the window framebuffer is resized.
struct TextEvent
Event sent when a unicode character is input.
struct GamepadConnectionEvent
Event sent when a gamepad is connected or disconnected.
class BaseWindow
Interface used to wrap low-level window API implementations.

Enums

enum class GamepadButton { Invalid = -1, A, B, X, Y, LBumper, RBumper, Back, Start, Guide, LThumb, RThumb, Up, Right, Down, Left, Count }
Gamepad buttons.
enum class GamepadAxis { Invalid = -1, LX, LY, RX, RY, LTrigger, RTrigger, Count }
Gamepad axes.
enum class Key { Invalid = -1, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9, Escape, LControl, LShift, LAlt, LSystem, RControl, RShift, RAlt, RSystem, Menu, LBracket, RBracket, SemiColon, Comma, Period, Quote, Slash, BackSlash, Tilde, Equal, Dash, Space, Return, BackSpace, Tab, PageUp, PageDown, End, Home, Insert, Delete, Add, Subtract, Multiply, Divide, Left, Right, Up, Down, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7, Numpad8, Numpad9, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Pause, Count }
Keyboard key codes enum.
enum class Modifiers { None = 0, Control = 1, Shift = 2, Alt = 4, System = 8 }
Keyboard modifier flags enum.
enum class MouseButton { Invalid = -1, Left, Right, Middle, Extra1, Extra2 }
Mouse buttons enum.
enum class MouseAxis { X, Y, Scroll }
Mouse axes enums.
enum class MouseState { Default, Locked, Hidden }
Possible mouse states.

Typedefs

using WindowEvent = std::variant<KeyEvent, ModifiersEvent, MouseButtonEvent, MouseMoveEvent, MouseScrollEvent, ResizeEvent, TextEvent, GamepadConnectionEvent>
Variant that can hold any of the window events.
using Window = std::shared_ptr<BaseWindow>
Handle to a window.

Functions

auto gamepadButtonToString(GamepadButton button) -> CUBOS_CORE_API std::string
Converts a GamepadButton enum to a string.
auto stringToGamepadButton(const std::string& str) -> CUBOS_CORE_API GamepadButton
Converts a string to a GamepadButton.
auto gamepadAxisToString(GamepadAxis axis) -> CUBOS_CORE_API std::string
Convert a GamepadAxis to a string.
auto stringToGamepadAxis(const std::string& str) -> CUBOS_CORE_API GamepadAxis
Convert a string to a GamepadAxis.
auto openWindow(const std::string& title = "Cubos", const glm::ivec2& size = {800, 600}, bool vSync = true) -> CUBOS_CORE_API Window
Opens a new window.
auto mouseButtonToString(MouseButton button) -> CUBOS_CORE_API std::string
Converts a MouseButton enum to a string.
auto stringToMouseButton(const std::string& str) -> CUBOS_CORE_API MouseButton
Convert a string to a MouseButton enum.