Rise
The Vieneo Province
Loading...
Searching...
No Matches
CityCampaignLogos.h
Go to the documentation of this file.
1#pragma once
3#include <functional>
5
6namespace Rendering { class RenderDevice; class RenderTexture; }
8{
9public:
10 explicit CityCampaignLogos(const std::function<void(const char*)>& trace = {});
12 bool Assign(int32_t group, const char* filename, size_t capacity);
13 // Called once in FrameMove. Only artwork drawn since the last update advances.
14 void Update(Rendering::RenderDevice* device, uint64_t now,
15 const std::function<void(const CityLogos::AssignmentAsset&)>& send, bool measure=false);
16 // Copies a correlated transfer into the bounded worker queue. Texture stays
17 // null until Update consumes its first decoded frame; errors schedule retry.
18 bool Receive(Rendering::RenderDevice* device, int32_t token, const void* bytes, size_t size, uint64_t now);
19 Rendering::RenderTexture* Texture(int32_t group) const;
20 // Call only after the sign passes render culling. Texture lookup alone must
21 // not wake animations for off-screen batches whose materials are still bound.
22 void MarkDrawn(int32_t group) const;
24 {
25 const std::string* filename=nullptr;
27 std::weak_ptr<void> lifetime;
28 uint64_t hash=0;
29 unsigned frame=0, frameCount=0;
31 };
32 Measurement Measure(int32_t group) const;
33 bool HasAnimatedArtwork() const;
34 void Reset();
35private:
36 class Impl;
37 std::unique_ptr<Impl> impl;
38};
bool Receive(Rendering::RenderDevice *device, int32_t token, const void *bytes, size_t size, uint64_t now)
Rendering::RenderTexture * Texture(int32_t group) const
bool Assign(int32_t group, const char *filename, size_t capacity)
std::unique_ptr< Impl > impl
bool HasAnimatedArtwork() const
void Update(Rendering::RenderDevice *device, uint64_t now, const std::function< void(const CityLogos::AssignmentAsset &)> &send, bool measure=false)
void MarkDrawn(int32_t group) const
CityCampaignLogos(const std::function< void(const char *)> &trace={})
Measurement Measure(int32_t group) const
Rendering::AnimatedAdMetadata::Summary average
const Rendering::AdCreativeMetadata * metadata