Optibits
Loading...
Searching...
No Matches
Drawable.hpp
1#pragma once
2
3#include <Optibits/Fwd.hpp>
4#include <Optibits/Color.hpp>
5#include <Optibits/GraphicsBase.hpp>
6#include <Optibits/Utility.hpp>
7// STD
8#include <cstdint>
9#include <memory>
10
11namespace Optibits
12{
13
14 const unsigned MAX_TEXTURE_SIZE = 1024;
15
16 struct GLTexInfo
17 {
18 std::uint32_t texName;
19 double left, right, top, bottom;
20 };
21
22 class Drawable : private Noncopyable
23 {
24 public:
25 Drawable() = default;
26 virtual ~Drawable() = default;
27
28 virtual int width() const = 0;
29 virtual int height() const = 0;
30
31 virtual int draw(double x1, double y1, Color c1, //
32 double x2, double y2, Color c2, //
33 double x3, double y3, Color c3, //
34 double x4, double y4, Color c4, //
35 ZPos z, BlendMode mode) const
36 = 0;
37
38 virtual const GLTexInfo* glTexInfo() const = 0;
39
40 virtual Bitmap toBitMap const = 0;
41
42 virtual std::unique_ptr<Drawable> subimage(const Rect& rect) const = 0;
43
44 virtual void insert(const Bitmap& bitmap, int x, int y) = 0;
45
46 };
47}
Definition Bitmap.hpp:13
Definition Drawable.hpp:23
Definition Utility.hpp:24
Definition Color.hpp:11
Definition Drawable.hpp:17
Definition Utility.hpp:39