cesium-native 0.43.0
Loading...
Searching...
No Matches
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
11#include <any>
12#include <span>
13
14namespace CesiumAsync {
15class AsyncSystem;
16}
17
18namespace CesiumGeometry {
19struct Rectangle;
20}
21
22namespace CesiumGltf {
23struct Model;
24} // namespace CesiumGltf
25
28}
29
30namespace Cesium3DTilesSelection {
31
32class Tile;
33
56
68class CESIUM3DTILESSELECTION_API IPrepareRendererResources
70public:
71 virtual ~IPrepareRendererResources() = default;
72
90 const CesiumAsync::AsyncSystem& asyncSystem,
91 TileLoadResult&& tileLoadResult,
92 const glm::dmat4& transform,
93 const std::any& rendererOptions) = 0;
94
111 virtual void* prepareInMainThread(Tile& tile, void* pLoadThreadResult) = 0;
112
127 virtual void free(
128 Tile& tile,
129 void* pLoadThreadResult,
130 void* pMainThreadResult) noexcept = 0;
131
153 const Tile& tile,
154 int32_t overlayTextureCoordinateID,
156 void* pMainThreadRendererResources,
157 const glm::dvec2& translation,
158 const glm::dvec2& scale) = 0;
159
171 const Tile& tile,
172 int32_t overlayTextureCoordinateID,
174 void* pMainThreadRendererResources) noexcept = 0;
175};
176
177} // 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 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 void * prepareInMainThread(Tile &tile, void *pLoadThreadResult)=0
Further prepares renderer resources.
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 Promise.h:11
An interface between Cesium Native and the application using it, allowing Cesium Native to pass loade...
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.
TileLoadResult result
The TileLoadResult passed to prepareInLoadThread in the first place.
void * pRenderResources
A pointer to the render resources for this tile.
Store the result of loading a tile content after invoking TilesetContentLoader::loadTileContent.