Overte C++ Documentation
RenderableCanvasEntityItem.h
1 //
2 // Created by Ada <ada@thingvellir.net> on 2025-02-24
3 // Copyright 2025 Overte e.V.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 // SPDX-License-Identifier: Apache-2.0
8 //
9 
10 #ifndef hifi_RenderableCanvasEntityItem_h
11 #define hifi_RenderableCanvasEntityItem_h
12 
13 #include "RenderableEntityItem.h"
14 #include <CanvasEntityItem.h>
15 #include <procedural/Procedural.h>
16 
17 namespace render { namespace entities {
18 
19 class CanvasEntityRenderer : public TypedEntityRenderer<CanvasEntityItem> {
20  Q_OBJECT
21  using Parent = TypedEntityRenderer<CanvasEntityItem>;
22  friend class EntityRenderer;
23 
24 public:
25  CanvasEntityRenderer(const EntityItemPointer& entity);
26  ~CanvasEntityRenderer();
27 
28  gpu::TexturePointer getTexture() override { return _texture; }
29 
30  ComponentMode getFadeOutMode() const override { return ComponentMode::COMPONENT_MODE_DISABLED; }
31 
32 protected:
33  virtual void doRender(RenderArgs* args) override;
34  virtual bool isTransparent() const override;
35 
36  virtual void doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) override;
37  virtual void doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) override;
38 
39  Item::Bound getBound(RenderArgs* args) override;
40  ShapeKey getShapeKey() override;
41 
42 private:
43  gpu::TexturePointer _texture;
44  int _geometryId { 0 };
45  bool _unlit { false };
46  bool _transparent { false };
47  PulsePropertyGroup _pulseProperties;
48 
49  std::shared_ptr<graphics::ProceduralMaterial> _material { std::make_shared<graphics::ProceduralMaterial>() };
50 };
51 
52 } }
53 
54 #endif // hifi_RenderableCanvasEntityItem_h
Definition: Args.h:100