8#include "../utils/vec2.hpp"
22enum class Key : uint16_t {
366 std::span<const SpriteData> sprites) {
367 { window.pollEvents(event) } -> std::same_as<bool>;
368 { window.beginFrame(color) } -> std::same_as<bool>;
369 { window.draw(sprites) } -> std::same_as<void>;
370 { window.endFrame() } -> std::same_as<void>;
Input query interface filled by the window backend.
Definition RenderConcept.hpp:186
int(* _getMouseY)(void *)
Backend mouse y query.
Definition RenderConcept.hpp:201
void * userData
Backend context passed to every function.
Definition RenderConcept.hpp:189
bool isKeyReleased(Key key) const
Tells whether a key was released this frame.
Definition RenderConcept.hpp:225
bool isKeyPressed(Key key) const
Tells whether a key is held.
Definition RenderConcept.hpp:216
bool(* _isMouseButtonPressed)(void *, MouseButton)
Backend mouse press query.
Definition RenderConcept.hpp:195
bool(* _isKeyReleased)(void *, Key)
Backend key release query.
Definition RenderConcept.hpp:193
bool isGamepadButtonPressed(int joystickId, GamepadButton button) const
Tells whether a gamepad button is held.
Definition RenderConcept.hpp:271
bool(* _isGamepadConnected)(void *, int)
Backend gamepad presence query.
Definition RenderConcept.hpp:209
bool(* _isMouseButtonReleased)(void *, MouseButton)
Backend mouse release query.
Definition RenderConcept.hpp:197
bool isGamepadButtonReleased(int joystickId, GamepadButton button) const
Tells whether a gamepad button was released this frame.
Definition RenderConcept.hpp:284
bool(* _isGamepadButtonPressed)(void *, int, GamepadButton)
Backend gamepad press query.
Definition RenderConcept.hpp:203
int getMouseY() const
Returns the cursor y position.
Definition RenderConcept.hpp:261
bool isGamepadConnected(int joystickId) const
Tells whether a gamepad is plugged in.
Definition RenderConcept.hpp:306
bool isMouseButtonPressed(MouseButton button) const
Tells whether a mouse button is held.
Definition RenderConcept.hpp:234
bool(* _isGamepadButtonReleased)(void *, int, GamepadButton)
Backend gamepad release query.
Definition RenderConcept.hpp:205
bool(* _isKeyPressed)(void *, Key)
Backend key press query.
Definition RenderConcept.hpp:191
float(* _getGamepadAxis)(void *, int, GamepadAxis)
Backend gamepad axis query.
Definition RenderConcept.hpp:207
int(* _getMouseX)(void *)
Backend mouse x query.
Definition RenderConcept.hpp:199
float getGamepadAxis(int joystickId, GamepadAxis axis) const
Returns the position of a gamepad axis.
Definition RenderConcept.hpp:297
bool isMouseButtonReleased(MouseButton button) const
Tells whether a mouse button was released this frame.
Definition RenderConcept.hpp:244
int getMouseX() const
Returns the cursor x position.
Definition RenderConcept.hpp:253
Requirements for the window backend used by the render and input systems.
Definition RenderConcept.hpp:365
GamepadAxis
Gamepad analog axes.
Definition RenderConcept.hpp:169
MouseButton
Mouse buttons.
Definition RenderConcept.hpp:130
GamepadButton
Gamepad buttons, with PlayStation style aliases.
Definition RenderConcept.hpp:140
Key
Keyboard keys, mirroring the values of the graphical library.
Definition RenderConcept.hpp:22
Backend independent types and concepts used by engine systems.
Definition AudioManagerConcept.hpp:6
8-bit per channel color.
Definition RenderConcept.hpp:325
uint8_t b
Blue channel.
Definition RenderConcept.hpp:328
uint8_t g
Green channel.
Definition RenderConcept.hpp:327
uint8_t a
Alpha channel.
Definition RenderConcept.hpp:329
uint8_t r
Red channel.
Definition RenderConcept.hpp:326
Everything the renderer needs to draw one sprite.
Definition RenderConcept.hpp:338
utils::vec2 position
Screen position, in pixels.
Definition RenderConcept.hpp:339
ColorRGBA8 color
Color multiplied with the texture.
Definition RenderConcept.hpp:345
utils::vec2 scale
Scale factor on each axis.
Definition RenderConcept.hpp:340
uint32_t flags
Bit 0 flips horizontally, bit 1 vertically.
Definition RenderConcept.hpp:350
utils::vec2 origin
Pivot point, relative to the sprite.
Definition RenderConcept.hpp:342
uint32_t reserved
Unused, keeps the layout aligned.
Definition RenderConcept.hpp:351
TextureRectU16 textureRect
Area of the texture to draw.
Definition RenderConcept.hpp:344
float rotation
Rotation in radians.
Definition RenderConcept.hpp:346
int32_t layer
Draw order, higher layers are drawn on top.
Definition RenderConcept.hpp:349
utils::vec2 size
Size before scaling, in pixels.
Definition RenderConcept.hpp:341
uint32_t textureId
Texture handle returned by the window.
Definition RenderConcept.hpp:348
Area of a texture, in texels.
Definition RenderConcept.hpp:315
uint16_t width
Width.
Definition RenderConcept.hpp:318
uint16_t y
Top edge.
Definition RenderConcept.hpp:317
uint16_t height
Height.
Definition RenderConcept.hpp:319
uint16_t x
Left edge.
Definition RenderConcept.hpp:316
Two dimensional vector of floats.
Definition vec2.hpp:12