Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying to use the stencil buffer for rendering reflection and am working with SDL and OpenGL. When I give the command SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE,8),I get a return value of 0 indicating success,but when I try to get the size allocated using SDL_GL_GetAtribute( SDL_GL_STENCIL_SIZE,&i),I get a value of 0 for my stencil buffer due to which I am not getting the desired rendering. Can someone help me to correct my mistake? Is there some other initialization also required? Thanks

share|improve this question
is your graphics mode otherwise compatible with 8bit stencil? Most graphics cards won't let you get 8bit stencil unless you have 32bit (rgba) color and 24bit z-buffer. – Jari Komppa Nov 25 '11 at 13:22
I think thats not a problem,the value returned by the setAtrribute is 0 which indicates success,but there is no buffer created.Could you think of any other problem? – noddy Nov 25 '11 at 14:59
1  
got my answer I was asking for the size before setting the video mode so was getting a zero.It needs to be asked after the video mode is initialized. – noddy Nov 25 '11 at 15:38
Is this solved then? – Jari Komppa Nov 26 '11 at 21:03
Yup it is solved now but still there is some other problem which I need to figure out – noddy Dec 3 '11 at 7:48

closed as too localized by Tetrad Mar 12 at 4:45

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.