loading a 2d image ...

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
Picard

loading a 2d image ...

Post by Picard »

hey guys,
sorry for this question, but I have a huge problem with loading 2d images (for example as a "please-wait-while-loading screen")...

I load that image (tga file) from a zip file (of course uncompressed) ...

Code: Select all

device = createDevice(x, dimension2d<s32>(screenw, screenh), bpp, false, false, false, 0);

[...]

ITexture *splash;
splash = driver->getTexture("images/logo.tga");

while(device->run() && driver)
    {
		driver->beginScene(true, true,0);
		
		// show the splash screen
		if(State == SPLASH && bSO==true)
		{
			bSO=false;
			guienv->addImage(splash, core::position2d<s32>(0,0));
		}

		smgr->drawAll();
		guienv->drawAll();
		
        driver->endScene();
    }
well, the image is loaded and displayed, but it looks very strange...
(I´ve uploaded as jpg because the files are very big)

Original: http://img56.imageshack.us/img56/3355/logo3ji.jpg
My App: http://img56.imageshack.us/img56/6500/screen6go.jpg

as you can see, my app displays it, but in a lower quality.... what´s the reason? :(
I`ve already tried to store that image as bmp... but without any effect 8[
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

make sure your image is a power of 2 size.. you could also try splitting it up into smaller images, not sure if that helps
if you're looking for me, start looking on irc, i'm probably there.
Picard
Posts: 9
Joined: Sun Jul 03, 2005 2:59 pm

Post by Picard »

I also tried to load that small Irrlicht logo (irrlichtlogo.bmp) from the media directory, but it´s displayed in the same way. :(

EDIT:
k, you were right :)
when I tried to load "irrlichtlogoaligned.jpg", it was displayed in the correct way :)

but does maybe anybody know if there´s a way to load 800x600 images with the engine? ^^
thanks in advance :)
Suliman

Post by Suliman »

You probably have to add empty space around the pic, making it 1024x1024 and then draw the 800x600 area as a part of the whole pic (see 2d tutorial).

Hope that helps.
Suliman
Picard
Posts: 9
Joined: Sun Jul 03, 2005 2:59 pm

Post by Picard »

lol yeah, that`s a simple solution ... shame over me!

but really thanks to you ^^
Post Reply