jdc {l Wrote}:The drawing of pixels is in functions, this is something that could slow down the performance by a lot. This functions is called “N” hundreds of time.
I am still not sure that "The Box" is supposed to be, but instead of using a function to draw points, you could have the buffer as array, and set the pixels by writing to an index or pointer into the buffer. When you are done with drawing a frame, copy the buffer into the screen buffer, this is much faster.
In C (assuming this is C) you can use macros for that like:
- {l Code}: {l Select All Code}
#define SET_PIXEL(x,y,col) buffer[(x)+(y)*scanline_size]=(col)
#define GET_PIXEL(x,y) (buffer[(x)+(y)*scanline_size])
Remember, function calls cause stack operations in machine code, so simple funktions that are called often can be converted to macros, for better performance.