Added webp support. (#3718)

This commit is contained in:
Branimir Karadžić
2026-05-26 22:03:03 -07:00
committed by GitHub
parent 7d03e160fa
commit ba17ab3825
2 changed files with 4 additions and 2 deletions

View File

@@ -169,7 +169,7 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const bx::FilePath& _f
void* data = load(_reader, entry::getAllocator(), _filePath, &size);
if (NULL != data)
{
bimg::ImageContainer* imageContainer = bimg::imageParse(entry::getAllocator(), data, size);
bimg::ImageContainer* imageContainer = bimg::imageParse(entry::getAllocator(), data, size, bimg::TextureFormat::Count, bx::ErrorIgnore{});
if (NULL != imageContainer)
{

View File

@@ -86,6 +86,7 @@ static const char* s_supportedExt[] =
"psd",
"pvr",
"tga",
"webp",
};
struct Binding
@@ -230,7 +231,7 @@ static const InputBinding* s_binding[] =
static_assert(Binding::Count == BX_COUNTOF(s_binding) );
static const char* s_filter = ""
"All Image Formats (bmp, dds, exr, gif, gnf, jpg, jpeg, hdr, ktx, pgm, png, ppm, psd, pvr, tga) | *.bmp *.dds *.exr *.gif *.gnf *.jpg *.jpeg *.hdr *.ktx *.pgm *.png *.ppm *.psd *.pvr *.tga\n"
"All Image Formats (bmp, dds, exr, gif, gnf, jpg, jpeg, hdr, ktx, pgm, png, ppm, psd, pvr, tga, webp) | *.bmp *.dds *.exr *.gif *.gnf *.jpg *.jpeg *.hdr *.ktx *.pgm *.png *.ppm *.psd *.pvr *.tga *.webp\n"
"Windows Bitmap (bmp) | *.bmp\n"
"Direct Draw Surface (dds) | *.dds\n"
"OpenEXR (exr) | *.exr\n"
@@ -243,6 +244,7 @@ static const char* s_filter = ""
"Photoshop Document (psd) | *.psd\n"
"PowerVR (pvr) | *.pvr\n"
"Truevision TGA (tga) | *.tga\n"
"WebP (webp) | *.webp\n"
;
#if BX_PLATFORM_WINDOWS