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 / Can you render a page and then only when finished then show it? Sync command?

Author
Message
NeilF
18
Years of Service
User Offline
Joined: 2nd Aug 2006
Location:
Posted: 17th Aug 2006 11:14
Let's say I'm moving a white pixel across the screen:-
a) Paint the white pixel
b) Then remove the white pixel
c) Then paint the white pixel in the new position

This of course works, but you'd get flickering.

Ideally, you'd
a) Paint the white pixel
b) Present this page/screen
c) Then remove the white pixel
d) Then paint the white pixel in the new position
e) Then present this page/screen

So the use only witnesses the completed move, and never see the white dot being removed.

Can this be done? Is this what the SYNC command does?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Aug 2006 11:46
If you...

SYNC ON : SNC RATE 60
then you control when the screen is synced. SYNC is the command that does this. In this example, the maximum sync rate is 60 frames per second. Anty faster and the program will suppress the frame rate.



NeilF
18
Years of Service
User Offline
Joined: 2nd Aug 2006
Location:
Posted: 17th Aug 2006 12:33
So if I painted a thousand white dots and SYNC'd, then cleared the screen an repeated....

I wouldn't see any flickering (ie: the clear screen) cos the SYNC presents the screen only when I dictate?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 17th Aug 2006 12:43
just out of curiosity what kind of video card do you have mate?

NeilF
18
Years of Service
User Offline
Joined: 2nd Aug 2006
Location:
Posted: 17th Aug 2006 12:51
ATI800XT... Why?
NeilF
18
Years of Service
User Offline
Joined: 2nd Aug 2006
Location:
Posted: 17th Aug 2006 12:56
On this subject... Having just got DBPro, I'm looking at giving myself a few simple projects to get me into it.

One of them - hence the question above - is to write a simple 3D star field (like the Windows screensaver). I wrote one MANY years ago but that was in machine code The field would be true 3D with path of flight changing other than straight ahead.

What's the best approach in DBPro? To use pixels and handle the 3D element myself. Or would DBPro lend itself to a different technique? (eg: Sprites, and can it help with the X,Y,Z 3D element as well)?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Aug 2006 18:13
A particle generating routine is what you seem to be describing. Do a search on "Particle" in the various boards, you'll find lots of info.



Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 17th Aug 2006 20:56
You can assemble as many things as you want to, and render them with the "Sync" command. It's the perfect control mechanism for smooth rendering control.

For your starfield, you are considering using pixels to represent stars. If you positioned thousands of pixels, then synced, it would work like you want.

However, using particles, and Batvink suggested, would be a much better way of doing it. Basically, you could use textured 3D plains as stars. The plains would face the camera, producing the perfect 3D effect for such a thing. It would be far more impressive than pixels, as you could use images rather than pixels to represent your stars.


Come see the WIP!

Login to post a reply

Server time is: 2024-09-25 07:35:31
Your offset time is: 2024-09-25 07:35:31