Blender V5.0
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 blender::gpu::Texture *texture_ = nullptr;
20 gpu::Batch *batch_;
21
22 public:
25
26 void create_from_buffer(pxr::HdRenderBuffer *buffer);
27 void draw(gpu::Shader *shader,
28 const pxr::GfVec4d &viewport,
29 blender::gpu::Texture *tex = nullptr);
31
32 private:
33};
34
35class ViewportEngine : public Engine {
36 private:
37 double time_begin_;
38 DrawTexture draw_texture_;
39
40 public:
41 using Engine::Engine;
42
43 void render() override;
44 void render(bContext *context);
45
46 protected:
47 void notify_status(float progress, const std::string &info, const std::string &status) override;
48};
49
50} // namespace blender::render::hydra
void draw(gpu::Shader *shader, const pxr::GfVec4d &viewport, blender::gpu::Texture *tex=nullptr)
blender::gpu::Texture * texture() const
void create_from_buffer(pxr::HdRenderBuffer *buffer)
Engine(RenderEngine *bl_engine, const std::string &render_delegate_name)
Engine(RenderEngine *bl_engine, const std::string &render_delegate_name)
void notify_status(float progress, const std::string &info, const std::string &status) override
const int status