What do you mean when you say “apply the shader just before swapping the
window by calling SDL_RenderPresent() (and restore it after)”?
You cannot use a shader to modify the contents of the default framebuffer.
If you want to apply it as a post-processing step (as you seem to imply
here), you’ll need to render your whole scene into a texture and then use
that texture as an input to your shader.
2013/12/6 vlag <valentin.soudier at gmail.com>> Yeah, thanks for the code sample, it’s really helpful [image: Smile]
By the way, I tried to work with shader the last few days, and I’ve not
reached my goal to apply a shader when rendering.
It work fine when I copy a Gl texture or a SDL_Texture to the renderer,
but not if I try to apply the shader just before swapping the window by
calling SDL_RenderPresent() (and restore it after).
It also don’t work if I try with the SDL official shader exemple, where we
just use the OpenGL API.
Do you confirm that it is really possible to apply a shader when
rendering, or should I apply and restore the shader at each SDL/OpenGL draw
to the renderer?
SDL mailing list
SDL at lists.libsdl.org