我想使用模板缓存功能,利用glClearStencil(GLint s)函数设置模板,然后用GLClear(GL_STENCIL_BUFFER_BIT)刷新显示,不知道在SetupPixelformat()如何设置?

解决方案 »

  1.   

    PIXELFORMATDESCRIPTOR pfd={
    sizeof(PIXELFORMATDESCRIPTOR),//size of this pfd
    1,                            //version number
    PFD_DRAW_TO_WINDOW|           //support window
    PFD_SUPPORT_OPENGL|PFD_STEREO|//support OpenGL
    PFD_DOUBLEBUFFER,             //double buffered
    PFD_TYPE_RGBA,                //RGBA type
    24,                           //24-bit color
    0,0,0,0,0,0,                  //color bits ignored
    0,                            //no alpha buffer
    0,                            //shift bit ignored
    0,                            //no accumulation buffer
    0,0,0,0,                      //accum bits ignored
    32,                           //32-bit depth-buffer
    4,                            //no stencil buffer
    0,                            //no auxiliary buffer
    PFD_MAIN_PLANE,               //main layer
    0,                            //reserved 
    0,0,0,                        //layer masks ignored
    };
    3DS可以考虑简化点、线、面。