How to change deviceType in the middle of the game??

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
charlie
Posts: 10
Joined: Tue Aug 15, 2006 4:11 am

How to change deviceType in the middle of the game??

Post by charlie »

Hi
I have found that the Image was displayed diffently bettwen under the deviceType video::EDT_SOFTWARE2 and video::EDT_DIRECT3D9

//my Code:
BackGround=gGui->addImage(core::rect<int>(0,0,1024,768));
BackGround->setImage(Texture);

The Image was displayed more refined under video::EDT_SOFTWARE2.

But my 3D models can't run swimmingly under video::EDT_SOFTWARE2

So I want use video::EDT_DIRECT3D9,and change to video::EDT_SOFTWARE2 when I want to show Image.

Am I right ???
Student
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, you want to use image dimensions of size 2^Nx2^M from which you crop the unnecessary (additional) parts. Otherwise the images are resized to the next larger power-of-two size with a rather simple algorithm.
charlie
Posts: 10
Joined: Tue Aug 15, 2006 4:11 am

Post by charlie »

Sorry
I can't comprehend your opinion.
:oops:

My .bmp file is 1024*768
The Game Engin don't need to change anything.

And how can I solve the problem?
Student
kornerr
Posts: 245
Joined: Thu Jul 06, 2006 9:57 am
Location: Russia, Siberia, Kemerovo
Contact:

Post by kornerr »

Your image width and height must be of power 2.
Something from this: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc.
You have 768, which is 2x2x...x3. It's not power of 2. You must add some space to the bottom to make your image of size 1024x1024 (or remove some space from the bottom to make you image of size 1024x512).
Open Source all the way, baby ;)
OSRPG
RhavoX
Posts: 33
Joined: Tue Jul 04, 2006 7:27 pm

Post by RhavoX »

Or if you really want to use an image with dimesnions 0f 1024x768 then use 1024x1024 and add some transparency to it so it'll look 1024x768 :P
Teh Uber-Pwner xD
Post Reply