rifContextCreateImageFromOpenGlTexture

Creates a new image object with the defined format and GL texture associated with the context.

rif_int rifContextCreateImageFromOpenGlTexture(

rif_context context,

unsigned int target,

int miplevel,

unsigned int texture,

rif_image * out_image);

Parameters

Parameter

Input/Output

Description

context

input

A valid context object.

target

input

GL texture target.

miplevel

input

GL texture miplevel.

texture

input

GL texture ID.

out_image

output

A pointer to the image object which will be created if the function performs successfully.

Return

Returns RIF_SUCCESS if the function is executed successfully, or RIF_ERROR code if a problem is encountered.

Errors

Possible error codes:

  • RIF_ERROR_INVALID_CONTEXT - context is not a valid context object.

  • RIF_ERROR_INVALID_PARAMETER - out_image is nullptr.

  • RIF_ERROR_UNSUPPORTED_IMAGE_FORMAT - texture format is currently unsupported.

  • RIF_ERROR_INVALID_GL_TEXTURE - texture is not a valid texture ID.

  • RIF_ERROR_UNSUPPORTED - creating images from GL textures is not supported under the current platform.