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?
Printable View
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?
Use the SetPixel API function instead of PSet.
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.
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.
use ddraw/d3d?
lookup tables will help, but not as much as changing from dirty pset to fast>> ddraw
> 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!