PDA

Click to See Complete Forum and Search --> : Speed


thevbuser
Nov 12th, 2000, 06:19 PM
How do i speed the pixelation of my program.
Im makeing the backround with mathematical function and pset.
how could i speed this process up without using image files?

schnarf283
Nov 12th, 2000, 08:23 PM
Use the SetPixel API function instead of PSet.

/\/\isanThr0p
Nov 13th, 2000, 09:46 AM
I dont know what kind of mathfunctions you use. But on some it would be useful to create a look-up table. This is only interesting when you have to do the mathfunction multiple times, or your pic will be really big. Also it only works good on 8-bit color.

Mad Compie
Nov 16th, 2000, 02:23 PM
If the results are always the same (like Sin & Cos from 0 to 360 degrees) you can put the calculation results in an array while loading the form.
Then, when using these values, you simply have to read them from the array (which speeds up very muchy!).
Example: moving a string around a certain circle's centerpoint -> no more floating point calculations needed anymore.So, I agree with /\/\isanThr0p.

KENNNY
Nov 16th, 2000, 02:31 PM
use ddraw/d3d?
lookup tables will help, but not as much as changing from dirty pset to fast>> ddraw

/\/\isanThr0p
Nov 16th, 2000, 05:20 PM
> Kenny

That depends very much on the calculations! And DDraw isn't that fast in windowed mode (it still would help), so if the app needs windows mode, you can use pset! If it does not require windows mode you really have to switch!