#pragma once
#include <Windows.h>
#include <d3d11.h>
#include <wincodec.h>
#include <memory>
#include <wrl.h>
#include <string>

class Surface
{
public:
	void LoadImageFromFile(
		Microsoft::WRL::ComPtr<ID3D11Device> dev,
		Microsoft::WRL::ComPtr<ID3D11DeviceContext> devcon,
		std::string filename);
	UINT GetWidth();
	UINT GetHeight();
	DXGI_FORMAT GetDxgiFormat();
	UINT GetBytesPerRow();
	BYTE* GetImageData();
	UINT GetCurrSlot();
private:
	DXGI_FORMAT GetDXGIFormatFromWICFormat(WICPixelFormatGUID& wicFormatGUID);
	WICPixelFormatGUID GetConvertToWICFormat(WICPixelFormatGUID& wicFormatGUID);
	int GetDXGIFormatBitsPerPixel(DXGI_FORMAT& dxgiFormat);
private:
	static IWICImagingFactory* wicFactory;
	static int totalSlot;
	UINT height;
	UINT width;
	DXGI_FORMAT dxgiFormat;
	UINT bytesPerRow;
	BYTE* imageData;
	UINT currSlot;
};