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 | ||
| ) |
◆ ~PixelWorldAtlasRenderer()
|
default |
Pixel world atlas renderer.
◆ PixelWorldAtlasRenderer() [2/3]
|
defaultnoexcept |
Pixel world atlas renderer.
◆ PixelWorldAtlasRenderer() [3/3]
|
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.
- 参数
-
world Borrowed authoritative world for this call only. graphics Borrowed render-thread graphics service for this call only. scale Screen 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()
|
noexcept |
Height.
在文件 PixelWorldGraphics.cpp 第 208 行定义.
被这些函数引用 drawDiagnostics() , 以及 PixelWorldAtlasRenderer().
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
defaultnoexcept |
Operator =.
◆ originX()
|
noexcept |
◆ originY()
|
noexcept |
◆ renderedRevision()
|
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
worldandgraphicsremain 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()
|
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()
|
noexcept |
Total uploaded chunks.
在文件 PixelWorldGraphics.cpp 第 210 行定义.
◆ uploadCount()
|
noexcept |
Uploads count.
在文件 PixelWorldGraphics.cpp 第 211 行定义.
◆ width()
|
noexcept |
该类的文档由以下文件生成:
- src/modules/pixelworld/graphics/PixelWorldGraphics.h
- src/modules/pixelworld/graphics/PixelWorldGraphics.cpp