indirect rendering/texture lock problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Yarcanox
Posts: 33
Joined: Sat Apr 14, 2007 11:23 pm

indirect rendering/texture lock problem

Post by Yarcanox »

I have an indirect rendering problem with OpenGL and SVN Rev 862 which seems to have something to do with the texture locking:

rendertarget => ITexture*
renderlockpos => void*
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());
}
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.
I'm not a native English speaker.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yarcanox
Posts: 33
Joined: Sat Apr 14, 2007 11:23 pm

Post by Yarcanox »

sadly the thread doesn't tell me how to solve this problem :cry: - so how can I convert an ITexture to an IImage? That's all I want to do.
I'm not a native English speaker.
Post Reply