core/io/window.hpp file

Class cubos::core::io::Window and related types.

Namespaces

namespace cubos
Cubos libraries namespace.
namespace cubos::core
Core namespace.
namespace cubos::core::gl
Graphics module.
namespace cubos::core::io
Input and output module.

Classes

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

Enums

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 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.