Advertisement Jump to content
Sign in to follow this  

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

This topic is 4902 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..
   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
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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!