Tuxedo wrote: ↑Fri Jun 21, 2024 10:10 pm
The #FILLNONE constant simply draws nothing....
Yes, that's a limitation of RebelSDL. It only supports the #FILLCOLOR fill style when drawing to a hardware double buffer.
Tuxedo wrote: ↑Fri Jun 21, 2024 10:10 pm
If I understand right you explained me that evertytime you call
Flip() in RebelSDL it swaps the 2 buffers, so you only will se one of the 2 at time so...in the code above I have to see at every left mouse press the red or green box right? Why instead they was simply displayed in sequence and than always present at screen?
True, looks like this is implementation-defined. The SDL documentation says that after flipping the backbuffer to the screen, you can't make any assumptions about what is in the backbuffer:
The backbuffer should be considered invalidated after each present; do not assume that previous contents will exist between frames. You are strongly encouraged to call SDL_RenderClear() to initialize the backbuffer before starting each new frame's drawing, even if you plan to overwrite every pixel.
In your case the backbuffer seems to preserve what you've drawn into it but that needn't be the case. In could also contain random pixel junk depending on the architecture and graphics driver used. Remember that when using hardware double buffer you are operating at a very low level and you're very much interacting directly with the GPU.
So for RebelSDL this means that you should definitely call
Cls() right after
Flip() because
Cls() will call SDL_RenderClear(). If you don't do it, you can run into all sorts of issues depending on the architecture and graphics driver.