RebelSDL screen update "problems"?

Find quick help here to get you started with Hollywood
Bugala
Posts: 1390
Joined: Sun Feb 14, 2010 7:11 pm

Re: RebelSDL screen update "problems"?

Post by Bugala »

I can confirm this doesnt work right on my machine either: Hollywood 10, Windows 11.

What I notice is that it seems that RebelSDL is not able to draw thickness of 1, which is the default that Hollywood uses when using SetFillStyle(#FILLNONE),

If I change it into for example:

Code: Select all

SetFillStyle(#FILLNONE, 2)
Then it works.

But using

Code: Select all

SetFillStyle(#FILLNONE, 1)
doesn't work.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: RebelSDL screen update "problems"?

Post by airsoftsoftwair »

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.
Post Reply