Skip to content

[rcore] Add SHADER_LOC_COUNT enum - #6443

Closed
paladin-t wants to merge 1 commit into
raysan5:masterfrom
paladin-t:master
Closed

paladin-t wants to merge 1 commit into
raysan5:masterfrom
paladin-t:master

Conversation

@paladin-t

Copy link
Copy Markdown
Contributor

I suggest adding a SHADER_LOC_COUNT enum at the end of ShaderLocationIndex to mark the valid range of the built-in Shader::locs.

I'd like to realloc Shader::locs in my own program to extend it and append my own definitions after the built-in ones. Of course, I can currently derive the number of built-in loc bindings from SHADER_LOC_VERTEX_INSTANCETRANSFORM, but having such an enum would make the code better.

typedef enum {
    SHADER_LOC_VERTEX_POSITION = 0, // Shader location: vertex attribute: position
    ...
    SHADER_LOC_VERTEX_INSTANCETRANSFORM, // Shader location: vertex attribute: instance transforms
    SHADER_LOC_COUNT
} ShaderLocationIndex;

@raysan5

raysan5 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

@paladin-t I'm afraid raylib does not use that enum convention

@raysan5 raysan5 closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants