   SDL - stencil buffer
  I'm trying to setup my stencil buffer to draw some shadows.  The code is in place and I can draw the shadow volumes to the screen for testing, but I cannot draw the shadow volumes to the stencil buffer.When drawing to the stencil buffer, frame-rate drops to about one frame every 10 seconds, and no shadows are seen.  It seems that my stencil buffer is not being setup properly.  Can you help?  Thanks.Here is some of my code:SDL_SetVideoMode(800, 600, 16, SDL_HWSURFACE | SDL_OPENGLBLIT | SDL_OPENGL | SDL_FULLSCREEN);SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 1 );SDL_GL_GetAttribute( SDL_GL_STENCIL_SIZE, &i);note: i = 0   
  SDL_GL_SetAttribute() has to be called before SDL_SetVideoMode().Also, don't use SDL_OPENGLBLIT, It's deprecated and using SDL_HWSURFACE flage along with SDL_OPENGL is redundant so only pass SDL_OPENGL.   ;  Shouldn't you set attributes before setting video mode?Quote:from SDL_GL_SetAttributeSets the OpenGL attribute attr to value. The attributes you set don't take effect until after a call to SDL_SetVideoMode. You should use SDL_GL_GetAttribute to check the values after a SDL_SetVideoMode call, since the values obtained can differ from the requested ones.Quote:from SDL_SetVideoMode, SDL_OPENGL descriptionCreate an OpenGL rendering context. You should have previously set OpenGL video attributes with SDL_GL_SetAttribute. (IMPORTANT: Please see notes at the bottom of this page.);  Thanks guys, you are both correct.  I'm now getting a return of 8 from  SDL_GL_GetAttribute() and my frame rate is back to normal.But, I still have no shadows on the screen.  I'm basically trying to port the NeHe shadow tutorial to SDL, but still something is wrong.  Any other tips would be great.;Quote:Original post by hyzerflipThanks guys, you are both correct.  I'm now getting a return of 8 from  SDL_GL_GetAttribute() and my frame rate is back to normal.But, I still have no shadows on the screen.  I'm basically trying to port the NeHe shadow tutorial to SDL, but still something is wrong.  Any other tips would be great.http://www.devolution.com/pipermail/sdl/2007-January/077824.html   ;Thanks for the help, I have shadows now :)