Implemented support for GL_STENCIL_INDEX8 renderbuffers

TRAC #11366 Signed-off-by: Daniel Koch git-svn-id: https://angleproject.googlecode.com/svn/trunk@5 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 680553bf
......@@ -218,7 +218,7 @@ IDirect3DSurface9 *Depthbuffer::getDepthStencil()
}
Stencilbuffer::Stencilbuffer(IDirect3DSurface9 *depthStencil) : mDepthStencil(depthStencil)
{
{
if (depthStencil)
{
depthStencil->AddRef();
......@@ -229,7 +229,35 @@ Stencilbuffer::Stencilbuffer(IDirect3DSurface9 *depthStencil) : mDepthStencil(de
mWidth = description.Width;
mHeight = description.Height;
}
}
}
Stencilbuffer::Stencilbuffer(int width, int height)
{
IDirect3DDevice9 *device = getDevice();
mDepthStencil = NULL;
HRESULT result = device->CreateDepthStencilSurface(width, height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, FALSE, &mDepthStencil, 0);
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
{
error(GL_OUT_OF_MEMORY);
return;
}
ASSERT(SUCCEEDED(result));
if (mDepthStencil)
{
mWidth = width;
mHeight = height;
}
else
{
mWidth = 0;
mHeight = 0;
}
}
Stencilbuffer::~Stencilbuffer()
{
......
......@@ -90,6 +90,7 @@ class Stencilbuffer : public Renderbuffer
{
public:
Stencilbuffer(IDirect3DSurface9 *depthStencil);
Stencilbuffer(int width, int height);
~Stencilbuffer();
......
......@@ -2580,11 +2580,10 @@ void __stdcall glRenderbufferStorage(GLenum target, GLenum internalformat, GLsiz
case GL_RGB5_A1:
case GL_RGB565:
UNIMPLEMENTED(); // FIXME
// context->setRenderbuffer(new Colorbuffer(renderTarget));
// context->setRenderbuffer(new Colorbuffer(renderTarget));
break;
case GL_STENCIL_INDEX8:
UNIMPLEMENTED(); // FIXME
// context->setRenderbuffer(new Stencilbuffer(depthStencil));
context->setRenderbuffer(new gl::Stencilbuffer(width, height));
break;
default:
return error(GL_INVALID_ENUM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment