2D Image exploding.

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
Nosvera2
Posts: 16
Joined: Wed May 28, 2008 3:11 am
Location: Van Buren, Arkansas

2D Image exploding.

Post by Nosvera2 »

I just started working on a game for the first time with Irrlicht and I began with creating an overlay menu for the game. My problem is this, the .bmp file I'm using for the overlay is suppost to be 640x480 but when the game loads the image explodes to 1024x480ish. Below is the code creating it. Does anyone know what may be causing this?

code:
ITexture* images = driver->getTexture("../../media/mmo_gui.bmp");
driver->makeColorKeyTexture(images, position2d<s32>(0,0));

code that draws it, it goes to 1024 because thats the only way to see the whole image:
driver->draw2DImage(images,position2d<s32>(0,0),rect<s32>(0,0,1024,510),0,SColor(255,255,255,255),true);
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You give it a source rect of 1024x510, try 640x480 ;)

And also your image will probably get scaled up to 1024x512 (the nearest power-of-2 dimensions) as most graphics cards don't like non-power-of-two textures and this up-scaling will ruin the quality of your image so it's best to provide the image in power-of-two dimensions as you can up-scale it yourself in an image editor much better.
Image Image Image
Nosvera2
Posts: 16
Joined: Wed May 28, 2008 3:11 am
Location: Van Buren, Arkansas

uhhh...no!

Post by Nosvera2 »

The reason I have the source rectange set to 1024x510 is because if I have it as 640x480, I only see a part of the whole image. Like I said before, the image has exploded in a way that it shouldn't and I don't know why.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Show us a screenshot of what you get and what you'd like to see so we can understand what's going on a bit better.
Image Image Image
Post Reply