libktx Reference 4.3.2
Libraries and tools to create and read KTX image texture files.
|
Create texture objects in current OpenGL context. More...
Functions | |
KTX_error_code | ktxTexture1_GLUpload (ktxTexture1 *This, GLuint *pTexture, GLenum *pTarget, GLenum *pGlerror) |
Create a GL texture object from a ktxTexture1 object. | |
KTX_error_code | ktxTexture2_GLUpload (ktxTexture2 *This, GLuint *pTexture, GLenum *pTarget, GLenum *pGlerror) |
Create a GL texture object from a ktxTexture2 object. | |
KTX_error_code | ktxTexture_GLUpload (ktxTexture *This, GLuint *pTexture, GLenum *pTarget, GLenum *pGlerror) |
Create a GL texture object from a ktxTexture1 object. | |
Create texture objects in current OpenGL context.
KTX_error_code ktxTexture1_GLUpload | ( | ktxTexture1 * | This, |
GLuint * | pTexture, | ||
GLenum * | pTarget, | ||
GLenum * | pGlerror | ||
) |
Create a GL texture object from a ktxTexture1 object.
Sets the texture object's GL_TEXTURE_MAX_LEVEL parameter according to the number of levels in the KTX data, provided the context supports this feature.
Unpacks compressed GL_ETC1_RGB8_OES and GL_ETC2_* format textures in software when the format is not supported by the GL context, provided the library has been compiled with SUPPORT_SOFTWARE_ETC_UNPACK
defined as 1.
It will also convert textures with legacy formats to their modern equivalents when the format is not supported by the GL context, provided the library has been compiled with SUPPORT_LEGACY_FORMAT_CONVERSION
defined as 1.
[in] | This | handle of the ktxTexture to upload. |
[in,out] | pTexture | name of the GL texture object to load. If NULL or if *pTexture == 0 the function will generate a texture name. The function binds either the generated name or the name given in *pTexture to the texture target returned in *pTarget , before loading the texture data. If pTexture is not NULL and a name was generated, the generated name will be returned in *pTexture. |
[out] | pTarget | *pTarget is set to the texture target used. The target is chosen based on the file contents. |
[out] | pGlerror | *pGlerror is set to the value returned by glGetError when this function returns the error KTX_GL_ERROR. pGlerror can be NULL. |
KTX_GL_ERROR | A GL error was raised by glBindTexture, glGenTextures or gl*TexImage*. The GL error will be returned in *glerror , if glerror is not NULL . |
KTX_INVALID_VALUE | This or target is NULL or the size of a mip level is greater than the size of the preceding level. |
KTX_NOT_FOUND | A dynamically loaded OpenGL {,ES} function required by the loader was not found. |
KTX_UNSUPPORTED_TEXTURE_TYPE | The type of texture is not supported by the current OpenGL context. |
KTX_error_code ktxTexture2_GLUpload | ( | ktxTexture2 * | This, |
GLuint * | pTexture, | ||
GLenum * | pTarget, | ||
GLenum * | pGlerror | ||
) |
Create a GL texture object from a ktxTexture2 object.
Sets the texture object's GL_TEXTURE_MAX_LEVEL parameter according to the number of levels in the KTX data, provided the context supports this feature.
Unpacks compressed GL_ETC1_RGB8_OES and GL_ETC2_* format textures in software when the format is not supported by the GL context, provided the library has been compiled with SUPPORT_SOFTWARE_ETC_UNPACK
defined as 1.
[in] | This | handle of the ktxTexture to upload. |
[in,out] | pTexture | name of the GL texture object to load. If NULL or if *pTexture == 0 the function will generate a texture name. The function binds either the generated name or the name given in *pTexture to the texture target returned in *pTarget , before loading the texture data. If pTexture is not NULL and a name was generated, the generated name will be returned in *pTexture. |
[out] | pTarget | *pTarget is set to the texture target used. The target is chosen based on the file contents. |
[out] | pGlerror | *pGlerror is set to the value returned by glGetError when this function returns the error KTX_GL_ERROR. pGlerror can be NULL. |
KTX_GL_ERROR | A GL error was raised by glBindTexture, glGenTextures or gl*TexImage*. The GL error will be returned in *glerror , if glerror is not NULL . |
KTX_INVALID_VALUE | This or target is NULL or the size of a mip level is greater than the size of the preceding level. |
KTX_NOT_FOUND | A dynamically loaded OpenGL {,ES} function required by the loader was not found. |
KTX_UNSUPPORTED_TEXTURE_TYPE | The type of texture is not supported by the current OpenGL context. |
KTX_error_code ktxTexture_GLUpload | ( | ktxTexture * | This, |
GLuint * | pTexture, | ||
GLenum * | pTarget, | ||
GLenum * | pGlerror | ||
) |
Create a GL texture object from a ktxTexture1 object.
In order to ensure that the GL uploader is not linked into an application unless explicitly called, this is not a virtual function. It determines the texture type then dispatches to the correct function.
Sets the texture object's GL_TEXTURE_MAX_LEVEL parameter according to the number of levels in the KTX data, provided the context supports this feature.
Unpacks compressed GL_ETC1_RGB8_OES and GL_ETC2_* format textures in software when the format is not supported by the GL context, provided the library has been compiled with SUPPORT_SOFTWARE_ETC_UNPACK
defined as 1.
It will also convert textures with legacy formats to their modern equivalents when the format is not supported by the GL context, provided the library has been compiled with SUPPORT_LEGACY_FORMAT_CONVERSION
defined as 1.
[in] | This | handle of the ktxTexture to upload. |
[in,out] | pTexture | name of the GL texture object to load. If NULL or if *pTexture == 0 the function will generate a texture name. The function binds either the generated name or the name given in *pTexture to the texture target returned in *pTarget , before loading the texture data. If pTexture is not NULL and a name was generated, the generated name will be returned in *pTexture. |
[out] | pTarget | *pTarget is set to the texture target used. The target is chosen based on the file contents. |
[out] | pGlerror | *pGlerror is set to the value returned by glGetError when this function returns the error KTX_GL_ERROR. pGlerror can be NULL. |
KTX_GL_ERROR | A GL error was raised by glBindTexture, glGenTextures or gl*TexImage*. The GL error will be returned in *glerror , if glerror is not NULL . |
KTX_INVALID_VALUE | This or target is NULL or the size of a mip level is greater than the size of the preceding level. |
KTX_NOT_FOUND | A dynamically loaded OpenGL {,ES} function required by the loader was not found. |
KTX_UNSUPPORTED_TEXTURE_TYPE | The type of texture is not supported by the current OpenGL context. |