Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: How to simulate a procedure?

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2011
    Posts
    21

    How to simulate a procedure?

    Hi.
    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?
    Thanks.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    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

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2011
    Posts
    21
    Hi.
    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.
    Thanks.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    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?

  5. #5
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,580
    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);
    endfor

  6. #6
    Junior Member Newbie
    Join Date
    Aug 2011
    Posts
    21
    Hi.
    I don't know how to do the delays.

  7. #7
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,169
    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.
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •