((CSoftwareTexture2*)texture)->getImage()

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Ulf
Posts: 281
Joined: Mon Jun 15, 2009 8:53 am
Location: Australia

((CSoftwareTexture2*)texture)->getImage()

Post by Ulf »

Is there something wrong with this?
Because it crashes. It works the first time (manages to draw that image once), then it crashes on the next frame.

Code: Select all

IImage * image = ((CSoftwareTexture2*)texture)->getImage();
if (!image )
	return;

if (useAlphaChannelOfTexture)
	image->copyToWithAlpha(BackBuffer, 
	destRect.UpperLeftCorner, sourceRect, colors->color, clipRect);
else
	image->copyTo(BackBuffer, 
	destRect.UpperLeftCorner, sourceRect, clipRect);
Am I not able to use getImage() like that?

I also noticed that the check

Code: Select all

if (!image)
	return;
does not work. Even if the IImage is NULL it does not return.
What am I doing wrong?
I can hear birds chirping
:twisted:

I live in the Eye of Insanity.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I hope to god that this code is in the Irrlicht source that you're trying to modify. If you are trying to modify Irrlicht, you need to be sure to rebuild the library entirely, and you need to be sure that you don't have old versions of the Irrlicht.dll floating around.

Travis
Ulf
Posts: 281
Joined: Mon Jun 15, 2009 8:53 am
Location: Australia

Post by Ulf »

Yea of course, I put it in draw2DImage for the Burnings software driver.

I have done it differently, but when I tried that it kept crashing.

I don't need to rebuild the library or worry about the dll, because I included the source code in my game engine so I can also debug irrlicht functions.
So I am not using the dll, but the source code directly.
It helps me test.

Or am I misunderstanding that?
I can hear birds chirping
:twisted:

I live in the Eye of Insanity.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I think you have to give more information explaining the problem that you are seeing.

If this code is not in the Irrlicht library because you've copied the headers/source of the Irrlicht library into your application, you're asking for trouble. Be sure that you don't duplicate names of classes in the Irrlicht library.

Travis
Post Reply