   glDrawPixels draw order
  I've written a simple graphics engine and have been using it to make games successfully for over a year. But in my current project I want to use glDrawPixels to draw a background that changes as you play, and affects the game in interesting ways. Anyway, here is the code that does the drawing:clear();glTranslatef(-0.5,-0.5,-0.5);glWindowPos2i(0,0);glDrawPixels(RESX,RESY,GL_RGBA,GL_UNSIGNED_BYTE,(GLvoid *)background);DrawSprite();SwapBuffers(hDC);Running this draws the background but nothing else, so I tried running it with only half the background being drawn:glDrawPixels(RESX/2,RESY,GL_RGBA,GL_UNSIGNED_BYTE,(GLvoid *)background);and discovered that glDrawPixels draws over the top of my sprites, which is really strage considering that glDrawPixels is called before DrawSprite. Next, I tried reversing the drawing order, so that the sprites are drawn before the background, and now I get a more sensible result, with the sprites only being seen if I make part of the background transparent.Any ideas how glDrawPixels can draw over the top of something that hasn't been drawn yet?   
  Maybe it helps if you disable the Z buffer when drawing. Even though the documentation for glDrawPixels does not say if it writes to the Z buffer (unless format is set to GL_DEPTH_COMPONENT)   ;  That got it. Thanks heaps!   