JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
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
9
namespace
jngl
{
10
12
struct
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
Vec2.hpp
Contains jngl::Vec2 class.
jngl::Vec2
Two-dimensional vector.
Definition
Vec2.hpp:36
jngl::Vec2::y
double y
y component
Definition
Vec2.hpp:48
jngl::Vec2::x
double x
x component
Definition
Vec2.hpp:45
jngl
JNGL's main namespace.
Definition
Achievement.hpp:10
jngl::Rect
Simple struct for a rectangle, can be use with jngl::contains.
Definition
Rect.hpp:12