JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Rect.hpp
Go to the documentation of this file.
1// Copyright 2024 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
5#pragma once
6
7#include "Mat3.hpp"
8#include "Vec2.hpp"
9
10namespace jngl {
11
13struct Rect {
14 double getX() const;
15 double getY() const;
16 double getWidth() const;
17 double getHeight() const;
18
21
22 Vec2 pos;
23 Vec2 size;
24};
25
26} // namespace jngl
Contains jngl::Mat3 class.
Contains jngl::Vec2 class.
3x3 matrix
Definition Mat3.hpp:18
Two-dimensional vector.
Definition Vec2.hpp:36
JNGL's main namespace.
jngl::Mat3 modelview()
Returns a copy of the global ModelView matrix.
Simple struct for a rectangle, can be use with jngl::contains.
Definition Rect.hpp:13
void drawBoundingBox(Mat3 modelview) const
Draws a red box around the rectangle.