performance - How to get high frame rate while using putpixel() in C? -


i working code print pixels.

//c code

#include<graphics.h> #include<conio.h>  int main() {   int gd = detect, gm;   initgraph(&gd, &gm, "c:\\tc\\bgi");   (int i=0;i<100;i++)   {    for(j=0;j<200;j++)     {      putpixel(i, j, green);      }    }   getch();  closegraph();  return 0; } 

is there way of achieving faster response c compiler while using putpixel() in code? speed console gets colored execution of putpixel() pretty slow, wondering if there other library use speed printing pixel process on screen using c on windows system or linux one?

putpixel() pretty slow, no matter framework or library use. try create bitmap , calculate memory address of each pixel yourself.

cross-platform frameworks allow such thing sdl , allegro.

see also:


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -