Remove BorrowedOpenGLTexture from the public API again and just provide a factory function in slint::Image

This commit is contained in:
Simon Hausmann 2023-06-01 14:56:56 +02:00 committed by Simon Hausmann
parent ce20b43eb3
commit e7320607a3
5 changed files with 49 additions and 75 deletions

View file

@ -311,7 +311,7 @@ private:
glVertexAttribPointer(position_location, 2, GL_FLOAT, false, 8, 0);
}
slint::BorrowedOpenGLTexture render(float red, float green, float blue, int width, int height)
slint::Image render(float red, float green, float blue, int width, int height)
{
ScopedVBOBinding savedVBO(vbo);
ScopedVAOBinding savedVAO(vao);
@ -342,9 +342,10 @@ private:
glUseProgram(0);
slint::BorrowedOpenGLTexture resultTexture(next_texture->texture,
{ static_cast<uint32_t>(next_texture->width),
static_cast<uint32_t>(next_texture->height) });
auto resultTexture = slint::Image::create_from_borrowed_gl_2d_rgba_texture(
next_texture->texture,
{ static_cast<uint32_t>(next_texture->width),
static_cast<uint32_t>(next_texture->height) });
std::swap(next_texture, displayed_texture);