I use

[pascal]
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, SCREEN_DEPTH );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
[/pascal]

Where screen depth is the value retrieved from the SDL_VideoInfo structure.

but I sometimes use

[pascal]
SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE,stencilsize);
[/pascal]

as well.

the point is with GL_DEPTH_SIZE opengl will use the value to pass in to the SDL_GL_SetAttribute for the depth size, NOT the value passed in to SDL_SetVideoMode, at least the is my understanding. I jsut make sure they are both the same