Perhaps it was the graphical stuff that was taxing my poor old (even slower) CPU way back when. I have not yet tried KDE3 but I heard it’s pretty slick. There are a couple of things I want to implement, though, that I’m not aware of any of them doing. Plus I’m learning a lot about xlib and opengl
No, I actually wrote a test app, that grabbed a context from the root, then started opening windows. And around the third/fourth nearly full screen window, the drawing time went from thousands on the order of 10^3 usecs to seconds. Meaning the first few windows popped up seemingly instantly, but the last took 2-3 seconds to paint. I guess the best way to describe how I’m painting is to show you:
void PaintWindow(Window win, int width, int height)
{
glXMakeCurrent(display, win, cx);
/* Set the Viewport size and use Ortho Mode */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, width, 0, height, 0.0f, 3.0f);
glMatrixMode(GL_MODELVIEW);
/* Cull that back face */
glEnable( GL_CULL_FACE );
glCullFace( GL_BACK );
/* Jump to the Origin and translate just a bit */
glLoadIdentity();
glTranslated( 0, 0, -2);
/***********************************/
/ Start the drawing already /
/***********************************/
glBegin(GL_QUADS);
glColor4f(0.75f, 0.0f, 0.75f, 0.0f);
/* Pretend we’re just painting top/bottom borders */
glVertex3i(0, 0, 2); glVertex3i(width, 0, 2); glVertex3i(width, height, 2); glVertex3i(0, height, 2);
glEnd();
glXSwapBuffers(display,win);
return;
}
This function is called by my ‘Expose’ handler and I am timing it by calling gettimeofday() just before and just after the call to PaintWindow(). The cx used was created from the root. And yes I get the same problem if I just draw the rectangle to a widthx40 region of the window.
I knew that I wasn’t filling up video memory with just the decorations, but dosen’t using an opengl window thats a certain size reserve a certain amount of memory, regardless of what part is rendered to?
I don’t see how it could be a filling problem, my card supports 150Mpixels/sec (I think) and if I did the math right, all the drawing I’m doing should take less than a second. Plus, shouldn’t I see a linear increase in render time of all windows, instead of the last one in a series suddenly taking orders of magnitude longer? Plus I see a CPU hit, which shouldn’t happen if I’m just waiting around for fill right?
I had decided based on my assumptions that I need to only be drawing (at least) four windows (one for each border). I am pretty sure at this point that the textures (in my real application) are staying resident and are used by all windows.
thanks for your help.