Skip to content
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

Implement VBOs #78

Merged
merged 7 commits into from
Nov 3, 2024
Merged

Implement VBOs #78

merged 7 commits into from
Nov 3, 2024

Conversation

mardy
Copy link
Collaborator

@mardy mardy commented Oct 31, 2024

Vertex buffers is a feature from OpenGL 1.5, but also present in older GL versions as an extension.

Move the vertex format setup to the array reader classes, as well as
writing into the GX pipe. This not only buys us a little of performance,
but having the array reading code next to the pipe writing allows us to
implement improvements and new functionality more easily: for example,
the SameTypeVertexReader classes store the vertex data as bytes of
shorts into the GX pipe, if this is the data format specified by the
client.

This is also a step in the direction of implementing vertex buffers,
since we should now be able to add a VertexReader subclass that handles
indexed arrays (using GX_SetArray()).
The buffers are still disconnected from the drawing functions, this will
come in a later commit.
Update the vertex data pointer in the VertexReader classes to point to
the VBO data.
This is officially part of OpenGL 1.5, but it can be used in older
versions too, as an extension.
If the GL format is natively supported by the GX API, we can use the
GX_SetArray() function on the VBO data and then specify the elements as
indices.
Add also all the other OpenGL 1.5 functions, though leave them commented
out until we implement them.
Instead of adding duplicate entries for functions that were originally
added as ARB extensions, just try to remove the ARB suffix, if we find
it (e.g., when asked to lookup "glGenBuffersARB" we will look for
"glGenBuffers").
@WinterMute WinterMute merged commit c3f47fe into devkitPro:master Nov 3, 2024
2 checks passed
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