[no bug]removeTexture OPENGL

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
CiRiuS2
Posts: 14
Joined: Mon Oct 26, 2009 12:14 am
Location: Spain

[no bug]removeTexture OPENGL

Post by CiRiuS2 »

First as allway sorry about my english, i will try explain me. I have a function like this:

Code: Select all

void onFinishLoading(...)
{

[...]

      IImage *im = driver->createImageFromData(irr::video::ECF_A8R8G8B8 ,dimension2d<u32>(WIDTH,HEIGHT),buffer,true,true);
		ITexture *res = driver->findTexture("resultado");
		if(res!=0)
		{
			driver->removeTexture(res);
		}
		ITexture *txt = driver->addTexture("resultado",im);

[...]

}
If the driver is not EDT_OPENGL the code works fine. If the driver is EDT_OPENGL, the first time i call the function the texture is added correctly, but the second time when i remove the texture, something is wrong with the method removeTexture.

The pointer txt gets a white texture :shock:. This don't happen with EDT_DIRECT3D9, EDT_SOFTWARE, ...
CiRiuS2
Posts: 14
Joined: Mon Oct 26, 2009 12:14 am
Location: Spain

Post by CiRiuS2 »

Ok forget this, magically today is working with opengl. :?
Nalin
Posts: 194
Joined: Thu Mar 30, 2006 12:34 am
Location: Lacey, WA, USA
Contact:

Post by Nalin »

Just gonna bump this to say that I've been running into this same bug. removeTexture() is causing the same white texture issue for me.

I finally fixed it by doing:

Code: Select all

driver->setMaterial(video::SMaterial());
driver->removeTexture(texture);
I got that fix from this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=26031
bonsalty
Posts: 120
Joined: Thu Dec 10, 2009 1:30 pm
Location: Budapest,Hungary

Post by bonsalty »

This can happen. This happens when you remove the texture and update it.
Solution:

if you remove the texture call SetMaterial before.

Code: Select all

params->driver->setMaterial(video::SMaterial());
params->driver->removeTexture(texture);
This insane workarounds in Irrlicht or OpenGL is what drives everybody mad.
Tomi
Post Reply