rendertarget => ITexture*
renderlockpos => void*
If I disable the bold lines, it works fine (I get the scene rendered on the screen, indirectly through the rendertarget-ITexture*). But when activating them (no matter if I remove the 1 == 1 in the italic line too for not ignoring a failed lock) I get a black screen instead of the rendered picture.while(device->run() && wquit == 0 && TERMINATENOW == 0)
{
driver->setRenderTarget(rendertarget, true, true, video::SColor(0,0,0,255));
mechphysics();//just calculates something interal
drawmechs();//just calculates something interal
driver->beginScene(true,true,video::SColor(255,100,250,255));
smgr->drawAll();
driver->setRenderTarget(0);
driver->draw2DImage(rendertarget,core::position2d<s32>(0,0));
renderlockpos = rendertarget->lock();
if (renderlockpos > 0 || 1 == 1) {
rendertarget->unlock();
driver->draw2DImage(rendertarget,core::position2d<s32>(0,0));
guienv->drawAll();
driver->endScene();
}else{printf("LOCK FAILED!!!\n");driver->endScene();}
str = L"Project Bagaioseph ";
str += driver->getFPS();
str += L" ";
str += myfps;
device->setWindowCaption(str.c_str());
}