def update_pbo_texture(gl, pbo, texture, *, array_data, texture_format, source_format, source_type):
    'Update a texture associated with a PBO'
    (width, height) = array_data.shape[:2]
    if (source_format == gl.GL_RGB):
        height //= 3
    with bind(pbo, texture):
        gl.glPixelStorei(gl.GL_UNPACK_ALIGNMENT, 1)
        gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR)
        gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR)
        gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, texture_format, width, height, 0, source_format, source_type, None)
Update a texture associated with a PBO
def update_pbo_texture(gl, pbo, texture, *, array_data, texture_format, source_format, source_type):
    
    (width, height) = array_data.shape[:2]
    if (source_format == gl.GL_RGB):
        height //= 3
    with bind(pbo, texture):
        gl.glPixelStorei(gl.GL_UNPACK_ALIGNMENT, 1)
        gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR)
        gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR)
        gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, texture_format, width, height, 0, source_format, source_type, None)