Cogs.Core
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | Friends | List of all members
Cogs::TexturesGLES30 Struct Reference
Inheritance diagram for Cogs::TexturesGLES30:
Cogs::TexturesCommon Cogs::ITextures

Public Member Functions

void initialize (ContextGLES30 *context, CapabilitiesGLES30 *caps)
 
TextureHandle loadTexture (const TextureDescription &desc, const TextureData *data)
 Load a texture from the given description.
 
void uploadTextureData (TextureGLES30 &tex, const TextureData &data, uint32_t layer_offset, uint32_t face_offset, uint32_t level_offset)
 
void uploadTextureData (TextureHandle textureHandle, const TextureData &data, uint32_t layer_offset, uint32_t face_offset, uint32_t level_offset) override
 Upload a texture from the given description.
 
void releaseTexture (TextureHandle textureHandle)
 Release the texture with the given textureHandle.
 
void releaseNativeTexture (TextureNativeHandle nativeHandle) override
 Release a native texture handle.
 
SamplerStateHandle loadSamplerState (const SamplerState &state)
 Load a sampler state object.
 
void releaseSamplerState (SamplerStateHandle handle)
 Release the sampler state with the given handle.
 
TextureViewHandle createTextureView (TextureViewDescription &viewDescription) override
 Create a texture view used to bind a limited view of the texture data to the rendering pipeline.
 
void releaseTextureView (const TextureViewHandle &handle) override
 Release the given texture view.
 
void * getNativeHandle (TextureHandle textureHandle) override
 Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given texture handle.
 
void generateMipmaps (TextureHandle texureHandle)
 Use the graphics device to generate mipmaps for the texture with the given texture handle.
 
void releaseResources ()
 Release all allocated texture resources.
 
- Public Member Functions inherited from Cogs::TexturesCommon
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.
 

Public Attributes

size_t textureMemoryConsumption = 0
 
ResourceMap< TextureHandle, TextureGLES30textures
 
ResourceMap< TextureViewHandle, TextureViewDescriptionviews
 
ResourceMap< SamplerStateHandle, SamplerGLES30samplers
 

Protected Member Functions

void defineTextureData (TextureGLES30 *tex, GLuint textureLevels)
 

Private Attributes

ContextGLES30context = nullptr
 
CapabilitiesGLES30caps = nullptr
 

Friends

struct ContextGLES30
 

Detailed Description

Definition at line 44 of file TexturesGLES30.h.

Member Function Documentation

◆ createTextureView()

Cogs::TextureViewHandle Cogs::TexturesGLES30::createTextureView ( TextureViewDescription viewDescription)
overridevirtual

Create a texture view used to bind a limited view of the texture data to the rendering pipeline.

Parameters
viewDescriptionDescription of the texture view.
Returns
Handle to the create texture view, InvalidHandle if error.

Implements Cogs::ITextures.

Definition at line 489 of file TexturesGLES30.cpp.

References Cogs::TextureViewDescription::layerIndex.

◆ defineTextureData()

void Cogs::TexturesGLES30::defineTextureData ( TextureGLES30 tex,
GLuint  textureLevels 
)
protected

Definition at line 328 of file TexturesGLES30.cpp.

◆ generateMipmaps()

void Cogs::TexturesGLES30::generateMipmaps ( TextureHandle  textureHandle)
virtual

Use the graphics device to generate mipmaps for the texture with the given texture handle.

Parameters
textureHandleValid handle to a previously created texture object. The texture must have been created with the TextureFlags::GenerateMipMaps flag.

Implements Cogs::ITextures.

Definition at line 516 of file TexturesGLES30.cpp.

◆ getNativeHandle()

void * Cogs::TexturesGLES30::getNativeHandle ( TextureHandle  textureHandle)
overridevirtual

Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given texture handle.

Parameters
textureHandleValid handle to a previously created texture object.
Returns
Native handle

Implements Cogs::ITextures.

Definition at line 504 of file TexturesGLES30.cpp.

◆ initialize()

void Cogs::TexturesGLES30::initialize ( ContextGLES30 context,
CapabilitiesGLES30 caps 
)
inline

Definition at line 47 of file TexturesGLES30.h.

◆ loadSamplerState()

Cogs::SamplerStateHandle Cogs::TexturesGLES30::loadSamplerState ( const SamplerState state)
virtual

Load a sampler state object.

Parameters
stateSampler state structure used to initialize the sampler state object on the graphics device.
Returns
Handle to the newly created sampler state object, InvalidHandle if the operation failed.

Implements Cogs::ITextures.

Definition at line 408 of file TexturesGLES30.cpp.

