when doing 2d drawing, I often find myself writing code like
Code: Select all
driver>draw2DImage(texture, position, core::recti(core::vector2d<s32>(0,0), texture->getSize()), 0, color, true);
the part to create the rect that contains the rect creation takes up a significant portion of the parameters, even though i want the simple "draw everything" behaviour. Therefore, i would suggest adding to ITexture.h the lines [+ the rect.h include]
Code: Select all
//! Gets source rectangle (0,0,Width,Hwight) to draw the whole texture.
/** \return rectangle that contains the whole texture */
core::recti getRect() const
{
return core::recti( 0, 0, Size.Width, Size.Height );
}
to make the abouve code look clearer (and, at least in my experience, most of the time i want to draw the whole texture, so this should be a pretty common usecase)
Code: Select all
driver>draw2DImage(texture, position, texture->getRect(), 0, color, true);
Is there a special reason this is not already in irrlicht (except the obvious "nobody has had the time to do it")?
any thoughts?