Add Release Interface (For Global Objects Managing)

This commit is contained in:
Kirigaya Kazuto 2017-05-18 17:58:10 +08:00
parent 26beb30f77
commit c46455a2e7

View File

@ -126,6 +126,7 @@ namespace MiniEngine
static Surface createSurface(int width,int height,int depth,int Rmask,int Gmask,int Bmask,int Amask) throw(ErrorViewer); static Surface createSurface(int width,int height,int depth,int Rmask,int Gmask,int Bmask,int Amask) throw(ErrorViewer);
void release();
protected: protected:
Surface() = default; Surface() = default;
private: private:
@ -161,6 +162,7 @@ namespace MiniEngine
RGBA getRGBA(); RGBA getRGBA();
void setRGBA(RGBA pack); void setRGBA(RGBA pack);
void release();
protected: protected:
/// updateInfo() must be called after Texture is changed. /// updateInfo() must be called after Texture is changed.
void updateInfo(); void updateInfo();
@ -212,6 +214,8 @@ namespace MiniEngine
Texture createTexture(int Width, int Height) throw(ErrorViewer); Texture createTexture(int Width, int Height) throw(ErrorViewer);
bool isReady(); bool isReady();
void release();
private: private:
std::shared_ptr<SDL_Renderer> _rnd; std::shared_ptr<SDL_Renderer> _rnd;
void _set(SDL_Renderer*); void _set(SDL_Renderer*);
@ -242,6 +246,8 @@ namespace MiniEngine
static bool isShow(); static bool isShow();
void activate(); void activate();
void release();
private: private:
std::shared_ptr<SDL_Cursor> _cur; std::shared_ptr<SDL_Cursor> _cur;
void _set(SDL_Cursor*); void _set(SDL_Cursor*);
@ -314,8 +320,9 @@ namespace MiniEngine
void maximize(); void maximize();
void restore(); void restore();
_DECL_DEPRECATED Surface getSurface(); _DECL_DEPRECATED Surface getSurface();
void release();
protected: protected:
template<typename... Args> template<typename... Args>
void _setRenderer(RendererType Type,Args&&... args) void _setRenderer(RendererType Type,Args&&... args)
@ -401,6 +408,8 @@ namespace MiniEngine
Texture renderUTF8Wrapped(Renderer rnd, std::string Text, RGBA fg, int WrapLength); Texture renderUTF8Wrapped(Renderer rnd, std::string Text, RGBA fg, int WrapLength);
Texture renderUTF8Shaded(Renderer rnd, std::string Text, RGBA fg, RGBA bg); Texture renderUTF8Shaded(Renderer rnd, std::string Text, RGBA fg, RGBA bg);
Texture renderUTF8Solid(Renderer rnd, std::string Text, RGBA fg); Texture renderUTF8Solid(Renderer rnd, std::string Text, RGBA fg);
void release();
protected: protected:
template<typename... Args> template<typename... Args>
void _setFontStyle(int& fontcalc,Style style,Args&&... args) void _setFontStyle(int& fontcalc,Style style,Args&&... args)
@ -446,8 +455,11 @@ namespace MiniEngine
int load(const std::string& Filename); int load(const std::string& Filename);
int unload(); int unload();
void* get(const std::string& FunctionName); void* get(const std::string& FunctionName);
void release();
private: private:
void* _obj; void* _get();
void _set(void*);
std::shared_ptr<void> _obj;
}; };
class SDLSystem class SDLSystem