Page 1 of 1

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

Posted: Fri Jul 14, 2006 12:46 am
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.

Posted: Fri Jul 14, 2006 1:02 am
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 ?

Posted: Fri Jul 14, 2006 1:44 am
by vitek
Yes both of the software renderers use ECF_A1R5G5B5 images as the back buffer.

Travis

Posted: Fri Jul 14, 2006 11:12 pm
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!