From 9bf51471dfbd4fab559a6664d48e2a0bd57cfd56 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 22 Sep 2023 02:13:55 +0200 Subject: [PATCH 1/2] Fix incorrect data types for unsigned ints --- arcade/gl/types.py | 8 ++++---- arcade/gl/vertex_array.py | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arcade/gl/types.py b/arcade/gl/types.py index f2ba7c2c9..1b35eca02 100644 --- a/arcade/gl/types.py +++ b/arcade/gl/types.py @@ -214,10 +214,10 @@ class BufferDescription: "f4": (gl.GL_FLOAT, 4), "f8": (gl.GL_DOUBLE, 8), # Unsigned integers - "u": (gl.GL_FLOAT, 4), - "u1": (gl.GL_FLOAT, 1), - "u2": (gl.GL_FLOAT, 2), - "u4": (gl.GL_FLOAT, 4), + "u": (gl.GL_UNSIGNED_INT, 4), + "u1": (gl.GL_UNSIGNED_BYTE, 1), + "u2": (gl.GL_UNSIGNED_SHORT, 2), + "u4": (gl.GL_UNSIGNED_INT, 4), # Signed integers "i": (gl.GL_INT, 4), "i1": (gl.GL_BYTE, 1), diff --git a/arcade/gl/vertex_array.py b/arcade/gl/vertex_array.py index b3af1cb57..46de327e7 100644 --- a/arcade/gl/vertex_array.py +++ b/arcade/gl/vertex_array.py @@ -13,7 +13,14 @@ if TYPE_CHECKING: # handle import cycle caused by type hinting from arcade.gl import Context -index_types = [None, gl.GL_UNSIGNED_BYTE, gl.GL_UNSIGNED_SHORT, None, gl.GL_UNSIGNED_INT] +# Index buffer types based on index element size +index_types = [ + None, # 0 (not supported) + gl.GL_UNSIGNED_BYTE, # 1 ubyte8 + gl.GL_UNSIGNED_SHORT, # 2 ubyte16 + None, # 3 (not supported) + gl.GL_UNSIGNED_INT # 4 ubyte32 +] class VertexArray: From 61f7f4808f3905fa36c964256a8e0c86dd73c2fe Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 22 Sep 2023 02:16:33 +0200 Subject: [PATCH 2/2] Fix broken log message in atlas --- arcade/texture_atlas/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arcade/texture_atlas/base.py b/arcade/texture_atlas/base.py index f1a20c7b2..f4b808cc7 100644 --- a/arcade/texture_atlas/base.py +++ b/arcade/texture_atlas/base.py @@ -440,7 +440,7 @@ def add(self, texture: "Texture") -> Tuple[int, AtlasRegion]: region = self.get_texture_region_info(texture.atlas_name) return slot, region - LOG.info("Attempting to add texture: %s | %s", texture.atlas_name) + LOG.info("Attempting to add texture: %s", texture.atlas_name) # Add the image if we don't already have it. # If the atlas is full we will try to resize it.