23#ifndef VCL_BGFX_READ_FRAMEBUFFER_REQUEST_H
24#define VCL_BGFX_READ_FRAMEBUFFER_REQUEST_H
27#include <vclib/render/read_buffer_types.h>
28#include <vclib/space/core/color.h>
29#include <vclib/space/core/point.h>
35class ReadFramebufferRequest
38 using FloatData = ReadBufferTypes::FloatData;
39 using ByteData = ReadBufferTypes::ByteData;
40 using ReadData = ReadBufferTypes::ReadData;
41 using CallbackReadBuffer = ReadBufferTypes::CallbackReadBuffer;
44 ReadFramebufferRequest(
46 Point2<uint> framebufferSize,
47 CallbackReadBuffer callback,
48 const Color& clearColor = Color::Black);
51 ReadFramebufferRequest(
52 Point2<uint> framebufferSize,
53 CallbackReadBuffer callback,
54 const Color& clearColor = Color::Black);
56 ~ReadFramebufferRequest();
58 ReadFramebufferRequest& operator=(ReadFramebufferRequest&& right) =
default;
60 bgfx::ViewId viewId()
const;
62 bgfx::FrameBufferHandle frameBuffer()
const;
66 bool isSubmitted()
const;
68 bool isAvailable(uint32_t currentFrame)
const;
70 [[nodiscard]]
bool performRead(uint32_t currFrame)
const;
83 uint32_t frameAvailable = 0;
88 bgfx::FrameBufferHandle offscreenFbh = BGFX_INVALID_HANDLE;
90 bgfx::ViewId viewOffscreenId = 0;
93 bgfx::TextureHandle blitTexture = BGFX_INVALID_HANDLE;
94 Point2<uint16_t> blitSize = {0, 0};
96 ReadData readData = {};
98 CallbackReadBuffer readCallback =
nullptr;
100 bool submitted =
false;
Point2< int > Point2i
A convenience alias for a 2-dimensional Point with integer components.
Definition point.h:731