سؤال

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

http://postimg.org/image/k31mjej1h/

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

هل كانت مفيدة؟

المحلول

You should do it like it was a pure OpenGL application but you need to add the SDL_WINDOW_OPENGL flag when creating the window so you application will use OpenGL not DirectX or some other rendering library!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top