Python: Remove deprecated BGL API
The API was in a deprecation state for many years now. This API was not compatible with Metal nor Vulkan. This also remove `Image.bindcode`. Pull Request: https://projects.blender.org/blender/blender/pulls/140370
This commit is contained in:
committed by
Clément Foucault
parent
9ddc67166f
commit
decd88f67e
@@ -89,14 +89,6 @@ def draw_texture_2d(texture, position, width, height):
|
||||
gpu.matrix.scale((width, height))
|
||||
|
||||
shader = gpu.shader.from_builtin('IMAGE')
|
||||
|
||||
if isinstance(texture, int):
|
||||
# Call the legacy bgl to not break the existing API
|
||||
import bgl
|
||||
bgl.glActiveTexture(bgl.GL_TEXTURE0)
|
||||
bgl.glBindTexture(bgl.GL_TEXTURE_2D, texture)
|
||||
shader.uniform_int("image", 0)
|
||||
else:
|
||||
shader.uniform_sampler("image", texture)
|
||||
shader.uniform_sampler("image", texture)
|
||||
|
||||
batch.draw(shader)
|
||||
|
||||
Reference in New Issue
Block a user