This is an Irrlicht lib modification.
------------------------------------
Changelog:
1/ I needed the getOpenGLFormatAndParametersFromColorFormat method from COpenGLTexture (sources) but it was protected so I moved it from protected to public.
2/ Add to IVideoDriver.hpp (includes) as public:
Code: Select all
//! queries the floating point texture color format support, returns true if supported
virtual bool queryRTTColorFormat(ECOLOR_FORMAT colorFormat)=0;
Code: Select all
//! queries the floating point texture color format support, returns true if supported
bool queryRTTColorFormat(ECOLOR_FORMAT colorFormat);
Add to CNullDriver.cpp (sources) :
Code: Select all
//! queries the floating point texture color format support, returns true if supported
bool CNullDriver::queryRTTColorFormat(ECOLOR_FORMAT colorFormat)
{
return false;
}
Code: Select all
//! queries the floating point texture color format support, returns true if supported
virtual bool queryRTTColorFormat(ECOLOR_FORMAT colorFormat);
Code: Select all
//! queries the floating point texture color format support, returns true if supported
bool COpenGLDriver::queryRTTColorFormat(ECOLOR_FORMAT colorFormat)
{
GLenum colorFormatGL, typeGL;
GLint filtering;
COpenGLTexture *proxy=(COpenGLTexture*)addTexture(core::dimension2d<u32>(1,1), L"proxy_text");
if(!proxy) return false;
GLint internalFormatGL=proxy->getOpenGLFormatAndParametersFromColorFormat(colorFormat, filtering, colorFormatGL, typeGL);
glTexImage2D(GL_PROXY_TEXTURE_2D, 0, internalFormatGL, 256, 256, 0, colorFormatGL, typeGL, 0);
removeTexture(proxy);
return (glGetError()==GL_NO_ERROR)
}
Usage:
Code: Select all
//check if ECF_A16B16G16R16F is supported by the current GPU
std::cout<<"ARGB 16 bits supported? --> "<<driver->queryRTTColorFormat(ECF_A16B16G16R16F)<<std::endl;