OpenGL Shader in SDL Platform Game?

Hello! I am new to SDL and just got a simple platform game with wall jumping and music to run:

http://s18.postimg.org/k31mjej1h/Screen.jpg

I have spent a lot of time trying to figure out how to implement an OpenGL Shader into this game. I use SDL_Surfaces rendered with an SDL_Renderer. I an OpenGL context initialized in my SDL program, and my question is: How do I set up OpenGL fragment shaders so that they will shade what SDL renders?

My plan is to use a God Ray shader, like the one used here: http://xnauk-randomchaosblogarchive.blogspot.com/2012/10/2d-crepuscular-god-rays.html.
Last edited on
This isn't an SDL question, but it's an OpenGL Context question. Consider using the GLEW library for loading modern OpenGL extensions (if you plan on using shaders higher than OpenGL 2.1's), you can also manually load them yourself.

I think you're unable to modify SDL's rendering with shaders (You may, but it'll take a bit of hack). I'm unsure about this, hopefully someone can correct me.
That's right, it s an OpenGL Context question!

So say I want the God Rays to come from the sun.

If I drew my scene with SDL_Surfaces all to 1 surface, then bound that surface to a GL quad, could I then use my shader on that quad and draw the sky with openGL?

Like this?
http://s28.postimg.org/g1a063ze5/Untitled_1.jpg
Topic archived. No new replies allowed.