Conversation
48005b5 to
1887c78
Compare
bf6166c to
0e56aec
Compare
Merged
0e56aec to
defe5d1
Compare
The association of a VBO to an array is to be saved in the client state: we should look up the VBO only when we draw some geometry. The error was discovered running the cube_tex example (it will be added to the repo in a later commit), which uses two different VBOs for the position and texture coordinate attributes.
This example uses SDL2 and glm. At the moment this example does not work on the Wii/GameCube, as the textured rendering using OpenGL 2.0 will come in a later commit. The "common" directory contains textures that get embedded into the executable, so that examples can be written without access to external files (which makes testing on the console -- or on the emulator -- very straightforward).
Colors are often specifies as a 3 or 4 long vector of floats, but GX does not support specifying colors using floating point components. Therefore, convert such values to GXColor.
The data here is just an integer number representing the texture unit bound to the uniform.
This is all what is needed to let the client developer write a GX shader capable of supporting textured geometries.
This is a bit primitive, because we are hardcoding the texture stage and other TEV variables (we'll improve this later), but it does the job.
To make clear that these functions are to be called only when implementing shaders in the client code, rename them to have a "ogx_shader" prefix. Also use the "_gx" or "_gl" suffix to indicate whether they expect the matrix to be in the GX or OpenGL format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support for using textures in OpenGL 2.0 shader implementations.
Built on top of #99, it must be merged after that.