JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
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
9namespace jngl {
10
11class ScaleablePixels;
12
14class Pixels {
15public:
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
29private:
30 friend bool operator>(jngl::Pixels, jngl::Pixels);
31
32 double value;
33};
34
35bool operator>(jngl::Pixels, jngl::Pixels);
36Pixels operator/(Pixels, float);
37
38} // namespace jngl
39
40jngl::Pixels operator"" _px(unsigned long long);
Scale-dependent pixels, corresponds to actual pixels on the screen.
Definition: Pixels.hpp:14
Scale-independent pixels, also called "screen pixels".
JNGL's main namespace.
Definition: Achievement.hpp:10