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 "Vec2.hpp"
8
9namespace jngl {
10
12struct Rect {
13 double getX() const { return pos.x; }
14 double getY() const { return pos.y; }
15 double getWidth() const { return size.x; }
16 double getHeight() const { return size.y; }
17
18 Vec2 pos;
19 Vec2 size;
20};
21
22} // namespace jngl
Contains jngl::Vec2 class.
Two-dimensional vector.
Definition Vec2.hpp:36
double y
y component
Definition Vec2.hpp:48
double x
x component
Definition Vec2.hpp:45
JNGL's main namespace.
Simple struct for a rectangle, can be use with jngl::contains.
Definition Rect.hpp:12