载入中...
搜索中...
未找到
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
 
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
 
virtual void drawSolidRectRGBA (float x, float y, float w, float h, float r, float g, float b, float a=1.f)=0
 
virtual void drawTexturedRectRGBA (Texture *texture, float x, float y, float w, float h, float r, float g, float b, float a=1.f)=0
 
virtual void drawSolidRect (float x, float y, float w, float h, const Color &color, BlendMode blend=BlendMode::Alpha)=0
 
virtual void drawSolidRectRotated (float cx, float cy, float w, float h, float degrees, const Color &color, BlendMode blend=BlendMode::Alpha)=0
 
virtual void drawTexturedRect (Texture *texture, float x, float y, float w, float h, const Color &color)=0
 
virtual void drawTexturedRectShader (Texture *texture, Shader *shader, float x, float y, float w, float h, const Color &color)=0
 
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
 
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
 
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
 
virtual void drawTexturedRectShaderDepth (Texture *color, Texture *depth, Shader *shader, float x, float y, float w, float h, const Color &tint)=0
 
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)=0
 Lit 2D draw (albedo + normal map); normal may be null → flat.
 
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
 
virtual CanvasgetCanvas () const =0
 
virtual void setShader (Shader *shader)=0
 Custom fragment pipeline for subsequent textured 2D draws.
 
virtual void setShader ()=0
 
virtual ShadergetShader () const =0
 
virtual void setFont (Font *font)=0
 Font used by print(); nullptr = none set.
 
virtual FontgetFont () const =0
 
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 current font (throws when unset).
 
virtual void draw (Drawable *drawable, const glm::mat4 &m)=0
 
virtual void drawOcclusion (Drawable *drawable, const glm::mat4 &m)=0
 
virtual void drawOcclusionSolid (float x, float y, float w, float h)=0
 
virtual void drawOcclusionTexture (Texture *texture, float x, float y, float w, float h)=0
 
virtual void pushValidationScope ()=0
 Backend GPU validation scopes (WebGPU).
 
virtual void popValidationScope ()=0
 

详细描述

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

在文件 IGraphics2D.h32 行定义.

构造及析构函数说明

◆ ~IGraphics2D()

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

成员函数说明

◆ 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

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

◆ drawOcclusion()

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

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

◆ drawOcclusionSolid()

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

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

◆ drawOcclusionTexture()

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

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

◆ 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

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

◆ 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 
)
pure virtual

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

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

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

◆ 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

◆ 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

◆ 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

◆ 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

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

◆ getShader()

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

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

◆ isCanvasActive()

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

◆ 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 current font (throws when unset).

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

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

Font used by print(); 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

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 内被实现.


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