Fix bug in setRenderer

This commit is contained in:
Kirigaya Kazuto 2017-04-05 11:43:01 +08:00
parent f78eb839bf
commit af18ae23da

View File

@ -135,6 +135,7 @@ namespace MiniEngine
class Renderer class Renderer
{ {
public: public:
Renderer() = default;
int setColor(RGBA pack); int setColor(RGBA pack);
RGBA getColor(); RGBA getColor();
int setBlendMode(BlendMode mode); int setBlendMode(BlendMode mode);
@ -163,7 +164,6 @@ namespace MiniEngine
Texture loadTexture(std::string FileName) throw(ErrorViewer); Texture loadTexture(std::string FileName) throw(ErrorViewer);
Texture createTexture(int Width, int Height) throw(ErrorViewer); Texture createTexture(int Width, int Height) throw(ErrorViewer);
Renderer() = default;
bool isReady(); bool isReady();
private: private:
std::shared_ptr<SDL_Renderer> rnd; std::shared_ptr<SDL_Renderer> rnd;
@ -178,19 +178,19 @@ namespace MiniEngine
Window(std::string Title, int Width, int Height, std::initializer_list<RendererType> RendererFlags = { RendererType::Accelerated,RendererType::TargetTexture }) throw(ErrorViewer); Window(std::string Title, int Width, int Height, std::initializer_list<RendererType> RendererFlags = { RendererType::Accelerated,RendererType::TargetTexture }) throw(ErrorViewer);
Renderer getRenderer() const; Renderer getRenderer() const;
template<typename... Args>
void setRenderer(RendererType Type,Args&&... args)
{
_internal_rndflagcalc=0;
_setRenderer(Type,std::forward(args...));
}
void setRenderer(RendererType Type) void setRenderer(RendererType Type)
{ {
_internal_rndflagcalc=0; _internal_rndflagcalc=0;
_setRenderer(Type); _setRenderer(Type);
} }
template<typename... Args>
void setRenderer(RendererType Type,Args&&... args)
{
_internal_rndflagcalc=0;
_setRenderer(Type,std::forward<RendererType>(args...));
}
void setRenderer(std::initializer_list<RendererType>); void setRenderer(std::initializer_list<RendererType>);
Rect getSize(); Rect getSize();