Hello, i create window on winapi
Code :
CreateWindowEx(0, class_name, "test", WS_CHILD | WS_VISIBLE,  0, 0, x, y, main_window, NULL, (HINSTANCE)hInstance, NULL);
Settings
Code :
  PIXELFORMATDESCRIPTOR pfd =
    {
        sizeof(PIXELFORMATDESCRIPTOR),
        1,
        PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,    //Flags
        PFD_TYPE_RGBA,            //The kind of framebuffer. RGBA or palette.
        32,                        //Colordepth of the framebuffer.
        0, 0, 0, 0, 0, 0,
        0,
        0,
        0,
        0, 0, 0, 0,
        16,                        //Number of bits for the depthbuffer
        8,                        //Number of bits for the stencilbuffer
        0,                        //Number of Aux buffers in the framebuffer.
        PFD_MAIN_PLANE,
        0,
        0, 0, 0
    };

Init opengl
Code :
	glClearColor(1.0f, 1.0f, 1.0f, 1.0f); 
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LEQUAL);

draw quads on z buffer
Code :
   glColor3f(1,0,0);
    glBegin(GL_QUADS);
            glVertex3d( -1,0, -0.8 ); 
            glVertex3d( -1,1, -0.8 ); 
            glVertex3d( 0,1, -0.8 ); 
            glVertex3d( 0,0, -0.8 ); 
    glEnd();
 
    glColor3f(0,1,0);
    glBegin(GL_QUADS);
            glVertex3d( 0,0, -0.9 ); 
            glVertex3d( 0,1, -0.9 ); 
            glVertex3d( 1,1, -0.9 ); 
            glVertex3d( 1,0, -0.9 ); 
    glEnd();
 
    glColor3f(0,0,1);
    glBegin(GL_QUADS);
            glVertex3d( 0-0.5,0, -0.7 ); 
            glVertex3d( 0-0.5,1, -0.7 ); 
            glVertex3d( 1-0.5,1, -0.7 ); 
            glVertex3d( 1-0.5,0, -0.7 ); 
    glEnd();

1 quad hidden per 2 quad

Resize
Code :
           MoveWindow(child_window, 0, 0, x, y, FALSE);
            glViewport(0, 0, x, y);

If i use This resize i have problem
Original
1.jpg
Problem
2.jpg

If i use resize
Code :
            glViewport(0, 0, x, y); 
           MoveWindow(child_window, 0, 0, x, y, FALSE);

This problem out, but resize very slow, no cool and not properly.
If I do not use Z buffer, and use resize 1 method, all work!