References Cogs::SamplerState::addressModeS, Cogs::SamplerState::addressModeT, Cogs::SamplerState::addressModeW, Cogs::SamplerState::Border, Cogs::SamplerState::comparisonFunction, Cogs::SamplerState::ComparisonMinMagMipLinear, Cogs::SamplerState::ComparisonMinMagMipPoint, Cogs::SamplerState::filter, Cogs::SamplerState::maxAnisotropy, Cogs::SamplerState::MinMagMipLinear, and Cogs::SamplerState::MinMagMipPoint.

◆ loadTexture()

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

Load a texture from the given description.

Parameters
descTexture description.
dataOptional texture content.

Implements Cogs::TexturesCommon.

Definition at line 45 of file TexturesGLES30.cpp.

References Cogs::TextureFlags::DepthBuffer, Cogs::TextureFlags::ExternalTexture, Cogs::TextureFlags::GenerateMipMaps, and Cogs::Handle_t< TextureTag >::InvalidHandle.

◆ releaseNativeTexture()

void Cogs::TexturesGLES30::releaseNativeTexture ( TextureNativeHandle  nativeHandle)
overridevirtual

Release a native texture handle.

Parameters
nativeHandleis a handle to a natively created texture (Created directly from the graphics API).

Reimplemented from Cogs::ITextures.

Definition at line 402 of file TexturesGLES30.cpp.

◆ releaseResources()

void Cogs::TexturesGLES30::releaseResources ( )
virtual

Release all allocated texture resources.

Implements Cogs::ITextures.

Definition at line 524 of file TexturesGLES30.cpp.

◆ releaseSamplerState()

void Cogs::TexturesGLES30::releaseSamplerState ( SamplerStateHandle  handle)
virtual

Release the sampler state with the given handle.

Parameters
handleValid handle to a previously created sampler state.

Implements Cogs::ITextures.

Definition at line 480 of file TexturesGLES30.cpp.

◆ releaseTexture()

void Cogs::TexturesGLES30::releaseTexture ( TextureHandle  textureHandle)
virtual

Release the texture with the given textureHandle.

Parameters
textureHandleValid handle to a previously created texture object.

Implements Cogs::ITextures.

Definition at line 358 of file TexturesGLES30.cpp.

References Cogs::TextureFlags::NoDelete, and Cogs::Handle_t< TextureTag >::NoHandle.

◆ releaseTextureView()

void Cogs::TexturesGLES30::releaseTextureView ( const TextureViewHandle handle)
overridevirtual

Release the given texture view.

Parameters
handleValid handle to a previously created texture view.

Implements Cogs::ITextures.

Definition at line 497 of file TexturesGLES30.cpp.

◆ uploadTextureData() [1/2]

void Cogs::TexturesGLES30::uploadTextureData ( TextureGLES30 tex,
const TextureData data,
uint32_t  layer_offset,
uint32_t  face_offset,
uint32_t  level_offset 
)

Definition at line 223 of file TexturesGLES30.cpp.

◆ uploadTextureData() [2/2]

void Cogs::TexturesGLES30::uploadTextureData ( TextureHandle  textureHandle,
const TextureData data,
uint32_t  layer_offset,
uint32_t  face_offset,
uint32_t  level_offset 
)
overridevirtual

Upload a texture from the given description.

Parameters
descTexture description.
dataOptional texture content.

Reimplemented from Cogs::ITextures.

Definition at line 314 of file TexturesGLES30.cpp.

Friends And Related Function Documentation

◆ ContextGLES30

friend struct ContextGLES30
friend

Definition at line 73 of file TexturesGLES30.h.

Member Data Documentation

◆ caps

CapabilitiesGLES30* Cogs::TexturesGLES30::caps = nullptr
private

Definition at line 79 of file TexturesGLES30.h.

◆ context

ContextGLES30* Cogs::TexturesGLES30::context = nullptr
private

Definition at line 78 of file TexturesGLES30.h.

◆ samplers

ResourceMap<SamplerStateHandle, SamplerGLES30> Cogs::TexturesGLES30::samplers

Definition at line 70 of file TexturesGLES30.h.

◆ textureMemoryConsumption

size_t Cogs::TexturesGLES30::textureMemoryConsumption = 0

Definition at line 67 of file TexturesGLES30.h.

◆ textures

ResourceMap<TextureHandle, TextureGLES30> Cogs::TexturesGLES30::textures

Definition at line 68 of file TexturesGLES30.h.

◆ views

ResourceMap<TextureViewHandle, TextureViewDescription> Cogs::TexturesGLES30::views

Definition at line 69 of file TexturesGLES30.h.


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