24 lines
736 B
C++
24 lines
736 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
// Commands emitted by the 40250 UI drawing calls, consumed by Godot's CanvasItem.
|
|
// The port layer stays independent of godot-cpp.
|
|
struct UIRenderCommand {
|
|
enum Kind { Bar, Line, Text, Image } kind;
|
|
float x1, y1, x2, y2;
|
|
std::uint32_t argb;
|
|
float clip_x1 = 0, clip_y1 = 0, clip_x2 = 0, clip_y2 = 0;
|
|
std::string text;
|
|
};
|
|
|
|
void UIRenderSetSize(int width, int height);
|
|
void UIRenderGetSize(unsigned* width, unsigned* height);
|
|
void UIRenderBeginFrame();
|
|
void UIRenderAdd(UIRenderCommand command);
|
|
const std::vector<UIRenderCommand>& UIRenderCommands();
|
|
void UIRenderSetClip(float x, float y, float width, float height);
|
|
void UIRenderRestoreClip();
|