Hi! I've been learning some programming with the SDL libraries and I've encountered a problem, whenever I debug the project, the window shown flickers with the image I'm trying to render and it doesn't respond (shows the loading cursor symbol) also the console window doesn't even open at all, I'm just starting to learn the code so hopefully it won't be a big problem to find the problem, here's the code:
I'm not practical with 2.0, but it seems like you're rendering the screen after you clear it, which should show some kind of 'empty' image that gives that flickering effect.
The window should be irresponsive because you're not processing the events correctly. Take a look at this http://wiki.libsdl.org/SDL_PollEvent .
The console window might not show up if you use an IDE and have selected a GUI project. What are you using?
It's better if you remove the first call to RenderPresent() instead of RenderClear(). Usually you clear the screen and redraw the whole scene (I can't tell you why, but that's how tutorial do it).
IIRC Win32 projects are those that don't spawn a console. Try switching to "console project" or something like that.
It's more because the contents of the frame buffer is undefined after you present. A present typically doesn't "copy" the image anywhere, it just swaps out which buffer is used for the display.
Often times with double buffering there are 2 buffers. You draw to buffer 1 while buffer 2 is displayed on screen and vice versa. A "present" merely switches which one you're rendering to.
Failure to clear before you draw means you might get fragments from 2+ frames ago (not necessarily the prev frame). But again, since implementation may vary depending on the hardware, there is no guarantee of this. On triple-buffering hardware you might get something entirely different.