Code: Select all
void NX::App::DrawBackground()
{
irr::video::SMaterial material;
material.Lighting = false;
material.ZWriteEnable = false;
material.UseMipMaps = true;
material.AntiAliasing = irr::video::EAAM_FULL_BASIC;
material.TextureLayer[0].Texture = driver->getTexture("media/background.png");
material.TextureLayer[0].AnisotropicFilter = 16;
material.TextureLayer[0].TrilinearFilter = true;
material.TextureLayer[0].TextureWrapU = irr::video::ETC_CLAMP;
material.TextureLayer[0].TextureWrapV = irr::video::ETC_CLAMP;
driver->setMaterial(material);
driver->enableMaterial2D(true);
driver->draw2DImage(material.TextureLayer[0].Texture,
irr::core::position2d<irr::s32>(0,0),
irr::core::rect<irr::s32>(0,0,config.screenSize.Width,
config.screenSize.Height));
driver->enableMaterial2D(false);
}