Another take at issue #294, which should fix issues with nVidia cards.

According to http://www.opengl.org/wiki/Image_Formats#Depth_stencil_formats, no driver really supported an individial stencil attachment. Combined depth/stencil buffers have support since OpenGL 3.0 or with the packed_depth_stencil extension.
This commit is contained in:
vrld
2011-09-08 16:09:10 +02:00
parent 4f0028050d
commit 65f8bcd375
2 changed files with 39 additions and 58 deletions
+1 -22
View File
@@ -49,27 +49,6 @@ namespace opengl
bool loadVolatile();
void unloadVolatile();
/// Unbind the current canvas on construction and rebind it upon destruction.
// Exception safe temporary unbinding/rebinding for techniques that require
// the default canvas to work (e.g. stencils).
// XXX: If a canvas is switched between creating and destroying an unbinder
// object, the canvas will not be switched back.
struct TemporaryUnbinder
{
Canvas * canvas;
inline TemporaryUnbinder() : canvas(Canvas::current)
{
if (NULL != canvas)
Canvas::bindDefaultCanvas();
}
inline ~TemporaryUnbinder()
{
if (NULL != canvas && NULL == Canvas::current)
canvas->startGrab();
}
};
private:
friend class PixelEffect;
GLuint getTextureName() const { return img; }
@@ -77,7 +56,7 @@ namespace opengl
GLsizei width;
GLsizei height;
GLuint fbo;
GLuint stencilbuffer;
GLuint depth_stencil;
GLuint img;
vertex vertices[4];