mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-06-08 03:13:52 +00:00
Added webp support. (#3718)
This commit is contained in:
committed by
GitHub
parent
7d03e160fa
commit
ba17ab3825
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user