today i started looking closer at the GUI of my game. IGUIImage is nice, but simply lacks scaling the image - I don't want a different image file for every resolution. Since there already is a overloaded version of draw2DImage in the VideoDriver, that can scale the image, changing GUIImage is simple: in CGUIImage.cpp replace
Code: Select all
if (Texture) {
driver->draw2DImage(Texture, AbsoluteRect.UpperLeftCorner,
core::rect<s32>(core::position2d<s32>(0,0), Texture->getOriginalSize()),
&AbsoluteClippingRect, video::SColor(255,255,255,255), UseAlphaChannel);
Code: Select all
if (Texture) {
driver->draw2DImage(Texture, AbsoluteRect,
core::rect<s32>(core::position2d<s32>(0,0), Texture->getOriginalSize()),
&AbsoluteClippingRect, 0, UseAlphaChannel);
Code: Select all
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
Code: Select all
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
