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 IMG_LOAD_ERROR_WRONG_SIZE 00017 }; 00018 00020 class Image{ 00021 public: 00023 Image(); 00025 ~Image(); 00026 00031 IMG_LOAD_ERROR LoadImage(const char* path); 00032 00035 u32 GetWidth() const; 00038 u32 GetHeight() const; 00039 00042 bool IsInitialized() const; 00043 00046 void BindTexture(); 00047 protected: 00048 private: 00049 u32 _width, _height; 00050 bool _initialized; 00051 GXTexObj _texObj; u8* _pixels; 00052 }; 00053 }; 00054 00055 #endif