I'm trying to develop a 3d graphics engine, i use a framebuffer class which is of my own creation but the fps is too low, and i think it's because i use putpixel() function from winbgim library,
my function to show framebuffer on screen is:
void framebuffer::showonscreen() //from buffer to screen(space to space 1d to 2d)
{
int i;
for(int y=0; y < length; y++)
{
for(int x=0; x < width; x++)
{
i = x + screeny[y];
putpixel(x, y, colbuf[i]);
}
}
}
Is there any alternative to this putpixel function or a technique to speed it up, or any other manual(without using libraries) way
I heard about giving a direct access to memory blocks, or using the vram
Would any one know how to help me in this problem?
Please, HELP is appreciated.