I want to do something pretty simple needing RTT. I want to draw 1 letter and make it a texture and then render that letter with draw2DImage();
Based on the tutorial, I came out with this code. Unfortunately, it just renders a blank square...
Code: Select all
video::ITexture *Test::GetLetterTexture(std::wstring letter) {
if (hub->irr_driver()->queryFeature(video::EVDF_RENDER_TO_TARGET)) {
video::ITexture *renderTexture = hub->irr_driver()->createRenderTargetTexture(core::dimension2d<s32>(128, 128));
hub->irr_driver()->setRenderTarget(renderTexture, true, true, video::SColor(255, 255, 255, 255));
hub->irr_scenemgr()->drawAll();
Util::fonts.fontTest->draw(question.c_str(), core::rect<s32>(0, 0, 128, 128), video::SColor(255, 0, 0, 0));
hub->irr_driver()->setRenderTarget(0);
return renderTexture;
}
return 0;
}