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

Commit

Permalink
COpenGLCoreTexture: fix abort when format not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Feb 21, 2024
1 parent 053c2a7 commit a40d635
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/Irrlicht/COpenGLCoreTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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()))
Expand Down

0 comments on commit a40d635

Please sign in to comment.