Commit 26b2b68a authored by cutealien's avatar cutealien

- COpenGLTexture::getOpenGLFormatAndParametersFromColorFormat now returning...

- COpenGLTexture::getOpenGLFormatAndParametersFromColorFormat now returning values for ECF_R5G6B5 which can be used in glTexImage2D. Fixes test renderTargetTexture. I've also added a few more error-checks in debug.
- Remove assert in opengl driver (already logs and asserts prevent tests from running through).
- NOTE: 2 new tests failing: b3dAnimation and md2Animation. Maybe due to animation fix from yesterday.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4216 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d59ebca7
...@@ -2548,7 +2548,7 @@ bool COpenGLDriver::testGLError() ...@@ -2548,7 +2548,7 @@ bool COpenGLDriver::testGLError()
os::Printer::log("GL_INVALID_FRAMEBUFFER_OPERATION", ELL_ERROR); break; os::Printer::log("GL_INVALID_FRAMEBUFFER_OPERATION", ELL_ERROR); break;
#endif #endif
}; };
_IRR_DEBUG_BREAK_IF(true); // _IRR_DEBUG_BREAK_IF(true);
return true; return true;
#else #else
return false; return false;
......
...@@ -144,8 +144,8 @@ GLint COpenGLTexture::getOpenGLFormatAndParametersFromColorFormat(ECOLOR_FORMAT ...@@ -144,8 +144,8 @@ GLint COpenGLTexture::getOpenGLFormatAndParametersFromColorFormat(ECOLOR_FORMAT
internalformat = GL_RGBA; internalformat = GL_RGBA;
break; break;
case ECF_R5G6B5: case ECF_R5G6B5:
colorformat=GL_BGR; colorformat=GL_RGB;
type=GL_UNSIGNED_SHORT_5_6_5_REV; type=GL_UNSIGNED_SHORT_5_6_5;
internalformat = GL_RGB; internalformat = GL_RGB;
break; break;
case ECF_R8G8B8: case ECF_R8G8B8:
...@@ -699,6 +699,9 @@ COpenGLFBOTexture::COpenGLFBOTexture(const core::dimension2d<u32>& size, ...@@ -699,6 +699,9 @@ COpenGLFBOTexture::COpenGLFBOTexture(const core::dimension2d<u32>& size,
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, ImageSize.Width, glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, ImageSize.Width,
ImageSize.Height, 0, PixelFormat, PixelType, 0); ImageSize.Height, 0, PixelFormat, PixelType, 0);
#ifdef _DEBUG
driver->testGLError();
#endif
// attach color texture to frame buffer // attach color texture to frame buffer
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER_EXT, Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER_EXT,
...@@ -706,6 +709,10 @@ COpenGLFBOTexture::COpenGLFBOTexture(const core::dimension2d<u32>& size, ...@@ -706,6 +709,10 @@ COpenGLFBOTexture::COpenGLFBOTexture(const core::dimension2d<u32>& size,
GL_TEXTURE_2D, GL_TEXTURE_2D,
TextureName, TextureName,
0); 0);
#ifdef _DEBUG
checkFBOStatus(Driver);
#endif
#endif #endif
unbindRTT(); unbindRTT();
} }
......
Tests finished. 1 test of 1 passed. Tests finished. 1 test of 1 passed.
Compiled as DEBUG Compiled as DEBUG
Test suite pass at GMT Tue Jun 12 20:48:10 2012 Test suite pass at GMT Wed Jun 27 10:38:16 2012
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