   line overwrite
  Hi. I am working on an MFC Dialog Based OpenGL Application. I use double buffering. My problem is: I have a gridline in grey and when I draw another line (which is yellow) on top of it, my new line does not completely cover the old one. I see some random grey points on yellow. My pixel format is as below. Does anyone know how I can fix this problem?BOOL CMyDlg::SetWindowPixelFormat(HDC hDC){PIXELFORMATDESCRIPTOR pfd;pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); // Size of this pfdpfd.nVersion = 1; // Version number : must be 1pfd.dwFlags = PFD_DRAW_TO_WINDOW | // Support windowPFD_SUPPORT_OPENGL | // Support OpenGLPFD_DOUBLEBUFFER | // Double bufferedPFD_STEREO_DONTCARE; // Support either monoscopic or stereoscopicpfd.iPixelType = PFD_TYPE_RGBA; // RGBA typepfd.cColorBits = 0; // Specifies the number of color bitplanes in each color bufferpfd.cRedBits = 0; // Specifies the number of red bitplanes in each RGBA color bufferpfd.cRedShift = 0; // Specifies the shift count for red bitplanes in each RGBA color bufferpfd.cGreenBits = 0; // Specifies the number of green bitplanes in each RGBA color bufferpfd.cGreenShift = 0; // Specifies the shift count for green bitplanes in each RGBA color bufferpfd.cBlueBits = 0; // Specifies the number of blue bitplanes in each RGBA color bufferpfd.cBlueShift = 0; // Specifies the shift count for blue bitplanes in each RGBA color bufferpfd.cAlphaBits = 0; // Specifies the number of alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supportedpfd.cAlphaShift = 0; // Specifies the shift count for alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supportedpfd.cAccumBits = 0; // Specifies the total number of bitplanes in the accumulation bufferpfd.cAccumRedBits = 0; // Specifies the number of red bitplanes in the accumulation bufferpfd.cAccumGreenBits = 0; // Specifies the number of green bitplanes in the accumulation bufferpfd.cAccumBlueBits = 0; // Specifies the number of blue bitplanes in the accumulation bufferpfd.cAccumAlphaBits = 0; // Specifies the number of alpha bitplanes in the accumulation bufferpfd.cDepthBits = 0; // Specifies the depth of the depth (z-axis) bufferpfd.cStencilBits = 0; // Specifies the depth of the stencil bufferpfd.cAuxBuffers = 0; // Specifies the number of auxiliary buffers. Auxiliary buffers are not supportedpfd.iLayerType = PFD_MAIN_PLANE; // Ignored. Earlier implementations of OpenGL used this member, but it is no longer usedpfd.bReserved = 0; // Specifies the number of overlay and underlay planespfd.dwLayerMask = 0; // Ignored. Earlier implementations of OpenGL used this member, but it is no longer usedpfd.dwVisibleMask = 0; // Specifies the transparent color or index of an underlay planepfd.dwDamageMask = 0; // Ignored. Earlier implementations of OpenGL used this member, but it is no longer usedint m_GLPixelIndex = ChoosePixelFormat(hDC, &pfd;// Attempts to match an appropriate pixel format supported by a device context to a given pixel format specificationif(m_GLPixelIndex == 0) // Choose default{m_GLPixelIndex = 1;if(DescribePixelFormat(hDC, m_GLPixelIndex, // Obtains information about the pixel format identified by iPixelFormat of the device associated with hdcsizeof(PIXELFORMATDESCRIPTOR), &pfd)==0)return FALSE;}if(!SetPixelFormat(hDC, m_GLPixelIndex, &pfd)) //Sets the pixel format of the specified device context to the format specified by the iPixelFormat indexreturn FALSE;return TRUE;}Note: I also tried many nonzero value combinations but I could not make it work. 
  NO CROSSPOST!CHOSE A FORUM!BOTH NEHES AND THE OGL ARE ALMOST IDENTICLE!    ;  In general do avoid crossposting, but to answer your question the best way might be to increase the line width with glLineWidth(2.0), though this might not be what you want.  You could try requesting a depth buffer and using that, but I don''t think that would help.  Is there any way to avoid drawing the grid line where you add the yellow?  What exactly are you trying to do, maybe someone could suggest something based on that. 