Advertisement

delaying stuff....and lens effect?

Started by December 09, 2000 04:24 PM
7 comments, last by tidilipom 23 years, 11 months ago
Mmkey, i wanna add a kind off delay until the next thing happens...(eg: drawing 1 quad, then after 0.5s another one appears) I am using VC++ 5.0 I also wonder how one would go about and do a lens/magnifying effect...? Thanks Edited by - tidilipom on 12/9/00 4:38:26 PM
--Peace.
  #include <mapiwin.h>...for (int i=0; i<10; i++){DrawCube(size, x, y);Sleep(DWORD dwMilliseconds);}  

try that the Sleep() function suspends execution for the program for dwMilliseconds but beware--if you have other things to draw they will be suspended too.

oglperson



Open mouth, insert foot
Advertisement
That won''t work if you want a new quad to be added every .5s or whatever.
Do something like this:

  int NumQuads;int NumFrames;//In your main loop:NumFrames++;if(NumFrames % FRAMES_BETWEEN_ADDING_QUADS)    NumQuads++;DrawQuads(NumQuads);  


..Or something like that
why wouldnt it Quantum... your on the right track, but you can still use the sleep function and keep it allot easier ie
  int timetosleep=500; //time is in milliseconds so 500 is .5 sint quads=0;for (quads=0;quads <=200 /*whatever max quads is*/;quads ++){drawquad();sleep(timetosleep);}//rest of program  

Well it depends on what tidilipom is doing. If he wants to do anything else, such as rotate the object while adding stuff, sleep is a BAD (and stupid) idea. It is also bad practice, because it is nearly usless for anything else.

Quantium is on the right track, but it could probably be improved.

ANDREW RUSSELL STUDIOS
Web site coming soon...
Oh, and Lenses would need both a great deal of software rendering, which means it is SLOW. Even on a good computer, a lens is relitavly slow.

ANDREW RUSSELL STUDIOS
Web site coming soon...
Advertisement
if you want to do lens effects, a cheap way to do it (but still looks wicked) is to render them first with a program like Universe (www.diadardsoft.com), then make a texture. Universe will generate the lens effect for you. Then just load it into your program. Say your light was at (0, 10, 0), then you would just draw that bitmap overtop of that point
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"
oops i typed that URL wrong
the real URL is:
http://www.diardsoftware.com
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"
oops i typed that URL wrong
the real URL is:
http://www.diardsoftware.com

just the shareware version is online
if you are slick you can find a crack
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"

This topic is closed to new replies.

Advertisement