#include <texture_image_gl.hpp>
|
static reference_counted_ptr< TextureImage > | create (ImageAtlas &patlas, int w, int h, unsigned int m, GLuint texture, bool object_owns_texture, enum format_t fmt=rgba_format, bool allow_bindless=true) |
|
static reference_counted_ptr< TextureImage > | create (ImageAtlas &patlas, int w, int h, unsigned int m, GLenum tex_magnification, GLenum tex_minification, enum format_t fmt=rgba_format, bool allow_bindless=true) |
|
static reference_counted_ptr< TextureImage > | create (ImageAtlas &patlas, int w, int h, const ImageSourceBase &image_data, GLenum tex_magnification, GLenum tex_minification, bool allow_bindless=true) |
|
static void | add_reference (const reference_counted_base< T, Counter > *p) |
|
static void | remove_reference (const reference_counted_base< T, Counter > *p) |
|
|
enum | format_t { rgba_format,
premultipied_rgba_format
} |
|
enum | type_t { on_atlas,
bindless_texture2d,
context_texture2d
} |
|
| Image (ImageAtlas &atlas, int w, int h, unsigned int m, enum type_t type, uint64_t handle, enum format_t fmt, const reference_counted_ptr< ResourceReleaseAction > &action=reference_counted_ptr< ResourceReleaseAction >()) |
|
A TextureImage is an Image that is backed by a GL texture. Creating a TextureImage requires that a GL context is current. If the GL context supports bindless (i.e one of the GL_ARB_bindless_texture or GL_NV_bindless_texture is present), then the created TextureImage will have that Image::type() is Image::bindless_texture2d, otherwise it will be Image::context_texture2d.
Definition at line 44 of file texture_image_gl.hpp.
◆ create() [1/3]
Create a TextureImage from a previously created GL texture whose binding target is GL_TEXTURE_2D.
- Parameters
-
patlas | the ImageAtlas that the created image is part of |
w | width of the texture |
h | height of the texture |
m | number of mipmap levels of the texture |
texture | GL texture name |
object_owns_texture | the created TextureImage will own the GL texture and will delete the GL texture when the returned TextureImage is deleted. If false, the GL texture must be deleted by the caller AFTER the TextureImage is deleted. |
fmt | format of the RGBA of the texture |
allow_bindless | if both this is true and the GL/GLES implementation supports bindless texturing, return an object whose type() returns bindless_texture2d. |
◆ create() [2/3]
Create a GL texture and use it to back a TextureImage; the created TextureImage will own the GL texture.
- Parameters
-
patlas | the ImageAtlas that the created image is part of |
w | width of the texture |
h | height of the texture |
m | number of mipmap levels of the texture |
tex_magnification | magnification filter to get the texture |
tex_minification | minification filter to get the texture |
fmt | format of the RGBA of the texture |
allow_bindless | if both this is true and the GL/GLES implementation supports bindless texturing, return an object whose type() returns bindless_texture2d. |
◆ create() [3/3]
Create a GL texture and use it to back a TextureImage; the created TextureImage will own the GL texture.
- Parameters
-
w | width of the image to create |
h | height of the image to create |
patlas | the ImageAtlas that the created image is part of |
image_data | image data to which to initialize the image |
tex_magnification | magnification filter to get the texture |
tex_minification | minification filter to get the texture |
allow_bindless | if both this is true and the GL/GLES implementation supports bindless texturing, return an object whose type() returns bindless_texture2d. |
◆ texture()
GLuint fastuidraw::gl::TextureImage::texture |
( |
void |
| ) |
const |
Returns the GL texture backing the TextureImage. The texture binding target is always GL_TEXTURE_2D. One can modify the -contents- of the texture via glGetTexParameter familiy of functions or the contents of the backing store via glTexSubImage2D, but one should never change its backing store (via glTexImage2D) or delete it (via glDeleteTextures). Lastly, recall that Painter works by generating index and draw buffers that are sent to the GL/GLES API at Painter::end(), thus if one wants to modify the texture within a Painter::begin() / Painter::end() pair, one must modify it from a PainterDrawBreakAction so that the texture is consumed by the gfx API before it is modified.
The documentation for this class was generated from the following file: