Jump to content
  • Advertisement
Sign in to follow this  
liusuxing

Why Quadro FX4500 does not support" StencilFunc "?

This topic is 4055 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hellow everyone! I am new here! I have programed such codes as is shown below. I want use stencil buffer to drawing another image in the rectgular region in the original image. I have tested my codes in a PC with cheap ATI graphcard. It works well.However, it fails in another PC with Nividia Quadro FX4500. I am so confused that why Why Quadro FX4500 does not support" StencilFunc "? or maybe some configure steps are needed? int DrawGLScene(GLvoid) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /////////////////////////////////掩模成功 绘制不同图像 glEnable(GL_STENCIL_TEST); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); ////////////Stencil Making glStencilFunc(GL_NEVER, 1, 1); glStencilOp(GL_REPLACE,GL_KEEP, GL_KEEP); glBegin(GL_QUADS); // 开始绘制四边形 glNormal3d(0.0, 0.0, 1.0); // 法线指向观察者 glVertex3d(-2.0, -5.0, 1.0); // Point 1 (Front) glVertex3d(2.0, -5.0, 1.0); // Point 2 (Front) glVertex3d(2.0, 5.0, 1.0); // Point 3 (Front) glVertex3d(-2.0, 5.0, 1.0); // Point 4 (Front) glEnd(); glStencilMask(GL_FALSE); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glStencilFunc(GL_EQUAL, 0, 1); glColorMask(GL_TRUE, GL_TRUE,GL_TRUE, GL_TRUE); // glColor3d(0.0,0.0,1.0); // auxSolidTeapot(2.0); glDrawPixels(BitmapInfo->bmiHeader.biWidth,BitmapInfo->bmiHeader.biHeight,GL_BGR_EXT, GL_UNSIGNED_BYTE, ImageA); glStencilFunc(GL_EQUAL, 1, 1); // glColor3d(0.0,1.0,0.0); // auxSolidCube(1.0); glDrawPixels(BitmapInfo->bmiHeader.biWidth,BitmapInfo->bmiHeader.biHeight,GL_BGR_EXT, GL_UNSIGNED_BYTE, ImageB); glDisable(GL_STENCIL_TEST); // glFlush(); return TRUE; // Keep Going }

Share this post


Link to post
Share on other sites
Advertisement

This topic is 4055 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!