Hymn to Beauty
C++ 3D Engine
Video::WebGPUTexture Class Reference

WebGPU implementation of Texture. More...

#include <WebGPUTexture.hpp>

Inheritance diagram for Video::WebGPUTexture:
Video::Texture

Public Member Functions

 WebGPUTexture (WebGPURenderer &renderer, const glm::uvec2 size, Texture::Type type, Texture::Format format, int components=0, unsigned char *data=nullptr, uint32_t sampleCount=1)
 Create new WebGPU texture. More...
 
 ~WebGPUTexture () final
 Destructor. More...
 
WGPUTexture GetTexture () const
 Get the interan WebGPU texture. More...
 
WGPUTextureView GetTextureView () const
 Get the texture view. More...
 
WGPUTextureFormat GetTextureFormat () const
 Get the format of the texture. More...
 
uint32_t GetSampleCount () const
 Get the MSAA sample count. More...
 
- Public Member Functions inherited from Video::Texture
 Texture (Type type, const glm::uvec2 &size, Format format)
 Create a new texture. More...
 
virtual ~Texture ()
 Destructor. More...
 
Type GetType () const
 Get the type of texture. More...
 
const glm::uvec2 & GetSize () const
 Get the size of the texture. More...
 
Format GetFormat () const
 Get the format of the texture. More...
 
uint64_t GetUniqueIdentifier () const
 Get a unique identifier. More...
 

Additional Inherited Members

- Public Types inherited from Video::Texture
enum class  Type { COLOR , RENDER_COLOR , RENDER_DEPTH }
 The type of texture. More...
 
enum class  Format {
  R8 , R8G8B8A8 , R11G11B10 , R16G16B16A16 ,
  D32
}
 The format of the texture. More...
 

Detailed Description

WebGPU implementation of Texture.

Constructor & Destructor Documentation

◆ WebGPUTexture()

Video::WebGPUTexture::WebGPUTexture ( WebGPURenderer renderer,
const glm::uvec2  size,
Texture::Type  type,
Texture::Format  format,
int  components = 0,
unsigned char *  data = nullptr,
uint32_t  sampleCount = 1 
)

Create new WebGPU texture.

Parameters
rendererThe WebGPU renderer.
sizeThe size of the texture, in pixels.
typeThe type of texture to create.
formatThe format of the texture.
componentsThe number of components in the texture, 0 if no texture data is supplied.
dataThe texture data to upload, or nullptr.
sampleCountMSAA samples.

◆ ~WebGPUTexture()

Video::WebGPUTexture::~WebGPUTexture ( )
final

Destructor.

Member Function Documentation

◆ GetSampleCount()

uint32_t Video::WebGPUTexture::GetSampleCount ( ) const

Get the MSAA sample count.

Returns
The sample count.

◆ GetTexture()

WGPUTexture Video::WebGPUTexture::GetTexture ( ) const

Get the interan WebGPU texture.

Returns
The WebGPU texture.

◆ GetTextureFormat()

WGPUTextureFormat Video::WebGPUTexture::GetTextureFormat ( ) const

Get the format of the texture.

Returns
The format of the texture.

◆ GetTextureView()

WGPUTextureView Video::WebGPUTexture::GetTextureView ( ) const

Get the texture view.

Returns
The texture view.

The documentation for this class was generated from the following files: