载入中...
搜索中...
未找到
eve::graphics::IGraphics2D类 参考abstract

2D immediate-mode drawing surface (screen or offscreen Canvas). 更多...

#include <IGraphics2D.h>

类 eve::graphics::IGraphics2D 继承关系图:
eve::graphics::Graphics eve::graphics::vulkan::Graphics eve::graphics::webgpu::Graphics

Public 成员函数

virtual ~IGraphics2D ()=default
 Releases IGraphics2D resources.
 
virtual void clearScreen ()=0
 Clears the current draw target to the background color.
 
virtual void setBackgroundColorRGBA (float r, float g, float b, float a=1.f)=0
 Sets the background color rgba.
 
virtual void drawSolidRectRGBA (float x, float y, float w, float h, float r, float g, float b, float a=1.f)=0
 Draws solid rect rgba.
 
virtual void drawTexturedRectRGBA (Texture *texture, float x, float y, float w, float h, float r, float g, float b, float a=1.f)=0
 Draws textured rect rgba.
 
virtual void drawSolidRect (float x, float y, float w, float h, const Color &color, BlendMode blend=BlendMode::Alpha)=0
 Draws solid rect.
 
virtual void drawSolidRectRotated (float cx, float cy, float w, float h, float degrees, const Color &color, BlendMode blend=BlendMode::Alpha)=0
 Draws solid rect rotated.
 
virtual void drawPrimitiveCanvas (const PrimitiveCanvas2D &canvas)=0
 Resolves and queues one frame-local primitive Canvas.
 
virtual void drawTexturedRect (Texture *texture, float x, float y, float w, float h, const Color &color)=0
 Draws textured rect.
 
virtual void drawTexturedRectShader (Texture *texture, Shader *shader, float x, float y, float w, float h, const Color &color)=0
 Draws textured rect shader.
 
virtual void drawTexturedRectUV (Texture *texture, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const Color &color)=0
 Draws textured rect uv.
 
virtual void drawTexturedRectShaderUV (Texture *texture, Shader *shader, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const Color &color, bool rotatedUV=false, BlendMode blend=BlendMode::Alpha)=0
 Draws textured rect shader uv.
 
virtual void drawTexturedRectShaderUVRotated (Texture *texture, Shader *shader, float cx, float cy, float w, float h, float degrees, float u0, float v0, float u1, float v1, const Color &color, bool rotatedUV=false, BlendMode blend=BlendMode::Alpha)=0
 Draws textured rect shader uv rotated.
 
virtual void drawTexturedRectShaderDepth (Texture *color, Texture *depth, Shader *shader, float x, float y, float w, float h, const Color &tint)=0
 Draws textured rect shader depth.
 
virtual void drawTexturedRectLitUV (Texture *albedo, Texture *normal, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const Color &color, BlendMode blend=BlendMode::Alpha)=0
 Lit 2D draw (albedo + normal map); normal may be null → flat.
 
virtual void drawTexturedRectLitUVRotated (Texture *albedo, Texture *normal, float cx, float cy, float w, float h, float degrees, float u0, float v0, float u1, float v1, const Color &color, BlendMode blend=BlendMode::Alpha)=0
 Lit 2D draw rotated degrees clockwise (screen Y-down) around (cx, cy).
 
virtual void setLighting2D (const Lighting2DUBO &ubo)=0
 Upload per-frame / per-canvas 2D lighting constants.
 
virtual void setCanvas (Canvas *canvas)=0
 Draw target; nullptr → screen.
 
virtual bool isCanvasActive () const =0
 True when canvas active.
 
virtual Canvas * getCanvas () const =0
 Returns the canvas.
 
virtual void setShader (Shader *shader)=0
 Custom fragment pipeline for subsequent textured 2D draws.
 
virtual void setShader ()=0
 Sets the shader.
 
virtual Shader * getShader () const =0
 Returns the shader.
 
virtual void setFont (Font *font)=0
 Optional shared font used by legacy consumers; nullptr = none set.
 
virtual Font * getFont () const =0
 Returns the font.
 
virtual void print (const std::string &text, float x, float y, const Color &color=Color(1.f, 1.f, 1.f, 1.f), float scale=1.f)=0
 Draws UTF-8 text with the font selected by setFont().
 
virtual void drawText (Font *font, const std::string &text, float x, float y, const Color &color=Color(1.f, 1.f, 1.f, 1.f), float scale=1.f)=0
 Draws UTF-8 text with an explicitly supplied GPU font.
 
virtual void draw (Drawable *drawable, const glm::mat4 &m)=0
 Draws .
 
virtual void drawOcclusion (Drawable *drawable, const glm::mat4 &m)=0
 Draws occlusion.
 
virtual void drawOcclusionSolid (float x, float y, float w, float h)=0
 Draws occlusion solid.
 
virtual void drawOcclusionTexture (Texture *texture, float x, float y, float w, float h)=0
 Draws occlusion texture.
 
virtual void pushValidationScope ()=0
 Backend GPU validation scopes (WebGPU).
 
