#ifndef HGL_GRAPH_TEXTURE_LOADER_INCLUDE #define HGL_GRAPH_TEXTURE_LOADER_INCLUDE #include #include namespace hgl { namespace graph { #pragma pack(push,1) struct Tex2DFileHeader { uint8 id[6]; ///>3;} const uint total_bytes()const{return pixel_count()*pixel_bytes();} };// #pragma pack(pop) /** * 2D纹理加载器 */ class Texture2DLoader { protected: Tex2DFileHeader file_header; protected: virtual void *OnBegin(uint32)=0; virtual void OnEnd()=0; virtual void OnError(){} public: const Tex2DFileHeader *GetFileHeader()const{return &file_header;} public: virtual ~Texture2DLoader()=default; bool Load(io::InputStream *is); bool Load(const OSString &filename); };//class Texture2DLoader }//namespace graph }//namespace hgl #endif//HGL_GRAPH_TEXTURE_LOADER_INCLUDE