mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Update MiniEngine.cpp
This commit is contained in:
parent
409c126a78
commit
11b1125d29
|
@ -117,6 +117,11 @@ namespace MiniEngine
|
||||||
return str.c_str();
|
return str.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Texture::Texture()
|
||||||
|
{
|
||||||
|
updateInfo();
|
||||||
|
}
|
||||||
|
|
||||||
Rect Texture::getSize()
|
Rect Texture::getSize()
|
||||||
{
|
{
|
||||||
return rect;
|
return rect;
|
||||||
|
@ -195,6 +200,10 @@ namespace MiniEngine
|
||||||
|
|
||||||
void Texture::updateInfo()
|
void Texture::updateInfo()
|
||||||
{
|
{
|
||||||
|
if(text.get()==nullptr)
|
||||||
|
{
|
||||||
|
rect.x=rect.y=rect.w=rect.h=0;
|
||||||
|
}
|
||||||
SDL_QueryTexture(text.get(), NULL, NULL, &rect.w, &rect.h);
|
SDL_QueryTexture(text.get(), NULL, NULL, &rect.w, &rect.h);
|
||||||
rect.x = rect.y = 0;
|
rect.x = rect.y = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user