|
Cogs.Core
|
Public Member Functions | |
| void | initialize (GraphicsDeviceGL20 *device) |
| TextureHandle | loadTexture (const TextureDescription &desc, const TextureData *data) override |
| Load a texture from the given description. | |
| void | releaseTexture (TextureHandle textureHandle) override |
| Release the texture with the given textureHandle. | |
| void | uploadTextureData (TextureGL20 &texture, const TextureData &data, uint32_t layer_offset=0, uint32_t face_offset=0, uint32_t level_offset=0) |
| 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. | |
| SamplerStateHandle | loadSamplerState (const SamplerState &state) override |
| Load a sampler state object. | |
| void | releaseSamplerState (SamplerStateHandle handle) override |
| 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) override |
| Use the graphics device to generate mipmaps for the texture with the given texture handle. | |
| void | releaseResources () override |
| Release all allocated texture resources. | |
| void | annotate (TextureHandle handle, const StringView &name) override |
| Associate a name with an object for use in graphics debugging. | |
| 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 | 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::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 | |
| SafeResourceMap< TextureHandle, TextureGL20 > | textures |
| bool | useTextureStorage |
| bool | useAnisotropic |
Definition at line 31 of file TexturesGL20.h.
| Cogs::TexturesGL20::~TexturesGL20 | ( | ) |
Definition at line 16 of file TexturesGL20.cpp.
|
overridevirtual |
Associate a name with an object for use in graphics debugging.
Reimplemented from Cogs::ITextures.
Definition at line 431 of file TexturesGL20.cpp.
References Cogs::StringView::data(), and Cogs::StringView::size().
|
overridevirtual |
Create a texture view used to bind a limited view of the texture data to the rendering pipeline.
| viewDescription | Description of the texture view. |
Implements Cogs::ITextures.
Definition at line 349 of file TexturesGL20.cpp.
|
overridevirtual |
Use the graphics device to generate mipmaps for the texture with the given texture handle.
| textureHandle | Valid handle to a previously created texture object. The texture must have been created with the TextureFlags::GenerateMipMaps flag. |
Implements Cogs::ITextures.
Definition at line 410 of file TexturesGL20.cpp.
|
inlineoverridevirtual |
Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given texture handle.
| textureHandle | Valid handle to a previously created texture object. |
Implements Cogs::ITextures.
Definition at line 60 of file TexturesGL20.h.
| void Cogs::TexturesGL20::initialize | ( | GraphicsDeviceGL20 * | device | ) |
Definition at line 23 of file TexturesGL20.cpp.
|
overridevirtual |
Load a sampler state object.
| state | Sampler state structure used to initialize the sampler state object on the graphics device. |
Implements Cogs::ITextures.
Definition at line 312 of file TexturesGL20.cpp.
References Cogs::SamplerState::addressModeS, Cogs::SamplerState::addressModeT, Cogs::SamplerState::addressModeW, Cogs::SamplerState::borderColor, Cogs::SamplerState::comparisonFunction, Cogs::SamplerState::ComparisonMinMagMipLinear, Cogs::SamplerState::ComparisonMinMagMipPoint, Cogs::SamplerState::filter, and Cogs::SamplerState::maxAnisotropy.
|
overridevirtual |
Load a texture from the given description.
| desc | Texture description. |
| data | Optional texture content. |
Implements Cogs::TexturesCommon.
Definition at line 33 of file TexturesGL20.cpp.
References Cogs::TextureFlags::ExternalTexture, Cogs::TextureFlags::GenerateMipMaps, Cogs::Handle_t< TextureTag >::InvalidHandle, and Cogs::FormatInfo::name.
Referenced by Cogs::SwapChainGL20::recreateOffscreenBuffers().
|
virtual |
Load a texture from the given description.
| desc | Texture description. |
| data | Optional texture content. |
Implements Cogs::TexturesCommon.
|
virtual |
Load a texture from the given description.
| desc | Texture description. |
| data | Optional texture content. |
Implements Cogs::TexturesCommon.
|
final |
Definition at line 10 of file TexturesCommon.cpp.
|
final |
Definition at line 11 of file TexturesCommon.cpp.
|
virtual |
Load a texture using the given data to populate the texture contents.
| bytes | Pointer to texture data. If nullptr is given an empty texture with the given dimensions and format is created. |
| width | Width of the texture in pixels. |
| height | Height of the texture in pixels. |
| format | Format of the texture data. |
| flags | Texture flags used to determine which operations are supported by the created texture. |
Reimplemented from Cogs::TexturesCommon.
|
virtual |
Load a texture using the given data to populate the texture contents.
| bytes | Pointer to texture data. If nullptr is given an empty texture with the given dimensions and format is created. |
| width | Width of the texture in pixels. |
| height | Height of the texture in pixels. |
| format | Format of the texture data. |
| numSamples | Number of samples to use per pixel in the texture. |
| flags | Texture flags used to determine which operations are supported by the created texture. |
Reimplemented from Cogs::TexturesCommon.
|
overridevirtual |
Release all allocated texture resources.
Implements Cogs::ITextures.
Definition at line 420 of file TexturesGL20.cpp.
|
overridevirtual |
Release the sampler state with the given handle.
| handle | Valid handle to a previously created sampler state. |
Implements Cogs::ITextures.
Definition at line 343 of file TexturesGL20.cpp.
References Cogs::Handle_t< Type, Convertible >::handle.
|
overridevirtual |
Release the texture with the given textureHandle.
| textureHandle | Valid handle to a previously created texture object. |
Implements Cogs::ITextures.
Definition at line 153 of file TexturesGL20.cpp.
Referenced by Cogs::SwapChainGL20::recreateOffscreenBuffers().
|
overridevirtual |
Release the given texture view.
| handle | Valid handle to a previously created texture view. |
Implements Cogs::ITextures.
Definition at line 403 of file TexturesGL20.cpp.
References Cogs::Handle_t< Type, Convertible >::handle.
| void Cogs::TexturesGL20::uploadTextureData | ( | TextureGL20 & | texture, |
| const TextureData & | data, | ||
| uint32_t | layer_offset = 0, |
||
| uint32_t | face_offset = 0, |
||
| uint32_t | level_offset = 0 |
||
| ) |
Definition at line 165 of file TexturesGL20.cpp.
|
overridevirtual |
Upload a texture from the given description.
| desc | Texture description. |
| data | Optional texture content. |
Reimplemented from Cogs::ITextures.
Definition at line 299 of file TexturesGL20.cpp.
| SafeResourceMap<TextureHandle, TextureGL20> Cogs::TexturesGL20::textures |
Definition at line 68 of file TexturesGL20.h.
| bool Cogs::TexturesGL20::useAnisotropic |
Definition at line 71 of file TexturesGL20.h.
| bool Cogs::TexturesGL20::useTextureStorage |
Definition at line 70 of file TexturesGL20.h.