Drawing text in texture tut doesn't work in software.

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
cederron
Posts: 53
Joined: Thu Jul 13, 2006 11:35 pm

Drawing text in texture tut doesn't work in software.

Post by cederron »

Hello all, my first post!
Well this is actually a doble post because I post it somewhere else but I think this is the correct place, sorry for that.

First I must say a big thank you to Emil Halim because his work is helping me a lot.
Now the question: I have followed the tutorial 'Drawing text in texture' http://www.irrforge.org/index.php/Drawi ... in_texturewritten by Emil and it works fine under Directx9 and OpenGL renderers but it doesn´t work under the software renderer.
I'm writing a small application for a specialized hardware and i must use the software renderer.
The tutorial crashes on line : s32 x1 = Positions[chr].UpperLeftCorner.X;
in DrawString() func.
It seems chr is too big and goes out of bounds of 'Positions' array. I don't really know what is 'Positions' used for. Any help?
Do you know how can i fix that ?

I can upload the code ready to compile if someone wants to.
cederron
Posts: 53
Joined: Thu Jul 13, 2006 11:35 pm

Post by cederron »

I think I have a clue, Emil's code manages 32 bit textures only and I don't know for sure but maybe the software renderer creates only 16 bit textures... Is that true ?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Yes both of the software renderers use ECF_A1R5G5B5 images as the back buffer.

Travis
cederron
Posts: 53
Joined: Thu Jul 13, 2006 11:35 pm

Post by cederron »

I have resolved it, change types from s32 to s16 and a couple >>2 to >>1.

Sometimes its better to think a bit about the problem then asking to get a quick response!
Post Reply