I've been trying to have text rendering in my OpenGL scene using SDL2. The tutorial I came across is this one Rendering text

I followed the same code, and I get text rendering fine. However the issue I'm having is that there is obviously a "conflict" between the OpenGL rendering and the SDL_Renderer used in the code. When I run my scene the text displays but everything else keeps flickering. The following gif shows the issue:

enter image description here

Any idea on how to overcome this while still just using SDL2 and OpenGL, not another library or anything.



There is a problem using SDL_Renderer with OpenGL. You can save the text to a Surface, and then use this example: http://www.sdltutorials.com/sdl-tip-sdl-surface-to-opengl-texture

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.