mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Fix Bugs about Renderer
We have met a runtime error with SDL_IsClipEnabled. There is not solution to it yet, so we just disable it. Fix Bug in Window::_setRenderer_Real. smart pointer rnd is now reset first. (We have known that smart pointers will only change its value when it has the exact new value.)
This commit is contained in:
parent
6b53686383
commit
da85418b60
|
@ -454,10 +454,12 @@ namespace MiniEngine
|
|||
return Rect(rect);
|
||||
}
|
||||
|
||||
/*
|
||||
bool Renderer::isClipEnabled()
|
||||
{
|
||||
return SDL_RenderIsClipEnabled(rnd.lock().get())==SDL_TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
void Renderer::disableClip()
|
||||
{
|
||||
|
@ -607,6 +609,7 @@ namespace MiniEngine
|
|||
|
||||
void Window::_setRenderer_Real(Uint32 flags)
|
||||
{
|
||||
rnd.reset();
|
||||
rnd.reset(SDL_CreateRenderer(wnd.get(), -1, flags), SDL_DestroyRenderer);
|
||||
winrnd.rnd=rnd;
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ namespace MiniEngine
|
|||
|
||||
int setClipRect(Rect cliprect);
|
||||
Rect getClipRect();
|
||||
bool isClipEnabled();
|
||||
//bool isClipEnabled();
|
||||
void disableClip();
|
||||
|
||||
bool isReady();
|
||||
|
|
Loading…
Reference in New Issue
Block a user