functions: add a couple of missing stubs - #113
Open
mardy wants to merge 4 commits into
Open
Conversation
The SDL3 test program testgl[1] loads all the GL functions declared in the render backend[2] and fails to start if any of these fail. Exporting these two functions allows the testgl program to run. [1]: https://github.com/libsdl-org/SDL/blob/main/test/testgl.c [2]: https://github.com/libsdl-org/SDL/blob/main/src/render/opengl/SDL_glfuncs.h
This is completely missing out the alpha function, but is good enough to make the SDL3's OpenGL renderer to work.
Restore the condition check as it was before commit 6a474f8 (fbo: implement FBO API). Unfortunately that commit does not explain why this change was made, it may also be that it was only needed during certain stages of development; by itself, the change does not make much sense and it break at least one very simple use case: 1. Bind an empty texture to the FB (let's call it "A") 2. Draw a couple of textures 3. Unbind the FB 4. Draw the texture "A" on the screen 5. Error: the first texture drawn in point 2 will be vertically flipped This is what happens running SDL3's testrendercopyex.c test using the OpenGL render backend (backed by opengx). This commit fixes that case.
Improve the way the FBO module is used: 1. Add FBO functions (both with the OpenGL 3.0 name and with the older "EXT" suffix) to the ogx_get_proc_address() lookup tables. This is done only if the FBO module is actually used, using the same weak symbol trick we use for the shader functions. 2. Add a ogx_enable_module_fbo() function that the client can call to force the inclusion of the FBO code. This function also registers the GL_EXT_framebuffer_object extension. With these changes the OpenGL renderer backend in SDL3 can be used with opengx without any changes (other than calling ogx_enable_module_fbo() in its initialization code).
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.
The SDL3 test program testgl1 loads all the GL functions declared in the render backend2 and fails to start if any of these fail.
Exporting these two functions allows the testgl program to run.
UPDATE: I added a few more commits to fix/improve the FBO code. With these, the SDL3's renderer backend using OpenGL correctly works with opengx. We are most likely not going to use it (I'll port the GX backend we have in SDL2), but it's good to know that it's a working option.