   Stupid problem overlaying 2d and 3d graphics
  Ok, so I want to draw a "main menu" type of interface, and I want to have the current scene in the background and darkened.Here's the code I'm using to do that: void openConsole(){ShowCursor(true);int startSecs=GetTickCount();while(GetTickCount() - startSecs < 5000)  // for debug{DrawGLScene();// Start by rendering the old scene// "Darken" the scene by putting a black square over the screenglLoadIdentity();glEnable(GL_BLEND);glDisable(GL_DEPTH_TEST);glColor4f(1.0, 1.0, 1.0, 1.0);glBegin(GL_QUADS);glVertex3f(-1.0, -1.0, -1.0);glVertex3f(1.0, -1.0, -1.0);glVertex3f(1.0, 1.0, -1.0);glVertex3f(-1.0, 1.0, -1.0);glEnd();glDisable(GL_BLEND);glEnable(GL_DEPTH_TEST);SwapBuffers(hDC);}ShowCursor(false);}But there's no darkening effect whatsoever!  Blending is set to:   glBlendFunc(GL_SRC_ALPHA,GL_ONE);Please help![edited by - sirSolarius on February 1, 2004 12:59:07 PM]
  Well, for one... glColor4f(1.0, 1.0, 1.0, 1.0) should be white, and either 100% opaque or 100% transparent (I don''t remember which way OpenGL goes). If you''re seeing no change, I''ll wager that it is at 100% transparent. So, try with 0.5 clear across, and see if you don''t get a halfway-grey image.If you do, set RGB to 0.0, and set alpha to whatever amount of darkening you want. Simple. ;  Oops, sorry... I had turned that on for debugging reasons!Even when I set the color to (0, 0, 0, 0.5), though, I see no difference whatsoever in the image.If I change the color to something like blue or green, though, then the blending works, which is somewhat odd. ;  thats because you set glBlendFunc to glBlendFunc(GL_SRC_ALPHA,GL_ONE) ...FinalColor = SrcColor * 0.5 + DestColor * 1and since your source color is Black, the result is DestColor.it should work if you change the BlendFunc to GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA. ;  Great!  Now, last question: is there any way to save the buffer and "clear" the screen using that, drawing over it and swapping the buffers every frame?  So that I don''t have to call the drawframe function every time?Thanks! ;  you could render the current scene into a texture and put a quad with that texture behind your menu. 