Offscreen render target (RGBA8Unorm color, optional Depth32Float). 2D batches are flushed into the canvas texture by Graphics::flush2DToCanvas. 更多...
#include <Canvas.h>
Public 成员函数 | |
| OffscreenCanvas (Graphics *gfx, int width, int height) | |
| ~OffscreenCanvas () override | |
| int | getWidth () const override |
| int | getHeight () const override |
| Texture * | getTexture () override |
| Sampleable color buffer; screen Canvas returns nullptr. | |
| void | clear (std::optional< Color > color, std::optional< int > stencil, std::optional< double > depth) override |
| Color | getPixel (int x, int y) override |
| image::ImageData * | newImageData () override |
| void | draw (Canvas *, const glm::mat4 &) const override |
| void | draw (eve::graphics::Graphics *, const glm::mat4 &) const override |
| Draws the object with the specified transformation matrix. | |
Public 成员函数 继承自 eve::graphics::Canvas | |
| Canvas () | |
| ~Canvas () override | |
Public 成员函数 继承自 eve::graphics::Drawable | |
| virtual | ~Drawable () |
| bool | getCastOcclusion () const |
| When false, skipped by Graphics::drawOcclusion / volumetric occluder passes. | |
| void | setCastOcclusion (bool cast) |
| virtual void | drawOcclusion (Graphics *gfx, const glm::mat4 &matrix) const |
| Draw as an opaque black silhouette for volumetric occlusion maps (screen-space god rays / light shafts). Default is a no-op; Texture / Mesh override with 2D black rects (alpha preserved for textures). | |
Public 属性 | |
| bool | clearRequested = false |
| Color | clearColor {0.f, 0.f, 0.f, 1.f} |
友元 | |
| class | Graphics |
详细描述
Offscreen render target (RGBA8Unorm color, optional Depth32Float). 2D batches are flushed into the canvas texture by Graphics::flush2DToCanvas.
构造及析构函数说明
◆ OffscreenCanvas()
| eve::graphics::webgpu::OffscreenCanvas::OffscreenCanvas | ( | Graphics * | gfx, |
| int | width, | ||
| int | height | ||
| ) |
在文件 Canvas.cpp 第 17 行定义.
引用了 device, eve::graphics::webgpu::Graphics::getDevice(), eve::graphics::Texture::gpuHandle, height, eve::graphics::Texture::height, eve::graphics::webgpu::GpuTexture::height, eve::graphics::TextureSampler::linearMipmap(), eve::graphics::Texture::mipmapCount, eve::graphics::webgpu::GpuTexture::sampler, eve::graphics::webgpu::GpuTexture::samplerState, eve::graphics::webgpu::GpuTexture::texture, eve::graphics::webgpu::GpuTexture::view, eve::graphics::Texture::width, eve::graphics::webgpu::GpuTexture::width , 以及 width.
◆ ~OffscreenCanvas()
|
overridedefault |
成员函数说明
◆ clear()
|
overridevirtual |
◆ draw() [1/2]
|
inlineoverridevirtual |
◆ draw() [2/2]
|
inlineoverridevirtual |
Draws the object with the specified transformation matrix.
◆ getHeight()
|
inlineoverridevirtual |
◆ getPixel()
|
overridevirtual |
在文件 Canvas.cpp 第 75 行定义.
引用了 eve::graphics::webgpu::Graphics::getPixelImpl(), x , 以及 y.
◆ getTexture()
|
inlineoverridevirtual |
Sampleable color buffer; screen Canvas returns nullptr.
◆ getWidth()
|
inlineoverridevirtual |
◆ newImageData()
|
overridevirtual |
Full RGBA8 copy; caller owns ImageData*.
在文件 Canvas.cpp 第 79 行定义.
友元及相关函数文档
◆ Graphics
类成员变量说明
◆ clearColor
被这些函数引用 clear() , 以及 eve::graphics::webgpu::Graphics::flush2DToCanvas().
◆ clearRequested
| bool eve::graphics::webgpu::OffscreenCanvas::clearRequested = false |
被这些函数引用 clear() , 以及 eve::graphics::webgpu::Graphics::flush2DToCanvas().
该类的文档由以下文件生成:
- src/modules/graphics/webgpu/Canvas.h
- src/modules/graphics/webgpu/Canvas.cpp
Public 成员函数 继承自