Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: glClearColor working strange way on HP ZBOOK 15

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2015
    Posts
    6

    glClearColor working strange way on HP ZBOOK 15

    Hi,

    When I try to change background color from black to white I have following picture:
    Click image for larger version. 

Name:	Capture.jpg 
Views:	14 
Size:	5.2 KB 
ID:	2944

    Looks like color updated only in areas where some other elements present. It is happen when I test it on HP ZBOOK 15.

    Is it any graphics card settings issue?

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,590
    After calling glClearColor(), did you call glClear( GL_COLOR_BUFFER_BIT ) with that framebuffer bound?

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2015
    Posts
    6
    Yes, and it was OK on my old Dell computer and many other computers. Is it kind of optimization?

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,590
    Quote Originally Posted by Alexanov View Post
    Is it kind of optimization?
    No. If there are no bugs in your program, and glClear() is not clearing the active framebuffer, then that may be a driver bug.

    Are you checking for GL errors?

    Have you updated the graphics drivers on your HP ZBook 15?

    Can you post a short, stand-alone program that illustrates the problem?

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2015
    Posts
    6
    Quote Originally Posted by Dark Photon View Post
    No. If there are no bugs in your program, and glClear() is not clearing the active framebuffer, then that may be a driver bug.

    Are you checking for GL errors?

    Have you updated the graphics drivers on your HP ZBook 15?

    Can you post a short, stand-alone program that illustrates the problem?

    Run it again on Dell computer - works fine.
    Check for errors - no error.


    Code look's like that:

    Code :
    // Try to put it in action
    	if ( !GLCurContext())
    	{
    		this->ErrMessageBox(CGLView::GLW_MAKE_CURRENT, GetErrorStr(CGLView::GLW_MAKE_CURRENT));
    		return -1;
    	}
    	// The glClearColor function specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. 
    	// The depth of the Z-buffer will be taken into account
    	glEnable(GL_DEPTH_TEST);
    	// Values specified by glClearColor are clamped to the range [0,1]
    	glClearColor (m_BgColor[C_RED], m_BgColor[C_GREEN], m_BgColor[C_BLUE], 0);
    	// Actual background erasure
    	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    	// set clear Z-Buffer value
    	glClearDepth(1.0f);
     
    	// For Drawing text.
    	// Create Font Bitmaps for this view. It starts from CL_FONT number.
    	SelectObject(GLView_GetHDC(), GetStockObject(ANSI_VAR_FONT));
    	if(wglUseFontBitmaps(m_pCDC->GetSafeHdc(), 0, 256, CL_FONT) == FALSE)
    	{
    		this->ErrMessageBox(CGLView::GLW_USE_FONT_BITMAPS, GetErrorStr(CGLView::GLW_USE_FONT_BITMAPS));
    		return -1;	
    	}
     
     
    	// free the target DeviceContext (window)
        GLNullContext();


    How to find what's wrong with driver?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •