Fix the BGRA extension recognition (or whichever extension comes last in the extension string). With latest emulator also colorkey works.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@2371 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-05-06 23:54:52 +00:00
parent d101418b56
commit e7fcfef180
3 changed files with 8 additions and 6 deletions

View File

@ -383,9 +383,9 @@ bool COGLES1Driver::beginScene(bool backBuffer, bool zBuffer, SColor color,
#if defined(GL_VERSION_ES_CM_1_0) #if defined(GL_VERSION_ES_CM_1_0)
#if defined(_IRR_USE_IPHONE_DEVICE_) #if defined(_IRR_USE_IPHONE_DEVICE_)
(*Device.displayBegin)(&Device); (*Device.displayBegin)(&Device);
#endif
glBindFramebufferOES(GL_FRAMEBUFFER_OES, ViewFramebuffer); glBindFramebufferOES(GL_FRAMEBUFFER_OES, ViewFramebuffer);
#endif #endif
#endif
GLbitfield mask = 0; GLbitfield mask = 0;

View File

@ -132,11 +132,13 @@ void COGLES1ExtensionHandler::initExtensions(COGLES1Driver* driver,
core::stringc extensions = glGetString(GL_EXTENSIONS); core::stringc extensions = glGetString(GL_EXTENSIONS);
os::Printer::log(extensions.c_str()); os::Printer::log(extensions.c_str());
{ {
c8* str = new c8[extensions.size()+1]; const u32 size = extensions.size()+1;
strncpy(str, extensions.c_str(), extensions.size()+1); c8* str = new c8[size];
strncpy(str, extensions.c_str(), extensions.size());
str[extensions.size()]=' ';
c8* p = str; c8* p = str;
for (u32 i=0; i<extensions.size(); ++i) for (u32 i=0; i<size; ++i)
{ {
if (str[i] == ' ') if (str[i] == ' ')
{ {
@ -159,7 +161,7 @@ void COGLES1ExtensionHandler::initExtensions(COGLES1Driver* driver,
} }
#ifndef GL_BGRA #ifndef GL_BGRA
// whoa, pretty badly implemented extension... // whoa, pretty badly implemented extension...
if (FeatureAvailable[IRR_IMG_texture_format_BGRA8888]) if (FeatureAvailable[IRR_IMG_texture_format_BGRA8888] || FeatureAvailable[IRR_EXT_texture_format_BGRA8888])
GL_BGRA=0x80E1; GL_BGRA=0x80E1;
else else
GL_BGRA=GL_RGBA; GL_BGRA=GL_RGBA;

View File

@ -34,7 +34,7 @@ namespace video
{ {
public: public:
enum EOGLESFeatures { enum EOGLESFeatures {
IRR_AMD_compressed_3DC_texture, //39 IRR_AMD_compressed_3DC_texture=0, //39
IRR_AMD_compressed_ATC_texture, //40 IRR_AMD_compressed_ATC_texture, //40
IRR_AMD_performance_monitor, //50 IRR_AMD_performance_monitor, //50
IRR_AMD_program_binary_Z400, //48 IRR_AMD_program_binary_Z400, //48