载入中...
搜索中...
未找到
eve::pixelworld_graphics::PixelWorldAtlasRenderer类 参考

Render-thread-affine RGBA atlas projection of a rectangular PixelWorld region. @ownership The renderer owns only its CPU atlas; Graphics owns the Texture handle. @lifetime A renderer using a texture must be destroyed before its Graphics backend. 更多...

#include <PixelWorldGraphics.h>

类

struct  Impl
 

Public 成员函数

 PixelWorldAtlasRenderer (int originX, int originY, int width, int height)
 Create a transparent atlas for [origin, origin + size). Throws on invalid size.
 
 ~PixelWorldAtlasRenderer ()
 Pixel world atlas renderer.
 
 PixelWorldAtlasRenderer (PixelWorldAtlasRenderer &&) noexcept
 Pixel world atlas renderer.
 
PixelWorldAtlasRenderer & operator= (PixelWorldAtlasRenderer &&) noexcept
 Operator =.
 
 PixelWorldAtlasRenderer (const PixelWorldAtlasRenderer &)=delete
 
PixelWorldAtlasRenderer & operator= (const PixelWorldAtlasRenderer &)=delete
 
int sync (pixelworld::PixelWorld *world, graphics::Graphics *graphics)
 Patch changed CPU chunks and upload the atlas when its world revision advances.
 
int drawDiagnostics (pixelworld::PixelWorld *world, graphics::Graphics *graphics, float scale)
 Draw Chunk activity/temperature outlines and a bounded step-time graph.
 
graphics::Texture * texture () const noexcept
 Borrow the stable backend-owned atlas texture, or null before first sync. @ownership Graphics owns the returned pointer; callers must not delete it. @lifetime Valid until the originating Graphics releases textures or is destroyed.
 
int originX () const noexcept
 Origin x.
 
int originY () const noexcept
 Origin y.
 
int width () const noexcept
 Width.
 
int height () const noexcept
 Height.
 
std::uint64_t renderedRevision () const noexcept
 Rendered revision.
 
std::uint64_t totalUploadedChunks () const noexcept
 Total uploaded chunks.
 
std::uint64_t uploadCount () const noexcept
 Uploads count.
 

详细描述

Render-thread-affine RGBA atlas projection of a rectangular PixelWorld region. @ownership The renderer owns only its CPU atlas; Graphics owns the Texture handle. @lifetime A renderer using a texture must be destroyed before its Graphics backend.

The renderer never owns or retains the PixelWorld/Graphics arguments supplied to sync(). Its Texture is a borrowed backend-owned handle and must not outlive Graphics. The CPU atlas is authoritative only for presentation and is rebuilt after world revision rollback (clear/restore); gameplay continues to read PixelWorld itself.

在文件 PixelWorldGraphics.h 第 29 行定义.

构造及析构函数说明

◆ PixelWorldAtlasRenderer() [1/3]

eve::pixelworld_graphics::PixelWorldAtlasRenderer::PixelWorldAtlasRenderer ( int  originX,
int  originY,
int  width,
int  height 
)

Create a transparent atlas for [origin, origin + size). Throws on invalid size.

在文件 PixelWorldGraphics.cpp 第 44 行定义.

引用了 height(), originX(), originY() , 以及 width().

◆ ~PixelWorldAtlasRenderer()

eve::pixelworld_graphics::PixelWorldAtlasRenderer::~PixelWorldAtlasRenderer ( )
default

Pixel world atlas renderer.

◆ PixelWorldAtlasRenderer() [2/3]

eve::pixelworld_graphics::PixelWorldAtlasRenderer::PixelWorldAtlasRenderer ( PixelWorldAtlasRenderer &&  )
defaultnoexcept

Pixel world atlas renderer.

◆ PixelWorldAtlasRenderer() [3/3]

eve::pixelworld_graphics::PixelWorldAtlasRenderer::PixelWorldAtlasRenderer ( const PixelWorldAtlasRenderer &  )
delete

成员函数说明

◆ drawDiagnostics()

int eve::pixelworld_graphics::PixelWorldAtlasRenderer::drawDiagnostics ( pixelworld::PixelWorld *  world,
graphics::Graphics *  graphics,
float  scale 
)

