Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

GL loader work #276

Merged
merged 14 commits into from
Feb 23, 2024
Prev Previous commit
COpenGLCoreTexture: fix abort when format not supported
sfan5 committed Feb 23, 2024
commit 7d101eb65eeaa37d7a69855b05067fc92f519952
6 changes: 5 additions & 1 deletion source/Irrlicht/COpenGLCoreTexture.h
Original file line number Diff line number Diff line change
@@ -54,6 +54,8 @@ class COpenGLCoreTexture : public ITexture
KeepImage = Driver->getTextureCreationFlag(ETCF_ALLOW_MEMORY_COPY);

getImageValues(images[0]);
if (!InternalFormat)
return;

const core::array<IImage*>* tmpImages = &images;

@@ -160,6 +162,7 @@ class COpenGLCoreTexture : public ITexture
if ( !Driver->getColorFormatParameters(ColorFormat, InternalFormat, PixelFormat, PixelType, &Converter) )
{
os::Printer::log("COpenGLCoreTexture: Color format is not supported", ColorFormatNames[ColorFormat < ECF_UNKNOWN?ColorFormat:ECF_UNKNOWN], ELL_ERROR);
return;
}

GL.GenTextures(1, &TextureName);
@@ -503,7 +506,8 @@ class COpenGLCoreTexture : public ITexture
if ( !Driver->getColorFormatParameters(ColorFormat, InternalFormat, PixelFormat, PixelType, &Converter) )
{
os::Printer::log("getImageValues: Color format is not supported", ColorFormatNames[ColorFormat < ECF_UNKNOWN?ColorFormat:ECF_UNKNOWN], ELL_ERROR);
// not quitting as it will use some alternative internal format
InternalFormat = 0;
return;
}

if (IImage::isCompressedFormat(image->getColorFormat()))