JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
Pixels.hpp
Go to the documentation of this file.
1
// Copyright 2021-2022 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 <
cstdint
>
8
9
namespace
jngl
{
10
11
class
ScaleablePixels;
12
14
class
Pixels
{
15
public
:
16
explicit
Pixels
(int32_t);
17
explicit
Pixels
(
double
);
18
19
explicit
operator
float()
const
;
20
21
explicit
operator
double()
const
;
22
23
explicit
operator
int()
const
;
24
25
explicit
operator
ScaleablePixels
()
const
;
26
27
Pixels
& operator+=(
Pixels
);
28
29
private
:
30
friend
bool
operator>(
jngl::Pixels
,
jngl::Pixels
);
31
32
double
value;
33
};
34
35
bool
operator>(
jngl::Pixels
,
jngl::Pixels
);
36
Pixels
operator/(
Pixels
,
float
);
37
38
}
// namespace jngl
39
40
jngl::Pixels
operator
""
_px(
unsigned
long
long
);
jngl::Pixels
Scale-dependent pixels, corresponds to actual pixels on the screen.
Definition
Pixels.hpp:14
jngl::ScaleablePixels
Scale-independent pixels, also called "screen pixels".
Definition
ScaleablePixels.hpp:15
cstdint
jngl
JNGL's main namespace.
Definition
Achievement.hpp:10