View Full Version : How to simulate a procedure?
04-28-2012, 04:38 AM
I want to simulate a procedure, this means I want to draw sutffes one by one. For example, I want to draw a column first, after that, I want to draw the second column, then the third one, .... Each one should be drawn after the previous one is finished. How to do this? How to control it?
04-28-2012, 07:24 PM
This is basically a program logic problem. You need to know what objects to render in the display pass. A simple list of objects to render that you add to will work
04-29-2012, 10:45 PM
Perhaps I didn't get myself understood well. I want to darw a column, then there will be some delay(one or two seconds), then draw the second colunm, .... I already have the logic fixed. I just need the technology the do so.
04-30-2012, 05:13 AM
I don't quite understand you problem. Do you not know how to do the delays or not know how to break you draw function into a set of draws?
04-30-2012, 06:42 AM
You already have the technology, you just need the logic.
In your display function :
if (timeToDrawColumnA) drawColumnA;
if (timeToDrawColumnB) drawColumnB;
if (timeToDrawColumnC) drawColumnC;
You can do that procedurally depending of your case, ex :
for i in 0 to n :
if (timeToDrawColumn(i)) drawColumn(i);
05-01-2012, 04:33 AM
I don't know how to do the delays.
05-01-2012, 05:17 AM
Use a clock or a counter. The windows API offers the use of system clocks or other related timing functions.
This one's quite useful - getTickCount(). Returns the number of milliseconds since Windows was started.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.