fl_pixel_buffer_texture_populate: @texture: an #FlPixelBufferTexture. @width: width of the texture. @height: height of the texture. @opengl_texture: (out): return an FlutterOpenGLTexture. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.
Attempts to populate the specified @opengl_texture with texture details such as the name, width, height and the pixel format.
Returns: TRUE on success.
75 {
76 FlPixelBufferTexture*
self = FL_PIXEL_BUFFER_TEXTURE(
texture);
79 fl_pixel_buffer_texture_get_instance_private(
self));
80
81 const uint8_t*
buffer =
nullptr;
82 if (!FL_PIXEL_BUFFER_TEXTURE_GET_CLASS(
self)->copy_pixels(
85 }
86
92 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
94 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
96 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
98 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
100 } else {
103 }
104 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,
width,
height, 0, GL_RGBA,
105 GL_UNSIGNED_BYTE,
buffer);
107
108 opengl_texture->
target = GL_TEXTURE_2D;
110 opengl_texture->
format = GL_RGBA8;
115
117}
static void check_gl_error(int line)
static const uint8_t buffer[]
const uint8_t uint32_t uint32_t GError ** error
uint32_t name
The name of the texture.
VoidCallback destruction_callback
void * user_data
User data to be returned on the invocation of the destruction callback.
size_t height
Height of the texture.
uint32_t format
The texture format (example GL_RGBA8).