forked from OpenLoco/OpenLoco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RenderTarget.h
33 lines (25 loc) · 865 Bytes
/
RenderTarget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <OpenLoco/Engine/Ui/Rect.hpp>
#include <cstdint>
#include <optional>
namespace OpenLoco::Gfx
{
#pragma pack(push, 1)
// TODO: Convert this to a handle once everything is implemented.
// Depending on the rendering engine this could be a buffer on GPU or RAM.
struct RenderTarget
{
uint8_t* bits; // 0x00
int16_t x; // 0x04
int16_t y; // 0x06
int16_t width; // 0x08
int16_t height; // 0x0A
int16_t pitch; // 0x0C note: this is actually (pitch - width)
uint16_t zoomLevel; // 0x0E
Ui::Rect getUiRect() const;
Ui::Rect getDrawableRect() const;
};
#pragma pack(pop)
RenderTarget& getScreenRT();
std::optional<Gfx::RenderTarget> clipRenderTarget(const Gfx::RenderTarget& src, const Ui::Rect& newRect);
}