RenderTarget GetData
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 2m11s
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 2m11s
Async GetData is todo
This commit is contained in:
@@ -27,6 +27,8 @@ public:
|
||||
[[nodiscard]] GLuint GetGLFramebufferObjectHandle() const;
|
||||
[[nodiscard]] GLuint GetGLDepthBufferHandle() const;
|
||||
[[nodiscard]] Color4 GetClearColor() const;
|
||||
/// Get the data back from the FBO. This is *not* async friendly.
|
||||
[[nodiscard]] std::vector<GLfloat> GetData() const;
|
||||
public:
|
||||
/// Create a render target for a texture that already exists. For decals.
|
||||
explicit RenderTarget(const Texture& texture, const Color4& clear_color = Colors::Black, bool use_depth = false);
|
||||
|
@@ -42,10 +42,9 @@ public:
|
||||
/// Get list data back from the GPU. This is *very* slow.
|
||||
/// It's not recommended you use this in your normal rendering routines.
|
||||
template <typename T>
|
||||
[[nodiscard]] std::vector<T> GetListData() const {
|
||||
[[nodiscard]] std::vector<T> GetData() const {
|
||||
GLenum buffer_type;
|
||||
GLint current_buffer = 0;
|
||||
|
||||
if constexpr (std::is_same<T, GLfloat>::value)
|
||||
buffer_type = GL_ARRAY_BUFFER,
|
||||
glGetIntegerv(GL_ARRAY_BUFFER_BINDING, ¤t_buffer);
|
||||
|
Reference in New Issue
Block a user