mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 04:52:28 +00:00
gl: allow to avoid calling glTexImage2D(w, h, NULL) when generating a texture
Just pass 0 as width or height to gst_gl_context_gen_texture.
This commit is contained in:
parent
88864ea2cc
commit
4bc96ae4cd
1 changed files with 4 additions and 2 deletions
|
@ -111,8 +111,10 @@ _gen_texture (GstGLContext * context, GenTexture * data)
|
|||
|
||||
gl->GenTextures (1, &data->result);
|
||||
gl->BindTexture (GL_TEXTURE_2D, data->result);
|
||||
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, data->width,
|
||||
data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
|
||||
if (data->width > 0 && data->height > 0)
|
||||
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, data->width,
|
||||
data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
|
Loading…
Reference in a new issue