virtual void popValidationScope ()=0
 Pops validation scope.
 

详细描述

2D immediate-mode drawing surface (screen or offscreen Canvas).

在文件 IGraphics2D.h 第 33 行定义.

构造及析构函数说明

◆ ~IGraphics2D()

virtual eve::graphics::IGraphics2D::~IGraphics2D ( )
virtualdefault

Releases IGraphics2D resources.

成员函数说明

◆ clearScreen()

virtual void eve::graphics::IGraphics2D::clearScreen ( )
pure virtual

Clears the current draw target to the background color.

在 eve::graphics::Graphics 内被实现.

◆ draw()

virtual void eve::graphics::IGraphics2D::draw ( Drawable *  drawable,
const glm::mat4 &  m 
)
pure virtual

Draws .

在 eve::graphics::Graphics 内被实现.

◆ drawOcclusion()

virtual void eve::graphics::IGraphics2D::drawOcclusion ( Drawable *  drawable,
const glm::mat4 &  m 
)
pure virtual

Draws occlusion.

在 eve::graphics::Graphics 内被实现.

◆ drawOcclusionSolid()

virtual void eve::graphics::IGraphics2D::drawOcclusionSolid ( float  x,
float  y,
float  w,
float  h 
)
pure virtual

Draws occlusion solid.

在 eve::graphics::Graphics 内被实现.

◆ drawOcclusionTexture()

virtual void eve::graphics::IGraphics2D::drawOcclusionTexture ( Texture *  texture,
float  x,
float  y,
float  w,
float  h 
)
pure virtual

Draws occlusion texture.

在 eve::graphics::Graphics 内被实现.

◆ drawPrimitiveCanvas()

virtual void eve::graphics::IGraphics2D::drawPrimitiveCanvas ( const PrimitiveCanvas2D &  canvas)
pure virtual

Resolves and queues one frame-local primitive Canvas.

参数
canvasBorrowed recorder consumed synchronously and never retained.
注解
Render-thread affine; invokes no callbacks.

在 eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

被这些函数引用 eve::physics::World::drawDebug().

◆ drawSolidRect()

