[Solved] SDL_GL_SwapWindow is not working for me

Hi there,

I’m building an engine using SDL and drawing with OpenGL.

The thing is that I got my render loop working but It doesn’t show anything in screen beyond the glClearColor.
I know you already wondering thousand of things that I did bad or not did at all for getting nothing in screen, but my concern about SwapWindow comes from debugging with RenderDoc. RenderDoc shows me the frame buffer with the actual sprites which Im drawing, so because of that I think is not a issue with my render loop, still I can be wrong but I would like to know why RenderDoc shows me the frame buffer filled and, in other hand, my screen doesn’t show that result.

My working platform is Windows 10.

Thanks in advance!

Unfortunately we’ll need to see a sample of your code to figure out what the problem might be, since the problem can be all the way from the creation of your program to the end of the graphical pipeline.
If you’re using shaders, you’ll need to show them aswell.

Just to eliminate the least likely error, does testgl2.c work for you? It comes bundled in the SDL source, and should be relatively straight forward to compile. If you can compile and run it, and nothing shows up in the window, we can know that it at least isn’t an SDL binary or odd driver issue.

Yo @Daniel1985 and @Alex_Barry , first of all thanks for your concerns.

@Daniel1985 I just wanted to know If there were some known issues around SwapWindow, because of that, I didn’t put code here in first instance.

Now, maybe you are glad to know I resolved the problem. It wasn’t nothing to do with SDL but my OpenGL code. I debugged putting glGetError after every GL call (in order to see If the call generated an error) so I could narrow the hunt until the doomed call. The error was that I was trying to bind a bad-builded VAO, I generated the array with glGenBuffers instead of proper function (glGenVertexArrays).

I apologize for the waste of time, I though my code was good cause OpenGL didn’t complain :frowning: my fault anyway.