00001 #ifndef LIBWIISPRITE_IMAGE 00002 #define LIBWIISPRITE_IMAGE 00003 00004 #include <stdlib.h> 00005 #include <gccore.h> 00006 00008 namespace wsp{ 00009 00011 enum IMG_LOAD_ERROR{ 00012 IMG_LOAD_ERROR_NONE = 0, 00013 IMG_LOAD_ERROR_NOT_FOUND, 00014 IMG_LOAD_ERROR_INV_PNG, 00015 IMG_LOAD_ERROR_PNG_FAIL 00016 }; 00017 00019 class Image{ 00020 public: 00022 Image(); 00024 ~Image(); 00025 00030 IMG_LOAD_ERROR LoadImage(const char* path); 00031 00034 u32 GetWidth() const; 00037 u32 GetHeight() const; 00038 00041 bool IsInitialized() const; 00042 00045 void BindTexture(); 00046 protected: 00047 private: 00048 u32 _width, _height; 00049 bool _initialized; 00050 GXTexObj _texObj; u8* _pixels; 00051 }; 00052 }; 00053 00054 #endif