Hi all,
Hi, I am new to irrlicht and 3D technology but not to C++ programming. I have done some tutorials etc on irrlicht. I have this problem with displaying images:
I modified the user interface tutorial (05.UserInterface) and replaced the logo with my own image. In windows explorer I can see the image clearly displayed but in the demo drawn by the irrlicht engine it looks distorted. What am i doing wrong? I tried number of different images. They all end up being distorted. I am not doing any re-scaling as far as i can tell. I tried setting the useAlphaChannel to true and false but it makes no difference.
Any suggestions would be much appreciated.
Code Line:
env->addImage(driver->getTexture("gfx/Test.png"),
position2d<int>(10,10), false);
Distorted images being displayed in a demo
Great this works. Thanks very much for ur help Eigen.
I assume that they have to be powers of 2 in order to aid optimisation of the 3d accelerated cards?
Since the engine resizes an image if i is not power of 2 on either axis, does that mean that all images must be 2^nx2^m? What if i want an image which is 15x21? I could buffer up the image with transparent area but it would still potentially overlay other GUI components and block events no?
I assume that they have to be powers of 2 in order to aid optimisation of the 3d accelerated cards?
Since the engine resizes an image if i is not power of 2 on either axis, does that mean that all images must be 2^nx2^m? What if i want an image which is 15x21? I could buffer up the image with transparent area but it would still potentially overlay other GUI components and block events no?
Martin
Blocking depends on the order you draw your gui elements. If you first draw the image and then a button then the image won't disturb it. There's also a way to draw only a part of the image you need, see draw2DImage. But you can't use it on the gui directly because it's only drawn for one frame.
The image scale only happens with directX. With OpenGL images are not resized. I think.
The image scale only happens with directX. With OpenGL images are not resized. I think.