Blender V4.3
viewport_engine.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include <pxr/imaging/hd/renderBuffer.h>
8
9#include "GPU_batch.hh"
10#include "GPU_shader.hh"
11#include "GPU_texture.hh"
12
13#include "engine.hh"
14
15namespace blender::render::hydra {
16
18 private:
19 GPUTexture *texture_ = nullptr;
20 gpu::Batch *batch_;
21
22 public:
25
26 void write_data(int width, int height, const void *data);
27 void draw(GPUShader *shader, const pxr::GfVec4d &viewport, GPUTexture *tex = nullptr);
28 GPUTexture *texture() const;
29
30 private:
31};
32
33class ViewportEngine : public Engine {
34 private:
35 double time_begin_;
36 DrawTexture draw_texture_;
37
38 public:
39 using Engine::Engine;
40
41 void render() override;
42 void render(bContext *context);
43
44 protected:
45 void notify_status(float progress, const std::string &title, const std::string &info) override;
46};
47
48} // namespace blender::render::hydra
struct GPUShader GPUShader
void write_data(int width, int height, const void *data)
void draw(GPUShader *shader, const pxr::GfVec4d &viewport, GPUTexture *tex=nullptr)
Engine(RenderEngine *bl_engine, const std::string &render_delegate_name)
void notify_status(float progress, const std::string &title, const std::string &info) override