#include <NoesisPCH.h>
namespace api{
	////////////////////////////////////////////////////////////////////////////////////////////////////
	static TinyImageFormat VKFormat(Noesis::TextureFormat::Enum format, bool sRGB)
	{
		switch (format)
		{
		case Noesis::TextureFormat::RGBA8: return sRGB ? TinyImageFormat_B8G8R8A8_SRGB : TinyImageFormat_B8G8R8A8_UNORM;
		case Noesis::TextureFormat::RGBX8: return sRGB ? TinyImageFormat_B8G8R8A8_SRGB : TinyImageFormat_B8G8R8A8_UNORM;
		case Noesis::TextureFormat::R8: return TinyImageFormat_R8_UNORM;
		default: NS_ASSERT_UNREACHABLE;
		}
	}
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    class UITexture final : public Noesis::Texture
    {
    public:
        UITexture(TextureDesc desc) : desc(desc) {}
        ~UITexture()
        {

        }
        uint32_t GetWidth() const override { return desc.width; }
        uint32_t GetHeight() const override { return desc.height; }
        bool HasMipMaps() const override { return desc.mipLevel > 1; }
        bool IsInverted() const override { return isInverted; }
        bool HasAlpha() const override { return hasAlpha; }

        TextureDesc desc;
        bool isInverted = false;
        bool hasAlpha = false;
    };
	static Noesis::Ptr<Noesis::Texture> CreateUITexture(TextureDesc& desc) {
        return Noesis::MakePtr<UITexture>(desc);
	}
}