Hi,
I am trying to draw 640x480 RBG pixls with a reasonable frame rate. I use GLUT and tested with Linux and Windows. I the my GLUT idleFunc() I do the following:
void redraw() {
glClear(GL_COLOR_BUFFER_BIT);
…
glDisable(GL_ALPHA_TEST);
glDisable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glDisable(GL_DITHER);
glDisable(GL_FOG);
glDisable(GL_LIGHTING);
glDisable(GL_LOGIC_OP);
glDisable(GL_STENCIL_TEST);
glDisable(GL_TEXTURE_1D);
glDisable(GL_TEXTURE_2D);
glPixelTransferi(GL_MAP_COLOR, GL_FALSE);
glPixelTransferi(GL_RED_SCALE, 1);
glPixelTransferi(GL_RED_BIAS, 0);
glPixelTransferi(GL_GREEN_SCALE, 1);
glPixelTransferi(GL_GREEN_BIAS, 0);
glPixelTransferi(GL_BLUE_SCALE, 1);
glPixelTransferi(GL_BLUE_BIAS, 0);
glPixelTransferi(GL_ALPHA_SCALE, 1);
glPixelTransferi(GL_ALPHA_BIAS, 0);
...
glRasterPos2i(0,480-1);
glDrawPixels(640,480,GL_RGB,GL_UNSIGNED_BYTE,pixels);
...
glutSwapBuffers();
}
I have an Athlon 800 with a GeForce and can get at most 20 frames per second with only one 640x480 glDrawPixels() call out of this! With my rendering overhead I have 4 or 5 frames. So I tried this:
void redraw() {
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}
This does ~1200 frames under windows and ~115 frames under Linux (My monitor does only run with 85Hz so I don’t know how this works…)
What can I do to speed this up a LOT? I need 20 frames per second including my rendering overhead.
Thanks in advance
Eddy