Cogs.Core
Public Member Functions | List of all members
Cogs::TexturesCommon Struct Referenceabstract
Inheritance diagram for Cogs::TexturesCommon:
Cogs::ITextures Cogs::TexturesD3D11 Cogs::TexturesD3D12 Cogs::TexturesGL20 Cogs::TexturesGLES30 Cogs::TexturesNull Cogs::TexturesVK Cogs::TexturesWebGPU

Public Member Functions

TextureHandle loadTexture (const uint8_t *bytes, uint32_t width, uint32_t height, TextureFormat format, uint32_t flags) final
 
TextureHandle loadTexture (const uint8_t *bytes, uint32_t width, uint32_t height, TextureFormat format, uint32_t numSamples, uint32_t flags) final
 
TextureHandle loadTextureMipMaps (const uint8_t **bytes, size_t numLevels, const uint32_t *widths, const uint32_t *heights, TextureFormat format, uint32_t flags=0) final
 
TextureHandle loadTextureArray (const uint8_t **bytes, const size_t arraySize, const size_t numLevels, const uint32_t *widths, const uint32_t *heights, TextureFormat format, uint32_t flags=0) final
 
TextureHandle loadCubeMap (const uint8_t **bytes, const size_t arraySize, const size_t numLevels, const uint32_t *widths, const uint32_t *heights, TextureFormat format, uint32_t flags=0) final
 
TextureHandle load (ResourceDimensions target, const uint8_t **bytes, const size_t arraySize, const size_t numLevels, const uint32_t *widths, const uint32_t *heights, TextureFormat format, uint32_t numSamples, uint32_t flags)
 
TextureHandle loadTexture (const TextureDescription &desc, const TextureData *data)=0
 Load a texture from the given description.
 
virtual TextureHandle loadTexture (const unsigned char *bytes, unsigned int width, unsigned int height, TextureFormat format, unsigned int flags=0)=0
 Load a texture using the given data to populate the texture contents.
 
virtual TextureHandle loadTexture (const unsigned char *bytes, unsigned int width, unsigned int height, TextureFormat format, unsigned int numSamples, unsigned int flags)=0
 Load a texture using the given data to populate the texture contents.
 
virtual TextureHandle loadTexture (const TextureDescription &desc, const TextureData *data)=0
 Load a texture from the given description.
 
- Public Member Functions inherited from Cogs::ITextures
virtual void annotate (TextureHandle handle, const StringView &name)
 Associate a name with an object for use in graphics debugging.
 
virtual TextureHandle loadTexture (const unsigned char *bytes, unsigned int width, unsigned int height, TextureFormat format, unsigned int flags=0)=0
 Load a texture using the given data to populate the texture contents.
 
virtual TextureHandle loadTexture (const unsigned char *bytes, unsigned int width, unsigned int height, TextureFormat format, unsigned int numSamples, unsigned int flags)=0
 Load a texture using the given data to populate the texture contents.
 
virtual TextureHandle loadTextureMipMaps (const unsigned char **bytes, size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0
 Load a texture with multiple mipmap levels using the given data to populate the texture contents.
 
virtual TextureHandle loadTextureArray (const unsigned char **bytes, const size_t arraySize, const size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0
 Load an array texture with mipmaps using the given data to populate the texture contents.
 
virtual TextureHandle loadCubeMap (const unsigned char **bytes, const size_t arraySize, const size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0
 Load a cube map texture with mipmaps using the given data to populate the texture contents.
 
virtual TextureHandle loadTexture (const TextureDescription &desc, const TextureData *data)=0
 Load a texture from the given description.
 
virtual void uploadTextureData (TextureHandle textureHandle, const TextureData &data, uint32_t layer_offset=0, uint32_t face_offset=0, uint32_t level_offset=0)
 Upload a texture from the given description.
 
virtual void releaseTexture (TextureHandle textureHandle)=0
 Release the texture with the given textureHandle.
 
virtual void releaseNativeTexture (TextureNativeHandle nativeHandle)
 Release a native texture handle.
 
virtual TextureViewHandle createTextureView (TextureViewDescription &viewDescription)=0
 Create a texture view used to bind a limited view of the texture data to the rendering pipeline.
 
virtual void releaseTextureView (const TextureViewHandle &handle)=0
 Release the given texture view.
 
virtual SamplerStateHandle loadSamplerState (const SamplerState &state)=0
 Load a sampler state object.
 
virtual void releaseSamplerState (SamplerStateHandle handle)=0
 Release the sampler state with the given handle.
 
virtual void generateMipmaps (TextureHandle textureHandle)=0
 Use the graphics device to generate mipmaps for the texture with the given texture handle.
 
virtual void * getNativeHandle (TextureHandle textureHandle)=0
 Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given texture handle.
 
virtual void releaseResources ()=0
 Release all allocated texture resources.
 

Detailed Description

Definition at line 7 of file TexturesCommon.h.

Member Function Documentation

◆ load()

Cogs::TextureHandle Cogs::TexturesCommon::load ( Cogs::ResourceDimensions  target,
const uint8_t **  bytes,
const size_t  arraySize,
const size_t  numLevels,
const uint32_t *  widths,
const uint32_t *  heights,
TextureFormat  format,
uint32_t  numSamples,
uint32_t  flags 
)

Definition at line 28 of file TexturesCommon.cpp.

◆ loadCubeMap()

Cogs::TextureHandle Cogs::TexturesCommon::loadCubeMap ( const uint8_t **  bytes,
const size_t  arraySize,
const size_t  numLevels,
const uint32_t *  widths,
const uint32_t *  heights,
TextureFormat  format,
uint32_t  flags = 0 
)
final

Definition at line 23 of file TexturesCommon.cpp.

◆ loadTexture() [1/6]

virtual TextureHandle Cogs::ITextures::loadTexture ( const TextureDescription desc,
const TextureData data 
)
virtual

Load a texture from the given description.

Parameters
descTexture description.
dataOptional texture content.

Implements Cogs::ITextures.

Reimplemented in Cogs::TexturesD3D11, Cogs::TexturesD3D11, Cogs::TexturesD3D12, Cogs::TexturesD3D12, Cogs::TexturesNull, Cogs::TexturesNull, Cogs::TexturesGL20, Cogs::TexturesGL20, Cogs::TexturesVK, Cogs::TexturesVK, Cogs::TexturesWebGPU, and Cogs::TexturesWebGPU.

◆ loadTexture() [2/6]

TextureHandle Cogs::TexturesCommon::loadTexture ( const TextureDescription desc,
const TextureData data 
)
pure virtual

◆ loadTexture() [3/6]

Cogs::TextureHandle Cogs::TexturesCommon::loadTexture ( const uint8_t *  bytes,
uint32_t  width,
uint32_t  height,
TextureFormat  format,
uint32_t  flags 
)
final

Definition at line 3 of file TexturesCommon.cpp.

◆ loadTexture() [4/6]

Cogs::TextureHandle Cogs::TexturesCommon::loadTexture ( const uint8_t *  bytes,
uint32_t  width,
uint32_t  height,
TextureFormat  format,
uint32_t  numSamples,
uint32_t  flags 
)
final

Definition at line 8 of file TexturesCommon.cpp.

◆ loadTexture() [5/6]

virtual TextureHandle Cogs::ITextures::loadTexture ( const unsigned char *  bytes,
unsigned int  width,
unsigned int  height,
TextureFormat  format,
unsigned int  flags = 0 
)
virtual

Load a texture using the given data to populate the texture contents.

Parameters
bytesPointer to texture data. If nullptr is given an empty texture with the given dimensions and format is created.
widthWidth of the texture in pixels.
heightHeight of the texture in pixels.
formatFormat of the texture data.
flagsTexture flags used to determine which operations are supported by the created texture.
Returns
Handle to the newly created texture object, InvalidHandle if the operation failed.

Implements Cogs::ITextures.

Reimplemented in Cogs::TexturesD3D11, Cogs::TexturesD3D12, Cogs::TexturesNull, Cogs::TexturesGL20, Cogs::TexturesVK, and Cogs::TexturesWebGPU.

◆ loadTexture() [6/6]

virtual TextureHandle Cogs::ITextures::loadTexture ( const unsigned char *  bytes,
unsigned int  width,
unsigned int  height,
TextureFormat  format,
unsigned int  numSamples,
unsigned int  flags 
)
virtual

Load a texture using the given data to populate the texture contents.

Parameters
bytesPointer to texture data. If nullptr is given an empty texture with the given dimensions and format is created.
widthWidth of the texture in pixels.
heightHeight of the texture in pixels.
formatFormat of the texture data.
numSamplesNumber of samples to use per pixel in the texture.
flagsTexture flags used to determine which operations are supported by the created texture.
Returns
Handle to the newly created texture object, InvalidHandle if the operation failed.

Implements Cogs::ITextures.

Reimplemented in Cogs::TexturesD3D11, Cogs::TexturesD3D12, Cogs::TexturesNull, Cogs::TexturesGL20, Cogs::TexturesVK, and Cogs::TexturesWebGPU.

◆ loadTextureArray()

Cogs::TextureHandle Cogs::TexturesCommon::loadTextureArray ( const uint8_t **  bytes,
const size_t  arraySize,
const size_t  numLevels,
const uint32_t *  widths,
const uint32_t *  heights,
TextureFormat  format,
uint32_t  flags = 0 
)
final

Definition at line 18 of file TexturesCommon.cpp.

◆ loadTextureMipMaps()

Cogs::TextureHandle Cogs::TexturesCommon::loadTextureMipMaps ( const uint8_t **  bytes,
size_t  numLevels,
const uint32_t *  widths,
const uint32_t *  heights,
TextureFormat  format,
uint32_t  flags = 0 
)
final

Definition at line 13 of file TexturesCommon.cpp.


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