Hello I am making a double buffer in C# and I need to find out a formula to plot the X and Y coordinates in my array. Currently I am using a loop to plot my X and Y but it takes along time to do it. (NOTE I CANNOT USE A MULTI DIMENSIONAL ARRAY!!!)
Asked
Active
Viewed 1,611 times
2 Answers
2
int[] buffer = new int[width * height];
void Plot(int x, int y, int color)
{
buffer[y* width + x] = color;
}
EDIT
To plot longer blocks you could use the Array.Copy functions
If that is still too slow you could fallback to unsafe code to fill the array

Emond
- 50,210
- 11
- 84
- 115