JNGL
Pixels.hpp
Go to the documentation of this file.
1 // Copyright 2021 Jan Niklas Hasse <[email protected]>
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 int() const;
22 
23  explicit operator ScaleablePixels() const;
24 
25  Pixels& operator+=(Pixels);
26 
27 private:
28  friend bool operator>(jngl::Pixels, jngl::Pixels);
29 
30  double value;
31 };
32 
33 bool operator>(jngl::Pixels, jngl::Pixels);
34 
35 } // namespace jngl
36 
37 jngl::Pixels operator"" _px(unsigned long long);
Scale-dependent pixels, corresponds to actual pixels on the screen.
Definition: Pixels.hpp:14
Scale-independent pixels, see jngl::getScaleFactor()
JNGL's main namespace.
Definition: App.hpp:10