Skip to content

Gl attrib type fix #1907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions arcade/gl/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
9 changes: 8 additions & 1 deletion arcade/gl/vertex_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arcade/texture_atlas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down