Fixed: OpenGL ES driver compilation
This commit is contained in:
parent
ba4522f4b9
commit
3047e92d38
3 changed files with 8 additions and 63 deletions
|
@ -93,19 +93,6 @@ CTextureDrvInfosGL::~CTextureDrvInfosGL()
|
||||||
{
|
{
|
||||||
_Driver->_TextureUsed[TextureUsedIdx] = NULL;
|
_Driver->_TextureUsed[TextureUsedIdx] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_OPENGLES
|
|
||||||
if (InitFBO)
|
|
||||||
{
|
|
||||||
nglDeleteFramebuffersOES(1, &FBOId);
|
|
||||||
if(AttachDepthStencil)
|
|
||||||
{
|
|
||||||
nglDeleteRenderbuffersOES(1, &DepthFBOId);
|
|
||||||
if(!UsePackedDepthStencil)
|
|
||||||
nglDeleteRenderbuffersOES(1, &StencilFBOId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CDepthStencilFBO::CDepthStencilFBO(CDriverGL *driver, uint width, uint height)
|
CDepthStencilFBO::CDepthStencilFBO(CDriverGL *driver, uint width, uint height)
|
||||||
|
@ -175,53 +162,6 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex)
|
||||||
AttachDepthStencil = !((CTextureBloom*)tex)->isMode2D();
|
AttachDepthStencil = !((CTextureBloom*)tex)->isMode2D();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_OPENGLES
|
|
||||||
// generate IDs
|
|
||||||
nglGenFramebuffersOES(1, &FBOId);
|
|
||||||
if(AttachDepthStencil)
|
|
||||||
{
|
|
||||||
nglGenRenderbuffersOES(1, &DepthFBOId);
|
|
||||||
if(UsePackedDepthStencil)
|
|
||||||
StencilFBOId = DepthFBOId;
|
|
||||||
else
|
|
||||||
nglGenRenderbuffersOES(1, &StencilFBOId);
|
|
||||||
}
|
|
||||||
|
|
||||||
//nldebug("3D: using depth %d and stencil %d", DepthFBOId, StencilFBOId);
|
|
||||||
|
|
||||||
// initialize FBO
|
|
||||||
nglBindFramebufferOES(GL_FRAMEBUFFER_OES, FBOId);
|
|
||||||
nglFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, TextureMode, ID, 0);
|
|
||||||
|
|
||||||
// attach depth/stencil render to FBO
|
|
||||||
// note: for some still unkown reason it's impossible to add
|
|
||||||
// a stencil buffer as shown in the respective docs (see
|
|
||||||
// opengl.org extension registry). Until a safe approach to add
|
|
||||||
// them is found, there will be no attached stencil for the time
|
|
||||||
// being, aside of using packed depth+stencil buffers.
|
|
||||||
if(AttachDepthStencil)
|
|
||||||
{
|
|
||||||
if(UsePackedDepthStencil)
|
|
||||||
{
|
|
||||||
//nldebug("3D: using packed depth stencil");
|
|
||||||
nglBindRenderbufferOES(GL_RENDERBUFFER_OES, StencilFBOId);
|
|
||||||
nglRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH24_STENCIL8_OES, tex->getWidth(), tex->getHeight());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nglBindRenderbufferOES(GL_RENDERBUFFER_OES, DepthFBOId);
|
|
||||||
nglRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT24_OES, tex->getWidth(), tex->getHeight());
|
|
||||||
/*
|
|
||||||
nglBindRenderbufferEXT(GL_RENDERBUFFER_OES, StencilFBOId);
|
|
||||||
nglRenderbufferStorageEXT(GL_RENDERBUFFER_OES, GL_STENCIL_INDEX8_EXT, tex->getWidth(), tex->getHeight());
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
nglFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, DepthFBOId);
|
|
||||||
nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
|
|
||||||
nglFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, StencilFBOId);
|
|
||||||
nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// generate IDs
|
// generate IDs
|
||||||
nglGenFramebuffersEXT(1, &FBOId);
|
nglGenFramebuffersEXT(1, &FBOId);
|
||||||
|
|
||||||
|
@ -253,7 +193,6 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex)
|
||||||
GL_RENDERBUFFER_EXT, DepthStencilFBO->StencilFBOId);
|
GL_RENDERBUFFER_EXT, DepthStencilFBO->StencilFBOId);
|
||||||
nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));
|
nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// check status
|
// check status
|
||||||
GLenum status = (GLenum) nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
GLenum status = (GLenum) nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||||
|
|
|
@ -1225,7 +1225,8 @@ IVertexBufferHardGL *CVertexArrayRangeARB::createVBHardGL(uint size, CVertexBuff
|
||||||
{
|
{
|
||||||
case CVertexBuffer::AGPVolatile:
|
case CVertexBuffer::AGPVolatile:
|
||||||
#ifdef USE_OPENGLES
|
#ifdef USE_OPENGLES
|
||||||
glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_STREAM_DRAW);
|
// TODO: GL_STREAM_DRAW doesn't exist in OpenGL ES 1.x
|
||||||
|
glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW);
|
||||||
#else
|
#else
|
||||||
nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STREAM_DRAW_ARB);
|
nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STREAM_DRAW_ARB);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1408,7 +1409,8 @@ void *CVertexBufferHardARB::lock()
|
||||||
{
|
{
|
||||||
case CVertexBuffer::AGPVolatile:
|
case CVertexBuffer::AGPVolatile:
|
||||||
#ifdef USE_OPENGLES
|
#ifdef USE_OPENGLES
|
||||||
glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_STREAM_DRAW);
|
// TODO: GL_STREAM_DRAW doesn't exist in OpenGL ES 1.x
|
||||||
|
glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW);
|
||||||
#else
|
#else
|
||||||
nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STREAM_DRAW_ARB);
|
nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STREAM_DRAW_ARB);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -633,6 +633,9 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
||||||
int width = mode.Width;
|
int width = mode.Width;
|
||||||
int height = mode.Height;
|
int height = mode.Height;
|
||||||
|
|
||||||
|
#ifdef USE_OPENGLES
|
||||||
|
// TODO: implement for OpenGL ES 1.x
|
||||||
|
#else
|
||||||
// resize the window
|
// resize the window
|
||||||
RECT rc;
|
RECT rc;
|
||||||
SetRect (&rc, 0, 0, width, height);
|
SetRect (&rc, 0, 0, width, height);
|
||||||
|
@ -910,6 +913,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
||||||
_hDC = NULL;
|
_hDC = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue