RebelSDL screen update "problems"?
Posted: Sun Apr 07, 2024 10:29 pm
Hello,
I noticed ome things that I cant know why happens using RebelSDL relative to the code attached:
1 - I've a 165Hz monitor but changing the "SetInterval(Nil, p_Scroll, 1000/x)" x value above 60 dont seems to do any difference...setting lower values slow down object velocity, but increasing above 60 dont seems to do anything...also setting up the EnableVSync TAG To "False"...my mistake or some RebelSDL limitation?
2 - Why if I use "UseDesktopFullScreen = True" TAG the moving object left the trails on the screen like if the old brush displayed wasnt cleared? I must add the Cls() command to have a right behaviour(changing also background color).
3 - Have same "trail" problem If I add then "ForceFullRefresh = True" TAG, in that case the screen wasnt cleared automatically before new Flip()?
4 - As you can see in the code I tryed to write to a brush instead than the display than write the objects directly to the screen...but that dont seems to work...or better... if I write the brush with the command "DisplayBrush(1, 0 ,0)", after endselectI got only the "empty" brush that overwrite everything else...but if I write to the brush without display it on the screen seems to work(If I do "CreateBrush(1, 640, 180, #RED, {Hardware = True})", I see only a piece of the blitted objects on the screen like I created as mask for the visible opbjects on screen...), to me that was a a weird behaviour...probaly I do some mistake realted to hardware brushes since doing the thing on software works, but cant recognize it in the manual...
Here the code and assets to try it...
https://app.box.com/s/lzo2gsow489n8nc6z12ba6u0c3fmu3vk
I noticed ome things that I cant know why happens using RebelSDL relative to the code attached:
Code: Select all
x = 0
@REQUIRE "rebelsdl", {Link = True, EnableVSync = False};, ForceFullRefresh = True};, UseDesktopFullScreen = True}
@DISPLAY 1, {Width = 640, Height = 480, Color = $444444};, Mode = "FullScreen"}
BOAR_HIT = LoadBrush(Nil, "TestDATA/BOAR_HIT_3X2.png", {LoadAlpha = True, Hardware = True})
BOAR_RUN = LoadBrush(Nil, "TestDATA/BOAR_RUN_3X2.png", {LoadAlpha = True, Hardware = True})
BOAR_WALK = LoadBrush(Nil, "TestDATA/BOAR_WALK_3X2.png", {LoadAlpha = True, Hardware = True})
Function p_draw()
Cls()
;SelectBrush(1)
DisplayBrush(BOAR_HIT, 20, 70)
DisplayBrush(BOAR_RUN, x, 120)
DisplayBrush(BOAR_WALK, 20, 170)
;EndSelect()
EndFunction
Function p_add()
x = x + 1
EndFunction
Function p_Scroll()
p_add()
p_draw()
;DisplayBrush(1, 0 ,0)
Flip()
EscapeQuit(True)
EndFunction
BeginDoubleBuffer(True)
CreateBrush(1, 640, 480, #RED, {Hardware = True})
;DisplayBrush(1, 0 ,0)
Scroll = SetInterval(Nil, p_Scroll, 1000/60) ; imposto la velocità di refresh
Repeat
WaitEvent
Forever2 - Why if I use "UseDesktopFullScreen = True" TAG the moving object left the trails on the screen like if the old brush displayed wasnt cleared? I must add the Cls() command to have a right behaviour(changing also background color).
3 - Have same "trail" problem If I add then "ForceFullRefresh = True" TAG, in that case the screen wasnt cleared automatically before new Flip()?
4 - As you can see in the code I tryed to write to a brush instead than the display than write the objects directly to the screen...but that dont seems to work...or better... if I write the brush with the command "DisplayBrush(1, 0 ,0)", after endselectI got only the "empty" brush that overwrite everything else...but if I write to the brush without display it on the screen seems to work(If I do "CreateBrush(1, 640, 180, #RED, {Hardware = True})", I see only a piece of the blitted objects on the screen like I created as mask for the visible opbjects on screen...), to me that was a a weird behaviour...probaly I do some mistake realted to hardware brushes since doing the thing on software works, but cant recognize it in the manual...
Here the code and assets to try it...
https://app.box.com/s/lzo2gsow489n8nc6z12ba6u0c3fmu3vk