Draw Chunk activity/temperature outlines and a bounded step-time graph.

参数
worldBorrowed authoritative world for this call only.
graphicsBorrowed render-thread graphics service for this call only.
scaleScreen pixels per simulated cell; must be positive.
返回
Number of allocated Chunk diagnostics drawn.

在文件 PixelWorldGraphics.cpp 第 143 行定义.

引用了 eve::graphics::Graphics::drawSolidRectRGBA(), height(), index, eve::pixelworld::kPixelChunkSize, maximum, eve::pixelworld::PixelWorldControlService::performanceSamples(), eve::pixelworld::pixelWorldControlService(), scale, size, visible, world, x , 以及 y.

◆ height()

int eve::pixelworld_graphics::PixelWorldAtlasRenderer::height ( ) const
noexcept

Height.

在文件 PixelWorldGraphics.cpp 第 208 行定义.

被这些函数引用 drawDiagnostics() , 以及 PixelWorldAtlasRenderer().

◆ operator=() [1/2]

PixelWorldAtlasRenderer & eve::pixelworld_graphics::PixelWorldAtlasRenderer::operator= ( const PixelWorldAtlasRenderer &  )
delete

◆ operator=() [2/2]

PixelWorldAtlasRenderer & eve::pixelworld_graphics::PixelWorldAtlasRenderer::operator= ( PixelWorldAtlasRenderer &&  )
defaultnoexcept

Operator =.

◆ originX()

int eve::pixelworld_graphics::PixelWorldAtlasRenderer::originX ( ) const
noexcept

Origin x.

在文件 PixelWorldGraphics.cpp 第 205 行定义.

被这些函数引用 PixelWorldAtlasRenderer().

◆ originY()

int eve::pixelworld_graphics::PixelWorldAtlasRenderer::originY ( ) const
noexcept

Origin y.

在文件 PixelWorldGraphics.cpp 第 206 行定义.

被这些函数引用 PixelWorldAtlasRenderer().

◆ renderedRevision()

std::uint64_t eve::pixelworld_graphics::PixelWorldAtlasRenderer::renderedRevision ( ) const
noexcept

Rendered revision.

在文件 PixelWorldGraphics.cpp 第 209 行定义.

◆ sync()

int eve::pixelworld_graphics::PixelWorldAtlasRenderer::sync ( pixelworld::PixelWorld *  world,
graphics::Graphics *  graphics 
)

Patch changed CPU chunks and upload the atlas when its world revision advances.

返回
Number of changed chunks patched; zero means no GPU upload was issued.
备注
Must run on the render thread. The arguments are borrowed for this call only. @ownership world and graphics remain owned by their callers and are never retained. @lifetime Both arguments need only remain valid for the duration of this call.

在文件 PixelWorldGraphics.cpp 第 59 行定义.

引用了 color, height, eve::pixelworld::kPixelChunkSize, offset, uploads, width, world, x , 以及 y.

◆ texture()

graphics::Texture * eve::pixelworld_graphics::PixelWorldAtlasRenderer::texture ( ) const
noexcept

Borrow the stable backend-owned atlas texture, or null before first sync. @ownership Graphics owns the returned pointer; callers must not delete it. @lifetime Valid until the originating Graphics releases textures or is destroyed.

在文件 PixelWorldGraphics.cpp 第 204 行定义.

◆ totalUploadedChunks()

std::uint64_t eve::pixelworld_graphics::PixelWorldAtlasRenderer::totalUploadedChunks ( ) const
noexcept

Total uploaded chunks.

在文件 PixelWorldGraphics.cpp 第 210 行定义.

◆ uploadCount()

std::uint64_t eve::pixelworld_graphics::PixelWorldAtlasRenderer::uploadCount ( ) const
noexcept

Uploads count.

在文件 PixelWorldGraphics.cpp 第 211 行定义.

◆ width()

int eve::pixelworld_graphics::PixelWorldAtlasRenderer::width ( ) const
noexcept

Width.

在文件 PixelWorldGraphics.cpp 第 207 行定义.

被这些函数引用 PixelWorldAtlasRenderer().


该类的文档由以下文件生成: