Fixes stencil buffers on platforms not supporting OpenGL 3.0 or higher.
Merge pull request #1029 from iChun/patch-1

Fixes stencil buffers on platforms not supporting OpenGL 3.0 or higher.