virtual void eve::graphics::IGraphics2D::drawSolidRect ( float  x,
float  y,
float  w,
float  h,
const Color &  color,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

◆ drawSolidRectRGBA()

virtual void eve::graphics::IGraphics2D::drawSolidRectRGBA ( float  x,
float  y,
float  w,
float  h,
float  r,
float  g,
float  b,
float  a = 1.f 
)
pure virtual

Draws solid rect rgba.

在 eve::graphics::Graphics 内被实现.

◆ drawSolidRectRotated()

virtual void eve::graphics::IGraphics2D::drawSolidRectRotated ( float  cx,
float  cy,
float  w,
float  h,
float  degrees,
const Color &  color,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

Draws solid rect rotated.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ drawText()

virtual void eve::graphics::IGraphics2D::drawText ( Font *  font,
const std::string &  text,
float  x,
float  y,
const Color &  color = Color(1.f, 1.f, 1.f, 1.f),
float  scale = 1.f 
)
pure virtual

Draws UTF-8 text with an explicitly supplied GPU font.

参数
fontBorrowed non-null font belonging to this graphics backend; it is not retained beyond the call.
textBorrowed UTF-8 text retained only for this call.
xLeft edge in the current canvas coordinate space.
yTop edge in the current canvas coordinate space.
colorGlyph tint and opacity.
scaleUniform text scale.
异常
eve::Exceptionif font is nullptr.
注解
Render-thread only. The call is synchronous and invokes no callbacks.

在 eve::graphics::Graphics 内被实现.

◆ drawTexturedRect()

virtual void eve::graphics::IGraphics2D::drawTexturedRect ( Texture *  texture,
float  x,
float  y,
float  w,
float  h,
const Color &  color 
)
pure virtual

◆ drawTexturedRectLitUV()

virtual void eve::graphics::IGraphics2D::drawTexturedRectLitUV ( Texture *  albedo,
Texture *  normal,
float  x,
float  y,
float  w,
float  h,
float  u0,
float  v0,
float  u1,
float  v1,
const Color &  color,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

Lit 2D draw (albedo + normal map); normal may be null → flat.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ drawTexturedRectLitUVRotated()

virtual void eve::graphics::IGraphics2D::drawTexturedRectLitUVRotated ( Texture *  albedo,
Texture *  normal,
float  cx,
float  cy,
float  w,
float  h,
float  degrees,
float  u0,
float  v0,
float  u1,
float  v1,
const Color &  color,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

Lit 2D draw rotated degrees clockwise (screen Y-down) around (cx, cy).

参数
albedoBorrowed albedo texture; nullptr draws a solid tinted rect.
normalBorrowed tangent-space normal map; nullptr uses a flat +Z map.
blendCompositing mode; matches the non-lit textured 2D path.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ drawTexturedRectRGBA()

virtual void eve::graphics::IGraphics2D::drawTexturedRectRGBA ( Texture *  texture,
float  x,
float  y,
float  w,
float  h,
float  r,
float  g,
float  b,
float  a = 1.f 
)
pure virtual

Draws textured rect rgba.

在 eve::graphics::Graphics 内被实现.

◆ drawTexturedRectShader()

virtual void eve::graphics::IGraphics2D::drawTexturedRectShader ( Texture *  texture,
Shader *  shader,
float  x,
float  y,
float  w,
float  h,
const Color &  color 
)
pure virtual

Draws textured rect shader.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ drawTexturedRectShaderDepth()

virtual void eve::graphics::IGraphics2D::drawTexturedRectShaderDepth ( Texture *  color,
Texture *  depth,
Shader *  shader,
float  x,
float  y,
float  w,
float  h,
const Color &  tint 
)
pure virtual

Draws textured rect shader depth.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ drawTexturedRectShaderUV()

virtual void eve::graphics::IGraphics2D::drawTexturedRectShaderUV ( Texture *  texture,
Shader *  shader,
float  x,
float  y,
float  w,
float  h,
float  u0,
float  v0,
float  u1,
float  v1,
const Color &  color,
bool  rotatedUV = false,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

Draws textured rect shader uv.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ drawTexturedRectShaderUVRotated()

virtual void eve::graphics::IGraphics2D::drawTexturedRectShaderUVRotated ( Texture *  texture,
Shader *  shader,
float  cx,
float  cy,
float  w,
float  h,
float  degrees,
float  u0,
float  v0,
float  u1,
float  v1,
const Color &  color,
bool  rotatedUV = false,
BlendMode  blend = BlendMode::Alpha 
)
pure virtual

Draws textured rect shader uv rotated.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ drawTexturedRectUV()

virtual void eve::graphics::IGraphics2D::drawTexturedRectUV ( Texture *  texture,
float  x,
float  y,
float  w,
float  h,
float  u0,
float  v0,
float  u1,
float  v1,
const Color &  color 
)
pure virtual

◆ getCanvas()

virtual Canvas * eve::graphics::IGraphics2D::getCanvas ( ) const
pure virtual

◆ getFont()

virtual Font * eve::graphics::IGraphics2D::getFont ( ) const
pure virtual

Returns the font.

在 eve::graphics::Graphics 内被实现.

◆ getShader()

virtual Shader * eve::graphics::IGraphics2D::getShader ( ) const
pure virtual

Returns the shader.

在 eve::graphics::Graphics 内被实现.

◆ isCanvasActive()

virtual bool eve::graphics::IGraphics2D::isCanvasActive ( ) const
pure virtual

True when canvas active.

在 eve::graphics::Graphics, eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.

◆ popValidationScope()

virtual void eve::graphics::IGraphics2D::popValidationScope ( )
pure virtual

◆ print()

virtual void eve::graphics::IGraphics2D::print ( const std::string &  text,
float  x,
float  y,
const Color &  color = Color(1.f, 1.f, 1.f, 1.f),
float  scale = 1.f 
)
pure virtual

Draws UTF-8 text with the font selected by setFont().

参数
textBorrowed UTF-8 text retained only for this call.
xLeft edge in the current canvas coordinate space.
yTop edge in the current canvas coordinate space.
colorGlyph tint and opacity.
scaleUniform text scale.
异常
eve::Exceptionif no current font has been selected.
注解
Render-thread only. The call is synchronous and invokes no callbacks.

在 eve::graphics::Graphics 内被实现.

◆ pushValidationScope()

virtual void eve::graphics::IGraphics2D::pushValidationScope ( )
pure virtual

Backend GPU validation scopes (WebGPU).

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ setBackgroundColorRGBA()

virtual void eve::graphics::IGraphics2D::setBackgroundColorRGBA ( float  r,
float  g,
float  b,
float  a = 1.f 
)
pure virtual

Sets the background color rgba.

在 eve::graphics::Graphics 内被实现.

◆ setCanvas()

virtual void eve::graphics::IGraphics2D::setCanvas ( Canvas *  canvas)
pure virtual

Draw target; nullptr → screen.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ setFont()

virtual void eve::graphics::IGraphics2D::setFont ( Font *  font)
pure virtual

Optional shared font used by legacy consumers; nullptr = none set.

在 eve::graphics::Graphics 内被实现.

◆ setLighting2D()

virtual void eve::graphics::IGraphics2D::setLighting2D ( const Lighting2DUBO &  ubo)
pure virtual

Upload per-frame / per-canvas 2D lighting constants.

在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.

◆ setShader() [1/2]

virtual void eve::graphics::IGraphics2D::setShader ( )
pure virtual

Sets the shader.

在 eve::graphics::Graphics 内被实现.

◆ setShader() [2/2]

virtual void eve::graphics::IGraphics2D::setShader ( Shader *  shader)
pure virtual

Custom fragment pipeline for subsequent textured 2D draws.

在 eve::graphics::Graphics 内被实现.


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