cesium-native  0.41.0
IPrepareRendererResources.h
1 #pragma once
2 
3 #include "Library.h"
4 #include "TileLoadResult.h"
5 
6 #include <CesiumAsync/Future.h>
7 #include <CesiumRasterOverlays/IPrepareRasterOverlayRendererResources.h>
8 
9 #include <glm/vec2.hpp>
10 #include <gsl/span>
11 
12 #include <any>
13 
14 namespace CesiumAsync {
15 class AsyncSystem;
16 }
17 
18 namespace CesiumGeometry {
19 struct Rectangle;
20 }
21 
22 namespace CesiumGltf {
23 struct Model;
24 } // namespace CesiumGltf
25 
27 class RasterOverlayTile;
28 }
29 
30 namespace Cesium3DTilesSelection {
31 
32 class Tile;
33 
35  TileLoadResult result;
36  void* pRenderResources{nullptr};
37 };
38 
51 class CESIUM3DTILESSELECTION_API IPrepareRendererResources
53 public:
54  virtual ~IPrepareRendererResources() = default;
55 
73  const CesiumAsync::AsyncSystem& asyncSystem,
74  TileLoadResult&& tileLoadResult,
75  const glm::dmat4& transform,
76  const std::any& rendererOptions) = 0;
77 
94  virtual void* prepareInMainThread(Tile& tile, void* pLoadThreadResult) = 0;
95 
110  virtual void free(
111  Tile& tile,
112  void* pLoadThreadResult,
113  void* pMainThreadResult) noexcept = 0;
114 
136  const Tile& tile,
137  int32_t overlayTextureCoordinateID,
138  const CesiumRasterOverlays::RasterOverlayTile& rasterTile,
139  void* pMainThreadRendererResources,
140  const glm::dvec2& translation,
141  const glm::dvec2& scale) = 0;
142 
154  const Tile& tile,
155  int32_t overlayTextureCoordinateID,
156  const CesiumRasterOverlays::RasterOverlayTile& rasterTile,
157  void* pMainThreadRendererResources) noexcept = 0;
158 };
159 
160 } // namespace Cesium3DTilesSelection
When implemented for a rendering engine, allows renderer resources to be created and destroyed under ...
virtual void detachRasterInMainThread(const Tile &tile, int32_t overlayTextureCoordinateID, const CesiumRasterOverlays::RasterOverlayTile &rasterTile, void *pMainThreadRendererResources) noexcept=0
Detaches a raster overlay tile from a geometry tile.
virtual void free(Tile &tile, void *pLoadThreadResult, void *pMainThreadResult) noexcept=0
Frees previously-prepared renderer resources.
virtual void * prepareInMainThread(Tile &tile, void *pLoadThreadResult)=0
Further prepares renderer resources.
virtual void attachRasterInMainThread(const Tile &tile, int32_t overlayTextureCoordinateID, const CesiumRasterOverlays::RasterOverlayTile &rasterTile, void *pMainThreadRendererResources, const glm::dvec2 &translation, const glm::dvec2 &scale)=0
Attaches a raster overlay tile to a geometry tile.
virtual CesiumAsync::Future< TileLoadResultAndRenderResources > prepareInLoadThread(const CesiumAsync::AsyncSystem &asyncSystem, TileLoadResult &&tileLoadResult, const glm::dmat4 &transform, const std::any &rendererOptions)=0
Prepares renderer resources for the given tile. This method is invoked in the load thread.
A tile in a Tileset.
Definition: Tile.h:97
A system for managing asynchronous requests and tasks.
Definition: AsyncSystem.h:36
A value that will be available in the future, as produced by AsyncSystem.
Definition: Future.h:29
Raster image data for a tile in a quadtree.
Classes that implement the 3D Tiles standard.
Classes that support asynchronous operations.
Basic geometry classes for Cesium.
Classes for working with glTF models.
Classes for raster overlays, which allow draping massive 2D textures over a model.
Store the result of loading a tile content after invoking TilesetContentLoader::loadTileContent.
A 2D rectangle.
Definition: Rectangle.h:14
The root object for a glTF asset.
Definition: Model.h:14