Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / troubel with flickring

Author
Message
swiss guy
16
Years of Service
User Offline
Joined: 4th Feb 2008
Location:
Posted: 5th Feb 2008 03:16
hi, has someone an idea why this short 2D demo flickering. I have tryed a lot of things like paste image, sync and sync rate commands etc. but nothing helps...
Rgs Mike

---

set display mode 800,600,32
hide mouse

create bitmap 1,800,600
set current bitmap 1

REM Blue Line
cls
y=0
For x=0 To 25
inc y, 10
ink rgb(0,0,y),0
Line 0, x, 800 ,x
Next
For x= 25 To 50
dec y, 10
ink rgb(0,0,y), 0
Line 0,x,800,x
Next
Get image 3,0,0,800,50, rgb(0,0,0)
sprite 3,0,0,3

REM red Line
cls
y=0
For x=0 To 25
inc y, 10
ink rgb(y,0,0),0
Line 0, x, 800 ,x,
Next
For x= 25 To 50
dec y, 10
ink rgb(y,0,0), 0
Line 0,x,800,x
Next
Get image 4,0,0,800,50, rgb(0,0,0)
sprite 4,0,0,4

RasterWinkelA=0
RasterWinkleB=180

repeat
set current bitmap 1
cls

paste sprite 3,0,250+250*sin(RasterWinkelA)
paste sprite 4,0,250+250*sin(RasterWinkelA+15)

inc RasterWinkelA,5
inc RasterWinkelB,3
if RasterWinkelA>360 then RasterWinkelA=0
if RasterWinkelB>360 then RasterWinkelB=0

copy bitmap 1,0
wait 50
until inkey$()<>""
end
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Feb 2008 07:01
Start your program with

SYNC ON : SYNC RATE 0
and in your loop, and replace...

WAIT 50

with...

SYNC

Allowing DBP to control the SYNCing only works in limited scenarios.
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 22nd Feb 2008 03:10
yeah using cls even with a minuscule amount of sleep or wait time is too long and will always leave a flicker. Sync is much faster removing the flicker, just be careful of frame rate issues. although with sync rate 0 that wont be much of a problem.

[img="http://lovelyd.shukuya.com/enters/e3.gif"]

Login to post a reply

Server time is: 2024-09-27 10:36:17
Your offset time is: 2024-09-27 10:36:17