blob: 60042556bb842025bb0eebfc720f74f9a0631067 [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
2// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7// Renderbuffer.cpp: the gl::Renderbuffer class and its derived classes
8// Colorbuffer, Depthbuffer and Stencilbuffer. Implements GL renderbuffer
9// objects and related functionality. [OpenGL ES 2.0.24] section 4.4.3 page 108.
10
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000011#include "libGLESv2/Renderbuffer.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000012
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000013#include "libGLESv2/main.h"
enne@chromium.org0fa74632010-09-21 16:18:52 +000014#include "libGLESv2/Texture.h"
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000015#include "libGLESv2/utilities.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000016
17namespace gl
18{
daniel@transgaming.comfbc39522011-11-11 04:10:28 +000019unsigned int RenderbufferStorage::mCurrentSerial = 1;
daniel@transgaming.com092bd482010-05-12 03:39:36 +000020
daniel@transgaming.comfbc39522011-11-11 04:10:28 +000021RenderbufferInterface::RenderbufferInterface()
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000022{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +000023}
24
daniel@transgaming.com2678b342012-01-18 16:29:40 +000025// The default case for classes inherited from RenderbufferInterface is not to
26// need to do anything upon the reference count to the parent Renderbuffer incrementing
27// or decrementing.
28void RenderbufferInterface::addProxyRef(const Renderbuffer *proxy)
29{
30}
31
32void RenderbufferInterface::releaseProxy(const Renderbuffer *proxy)
33{
34}
35
daniel@transgaming.comd14558a2011-11-09 17:46:18 +000036GLuint RenderbufferInterface::getRedSize() const
37{
38 return dx2es::GetRedSize(getD3DFormat());
39}
40
41GLuint RenderbufferInterface::getGreenSize() const
42{
43 return dx2es::GetGreenSize(getD3DFormat());
44}
45
46GLuint RenderbufferInterface::getBlueSize() const
47{
48 return dx2es::GetBlueSize(getD3DFormat());
49}
50
51GLuint RenderbufferInterface::getAlphaSize() const
52{
53 return dx2es::GetAlphaSize(getD3DFormat());
54}
55
56GLuint RenderbufferInterface::getDepthSize() const
57{
58 return dx2es::GetDepthSize(getD3DFormat());
59}
60
61GLuint RenderbufferInterface::getStencilSize() const
62{
63 return dx2es::GetStencilSize(getD3DFormat());
64}
65
daniel@transgaming.com0dc8a5e2012-01-18 16:29:34 +000066RenderbufferTexture::RenderbufferTexture(Texture *texture, GLenum target) : mTarget(target)
daniel@transgaming.comd14558a2011-11-09 17:46:18 +000067{
daniel@transgaming.com0dc8a5e2012-01-18 16:29:34 +000068 mTexture.set(texture);
daniel@transgaming.comd14558a2011-11-09 17:46:18 +000069}
70
71RenderbufferTexture::~RenderbufferTexture()
72{
daniel@transgaming.com0dc8a5e2012-01-18 16:29:34 +000073 mTexture.set(NULL);
daniel@transgaming.comd14558a2011-11-09 17:46:18 +000074}
75
daniel@transgaming.com2678b342012-01-18 16:29:40 +000076// Textures need to maintain their own reference count for references via
77// Renderbuffers acting as proxies. Here, we notify the texture of a reference.
78void RenderbufferTexture::addProxyRef(const Renderbuffer *proxy)
79{
80 mTexture->addProxyRef(proxy);
81}
82
83void RenderbufferTexture::releaseProxy(const Renderbuffer *proxy)
84{
85 mTexture->releaseProxy(proxy);
86}
87
daniel@transgaming.comd14558a2011-11-09 17:46:18 +000088IDirect3DSurface9 *RenderbufferTexture::getRenderTarget()
89{
90 return mTexture->getRenderTarget(mTarget);
91}
92
93IDirect3DSurface9 *RenderbufferTexture::getDepthStencil()
94{
95 return NULL;
96}
97
98GLsizei RenderbufferTexture::getWidth() const
99{
daniel@transgaming.comf1286442011-11-29 19:42:23 +0000100 return mTexture->getWidth(0);
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000101}
102
103GLsizei RenderbufferTexture::getHeight() const
104{
daniel@transgaming.comf1286442011-11-29 19:42:23 +0000105 return mTexture->getHeight(0);
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000106}
107
108GLenum RenderbufferTexture::getInternalFormat() const
109{
110 return mTexture->getInternalFormat();
111}
daniel@transgaming.comfbc39522011-11-11 04:10:28 +0000112
113D3DFORMAT RenderbufferTexture::getD3DFormat() const
114{
115 return mTexture->getD3DFormat();
116}
117
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000118GLsizei RenderbufferTexture::getSamples() const
119{
120 return 0;
121}
122
daniel@transgaming.comfbc39522011-11-11 04:10:28 +0000123unsigned int RenderbufferTexture::getSerial() const
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000124{
daniel@transgaming.comfbc39522011-11-11 04:10:28 +0000125 return mTexture->getRenderTargetSerial(mTarget);
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000126}
127
128Renderbuffer::Renderbuffer(GLuint id, RenderbufferInterface *instance) : RefCountObject(id)
129{
130 ASSERT(instance != NULL);
131 mInstance = instance;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000132}
133
134Renderbuffer::~Renderbuffer()
135{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000136 delete mInstance;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000137}
138
daniel@transgaming.com2678b342012-01-18 16:29:40 +0000139// The RenderbufferInterface contained in this Renderbuffer may need to maintain
140// its own reference count, so we pass it on here.
141void Renderbuffer::addRef() const
142{
143 mInstance->addProxyRef(this);
144
145 RefCountObject::addRef();
146}
147
148void Renderbuffer::release() const
149{
150 mInstance->releaseProxy(this);
151
152 RefCountObject::release();
153}
154
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000155IDirect3DSurface9 *Renderbuffer::getRenderTarget()
156{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000157 return mInstance->getRenderTarget();
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000158}
159
160IDirect3DSurface9 *Renderbuffer::getDepthStencil()
161{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000162 return mInstance->getDepthStencil();
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000163}
164
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000165GLsizei Renderbuffer::getWidth() const
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000166{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000167 return mInstance->getWidth();
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000168}
169
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000170GLsizei Renderbuffer::getHeight() const
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000171{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000172 return mInstance->getHeight();
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000173}
174
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000175GLenum Renderbuffer::getInternalFormat() const
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000176{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000177 return mInstance->getInternalFormat();
178}
179
180D3DFORMAT Renderbuffer::getD3DFormat() const
181{
182 return mInstance->getD3DFormat();
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000183}
184
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000185GLuint Renderbuffer::getRedSize() const
daniel@transgaming.com4cbc5902010-08-24 19:20:26 +0000186{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000187 return mInstance->getRedSize();
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000188}
189
190GLuint Renderbuffer::getGreenSize() const
191{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000192 return mInstance->getGreenSize();
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000193}
194
195GLuint Renderbuffer::getBlueSize() const
196{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000197 return mInstance->getBlueSize();
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000198}
199
200GLuint Renderbuffer::getAlphaSize() const
201{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000202 return mInstance->getAlphaSize();
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000203}
204
205GLuint Renderbuffer::getDepthSize() const
206{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000207 return mInstance->getDepthSize();
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000208}
209
210GLuint Renderbuffer::getStencilSize() const
211{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000212 return mInstance->getStencilSize();
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000213}
214
215GLsizei Renderbuffer::getSamples() const
216{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000217 return mInstance->getSamples();
daniel@transgaming.com4cbc5902010-08-24 19:20:26 +0000218}
219
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000220unsigned int Renderbuffer::getSerial() const
221{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000222 return mInstance->getSerial();
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000223}
224
225void Renderbuffer::setStorage(RenderbufferStorage *newStorage)
226{
227 ASSERT(newStorage != NULL);
228
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000229 delete mInstance;
230 mInstance = newStorage;
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000231}
232
daniel@transgaming.comfbc39522011-11-11 04:10:28 +0000233RenderbufferStorage::RenderbufferStorage() : mSerial(issueSerial())
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000234{
daniel@transgaming.com73a5db62010-10-15 17:58:13 +0000235 mWidth = 0;
236 mHeight = 0;
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000237 mInternalFormat = GL_RGBA4;
daniel@transgaming.com73a5db62010-10-15 17:58:13 +0000238 mD3DFormat = D3DFMT_A8R8G8B8;
239 mSamples = 0;
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000240}
241
242RenderbufferStorage::~RenderbufferStorage()
243{
244}
245
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000246IDirect3DSurface9 *RenderbufferStorage::getRenderTarget()
247{
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000248 return NULL;
249}
250
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000251IDirect3DSurface9 *RenderbufferStorage::getDepthStencil()
252{
253 return NULL;
254}
255
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000256GLsizei RenderbufferStorage::getWidth() const
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000257{
258 return mWidth;
259}
260
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000261GLsizei RenderbufferStorage::getHeight() const
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000262{
263 return mHeight;
264}
265
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000266GLenum RenderbufferStorage::getInternalFormat() const
daniel@transgaming.com866f3182010-05-20 19:28:22 +0000267{
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000268 return mInternalFormat;
daniel@transgaming.com866f3182010-05-20 19:28:22 +0000269}
270
daniel@transgaming.comfbc39522011-11-11 04:10:28 +0000271D3DFORMAT RenderbufferStorage::getD3DFormat() const
272{
273 return mD3DFormat;
274}
275
daniel@transgaming.com1f135d82010-08-24 19:20:36 +0000276GLsizei RenderbufferStorage::getSamples() const
277{
278 return mSamples;
279}
280
daniel@transgaming.comfbc39522011-11-11 04:10:28 +0000281unsigned int RenderbufferStorage::getSerial() const
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000282{
daniel@transgaming.comfbc39522011-11-11 04:10:28 +0000283 return mSerial;
284}
285
286unsigned int RenderbufferStorage::issueSerial()
287{
288 return mCurrentSerial++;
289}
290
291unsigned int RenderbufferStorage::issueCubeSerials()
292{
293 unsigned int firstSerial = mCurrentSerial;
294 mCurrentSerial += 6;
295 return firstSerial;
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000296}
297
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000298Colorbuffer::Colorbuffer(IDirect3DSurface9 *renderTarget) : mRenderTarget(renderTarget)
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000299{
300 if (renderTarget)
301 {
302 renderTarget->AddRef();
303
304 D3DSURFACE_DESC description;
305 renderTarget->GetDesc(&description);
306
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000307 mWidth = description.Width;
308 mHeight = description.Height;
309 mInternalFormat = dx2es::ConvertBackBufferFormat(description.Format);
daniel@transgaming.comca7c0082010-08-24 19:20:20 +0000310 mD3DFormat = description.Format;
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000311 mSamples = dx2es::GetSamplesFromMultisampleType(description.MultiSampleType);
daniel@transgaming.comca7c0082010-08-24 19:20:20 +0000312 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000313}
314
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000315Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples) : mRenderTarget(NULL)
daniel@transgaming.com70d312a2010-04-20 18:52:38 +0000316{
317 IDirect3DDevice9 *device = getDevice();
318
daniel@transgaming.comca7c0082010-08-24 19:20:20 +0000319 D3DFORMAT requestedFormat = es2dx::ConvertRenderbufferFormat(format);
daniel@transgaming.com1f135d82010-08-24 19:20:36 +0000320 int supportedSamples = getContext()->getNearestSupportedSamples(requestedFormat, samples);
321
322 if (supportedSamples == -1)
323 {
324 error(GL_OUT_OF_MEMORY);
325
326 return;
327 }
daniel@transgaming.com70d312a2010-04-20 18:52:38 +0000328
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000329 if (width > 0 && height > 0)
daniel@transgaming.com70d312a2010-04-20 18:52:38 +0000330 {
daniel@transgaming.comca7c0082010-08-24 19:20:20 +0000331 HRESULT result = device->CreateRenderTarget(width, height, requestedFormat,
daniel@transgaming.com1f135d82010-08-24 19:20:36 +0000332 es2dx::GetMultisampleTypeFromSamples(supportedSamples), 0, FALSE, &mRenderTarget, NULL);
daniel@transgaming.com70d312a2010-04-20 18:52:38 +0000333
daniel@transgaming.com9ecb9f92010-07-28 19:21:12 +0000334 if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
335 {
336 error(GL_OUT_OF_MEMORY);
337
338 return;
339 }
340
341 ASSERT(SUCCEEDED(result));
daniel@transgaming.com70d312a2010-04-20 18:52:38 +0000342 }
343
apatrick@chromium.org831fe2a2011-03-17 18:44:29 +0000344 mWidth = width;
345 mHeight = height;
346 mInternalFormat = format;
347 mD3DFormat = requestedFormat;
348 mSamples = supportedSamples;
daniel@transgaming.com70d312a2010-04-20 18:52:38 +0000349}
350
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000351Colorbuffer::~Colorbuffer()
352{
353 if (mRenderTarget)
354 {
355 mRenderTarget->Release();
356 }
357}
358
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000359IDirect3DSurface9 *Colorbuffer::getRenderTarget()
360{
daniel@transgaming.com5e4dbb32011-11-11 04:10:18 +0000361 if (mRenderTarget)
362 {
363 mRenderTarget->AddRef();
364 }
365
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000366 return mRenderTarget;
367}
368
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000369DepthStencilbuffer::DepthStencilbuffer(IDirect3DSurface9 *depthStencil) : mDepthStencil(depthStencil)
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000370{
371 if (depthStencil)
372 {
373 depthStencil->AddRef();
374
375 D3DSURFACE_DESC description;
376 depthStencil->GetDesc(&description);
377
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000378 mWidth = description.Width;
379 mHeight = description.Height;
380 mInternalFormat = dx2es::ConvertDepthStencilFormat(description.Format);
381 mSamples = dx2es::GetSamplesFromMultisampleType(description.MultiSampleType);
daniel@transgaming.comca7c0082010-08-24 19:20:20 +0000382 mD3DFormat = description.Format;
383 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000384}
385
daniel@transgaming.com1f135d82010-08-24 19:20:36 +0000386DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples)
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000387{
388 IDirect3DDevice9 *device = getDevice();
389
390 mDepthStencil = NULL;
daniel@transgaming.com1f135d82010-08-24 19:20:36 +0000391
392 int supportedSamples = getContext()->getNearestSupportedSamples(D3DFMT_D24S8, samples);
393
394 if (supportedSamples == -1)
395 {
396 error(GL_OUT_OF_MEMORY);
397
398 return;
399 }
400
apatrick@chromium.org831fe2a2011-03-17 18:44:29 +0000401 if (width > 0 && height > 0)
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000402 {
apatrick@chromium.org831fe2a2011-03-17 18:44:29 +0000403 HRESULT result = device->CreateDepthStencilSurface(width, height, D3DFMT_D24S8, es2dx::GetMultisampleTypeFromSamples(supportedSamples),
404 0, FALSE, &mDepthStencil, 0);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000405
apatrick@chromium.org831fe2a2011-03-17 18:44:29 +0000406 if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
407 {
408 error(GL_OUT_OF_MEMORY);
409
410 return;
411 }
412
413 ASSERT(SUCCEEDED(result));
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000414 }
415
apatrick@chromium.org831fe2a2011-03-17 18:44:29 +0000416 mWidth = width;
417 mHeight = height;
418 mInternalFormat = GL_DEPTH24_STENCIL8_OES;
419 mD3DFormat = D3DFMT_D24S8;
420 mSamples = supportedSamples;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000421}
422
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000423DepthStencilbuffer::~DepthStencilbuffer()
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000424{
425 if (mDepthStencil)
426 {
427 mDepthStencil->Release();
428 }
429}
430
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000431IDirect3DSurface9 *DepthStencilbuffer::getDepthStencil()
432{
433 return mDepthStencil;
434}
435
436Depthbuffer::Depthbuffer(IDirect3DSurface9 *depthStencil) : DepthStencilbuffer(depthStencil)
437{
438 if (depthStencil)
439 {
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000440 mInternalFormat = GL_DEPTH_COMPONENT16; // If the renderbuffer parameters are queried, the calling function
441 // will expect one of the valid renderbuffer formats for use in
442 // glRenderbufferStorage
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000443 }
444}
445
daniel@transgaming.com1f135d82010-08-24 19:20:36 +0000446Depthbuffer::Depthbuffer(int width, int height, GLsizei samples) : DepthStencilbuffer(width, height, samples)
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000447{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000448 if (mDepthStencil)
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000449 {
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000450 mInternalFormat = GL_DEPTH_COMPONENT16; // If the renderbuffer parameters are queried, the calling function
451 // will expect one of the valid renderbuffer formats for use in
452 // glRenderbufferStorage
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000453 }
454}
455
456Depthbuffer::~Depthbuffer()
457{
458}
459
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000460Stencilbuffer::Stencilbuffer(IDirect3DSurface9 *depthStencil) : DepthStencilbuffer(depthStencil)
461{
462 if (depthStencil)
463 {
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000464 mInternalFormat = GL_STENCIL_INDEX8; // If the renderbuffer parameters are queried, the calling function
465 // will expect one of the valid renderbuffer formats for use in
466 // glRenderbufferStorage
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000467 }
468}
469
daniel@transgaming.com1f135d82010-08-24 19:20:36 +0000470Stencilbuffer::Stencilbuffer(int width, int height, GLsizei samples) : DepthStencilbuffer(width, height, samples)
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000471{
daniel@transgaming.comd14558a2011-11-09 17:46:18 +0000472 if (mDepthStencil)
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000473 {
daniel@transgaming.comd2fd4f22011-02-01 18:49:11 +0000474 mInternalFormat = GL_STENCIL_INDEX8; // If the renderbuffer parameters are queried, the calling function
475 // will expect one of the valid renderbuffer formats for use in
476 // glRenderbufferStorage
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +0000477 }
478}
479
480Stencilbuffer::~Stencilbuffer()
481{
482}
483
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000484}