Gazebo Gui

API Reference

9.0.0~pre1
MinimalSceneRhi.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHI_HH_
19#define GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHI_HH_
20
21#include <string>
22
23#include "gz/gui/Plugin.hh"
25
26#include <QSGTexture>
27#include <QSize>
28
29#define GZ_GUI_HAVE_VULKAN \
30 QT_VERSION >= QT_VERSION_CHECK(5, 15, 2) && \
31 QT_CONFIG(vulkan) && \
32 GZ_RENDERING_HAVE_VULKAN
33
34#define GZ_GUI_HAVE_METAL __APPLE__
35
36namespace gz::gui::plugins
37{
40 //
48 {
50 public: virtual ~GzCameraTextureRhi();
51
54 public: virtual void Update(rendering::CameraPtr _camera) = 0;
55 };
56
58 class GzRenderer;
59 class RenderSync;
60
64 {
66 public: virtual ~RenderThreadRhi();
67
69 public: virtual QOffscreenSurface *Surface() const;
70
72 //
74 public: virtual void SetSurface(QOffscreenSurface *_surface);
75
77 public: virtual QOpenGLContext *Context() const;
78
80 //
82 public: virtual void SetContext(QOpenGLContext *_context);
83
85 //
89 public: virtual std::string Initialize() = 0;
90
94 public: virtual void RenderNext(RenderSync *_renderSync) = 0;
95
98 public: virtual void Update(rendering::CameraPtr _camera) = 0;
99
101 public: virtual void* TexturePtr() const = 0;
102
104 public: virtual QSize TextureSize() const = 0;
105
107 public: virtual void ShutDown() = 0;
108 };
109
113 {
115 public: virtual ~TextureNodeRhi();
116
118 public: virtual QSGTexture *Texture() const = 0;
119
122 public: virtual bool HasNewTexture() const = 0;
123
128 public: virtual void NewTexture(
129 void* _texturePtr, const QSize &_size) = 0;
130
133 public: virtual void PrepareNode() = 0;
134 };
135} // namespace gz::gui::plugins
136
137#endif // GZ_GUI_PLUGINS_MINIMALSCENE_MINIMALSCENERHI_HH_