Hi!
I’ve managed to have a working example of rendering using SDL_Render (to a texture), and rendering the texture to screen using a custom GLSL shader.
You can get it from github, here:
HTH,
Augusto.
Hi!
I’ve managed to have a working example of rendering using SDL_Render (to a texture), and rendering the texture to screen using a custom GLSL shader.
You can get it from github, here:
HTH,
Augusto.
A small note, I developed it using MacOSX, which doesn’t require you to load the GL extensions… I’ll update it using GLEW for Windows/Linux as soon as I can. Feel free to contribute and make pull requests if you feel like doing so!
Hi there! Git repo updated, now it builds and works on Windows too (build done using Visual Studio 2017). Take into account that as there’s no no default library path for SDL2 in Windows, libs, headers and dlls should be placed in ./ext folder. README.txt files are provided for ./ext subfolders, so you know where files should go.
Also, I didn’t use GLEW in the end, sou you can see how GL extensions can be loaded using SDL_GL_GetProcAddress.
Now working on linux too. Tested in a 32bit LUbuntu box. Would be nice to have some feedback about other distros.
Very nice! This is insanely useful for me, as I want to perform post processing if the renderer is not software based.
Do you know how to get this to work on a single texture only, though? From the looks of your example, you clear the renderer before drawing the “shader’d” mesh :(.
Thank you @AugustoRuiz, this is brilliant. All the benefits of the internal SDL_Renderer for fast 2d, but with shader support.
I’m trying to work out if there are any particular downsides, and I can’t think of any!
I guess it means I can’t use Direct3d - but that’s ok for me. Anything else?
I would do without D3D, then it would no longer be cross-platform.