liquidev / aglet

A safe, high-level, optimized OpenGL wrapper and context manager.
MIT License
29 stars 2 forks source link

Fix for integer `Vec[T]` vertex attributes being passed as `GL_NONE` #16

Closed JohnDoneth closed 3 years ago

JohnDoneth commented 3 years ago

Closes #15

toGlEnum no longer always passes 0 / GL_NONE to glVertexAttribIPointer for integer Vec[T] vertex attributes as it's called on the correct variable.

Additionally, when trying to use an integer type that is unsupported in Vec[N, T] types like uint64:

type
  Vertex = object
    position: Vec[2, float32]
    uv: Vec[2, float32]
    color: Vec[4, uint64] # <--- Unsupported

The following error is produced:

Error: unsupported vertex field type: <Vec[4, system.uint64]>
liquidev commented 3 years ago

Looks good, merging.