Jump to content
  • Advertisement
Sign in to follow this  
DarkCybo1

OpenGL Can't activate the stencil for some reason (SDL+OpenGL)

This topic is 4833 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

I'm trying to do stencil-reflections, but I can't set the stencil for some reason..
   
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 4);
   
   int k; 
   SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, &k);
   printf("%d\n", k);
It gives me a 0 everytime, even if I change the stencil size, what's the problem?

Share this post


Link to post
Share on other sites
Advertisement
Chances are two things are happening.

1 - You are not calling the SDL_GL_GetAttribute in the correct spot, so it returns 0, of which I'd go with Phantom in the suggestion to post your code, or

2 - You have everything in the right place, but your video card does not support stencil buffer operations. Note that on the windows platform, calling SDL_GL_SetAttribute is pretty much useless in all the cases I have seen. You just don't have that control on the Windows platform with SDL and OpenGL. I've extensively tested this and have yet to find one case where I could change a setting using SDL_GL_SetAttribute.

In my SDl engine, I just called the SDL_GL_GetAttribute with the SDL_GL_STENCIL_SIZE and it returned 8. I have an ATI Radeon 9600 Pro.

Share this post


Link to post
Share on other sites
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!