[SOLVED] Resolution & Quality [ Widescreen Question ]

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
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

[SOLVED] Resolution & Quality [ Widescreen Question ]

Post by shivanraptor »

I've solved my previous problem on adding images to Irrlicht program .
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=18024

but now , there is a similar problem .
I use AddImage function to add an image of dimension 1024x 768 to my program . when it is shown on 4:3 PC (1280x 1024) , it looks OK ; but if i run the same stuff on a 16:9 PC (1280 x800) , the image collapsed like the print screen in the previous post .

does Irrlicht know how to stretch images ? or additional codes needed ?
please help .

i am using Irrlicht 1.2 .NET version .
i write my program in C# .
codes of C++ are welcome too ~
Last edited by shivanraptor on Fri Jan 05, 2007 3:27 pm, edited 2 times in total.
Irrlicht.NET user
* * * * * * * * * * * * *
Currently working on:
RPG Turbulence 2
Game Engine Turbulence Engine
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

No, the AddImage function can't strech the image !!!
If you want to strech an image you'll have to use draw2DImage instead !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

Post by shivanraptor »

i tried the Draw2DImage function.

my sequence of drawing is :

//start loop
BeginScene
Draw2DImage
AddGUIButton
AddGUIButton
AddGUIButton
AddGUIButton
GUIEnvironment.DrawAll
EndScene
//end loop

i hope you know what i am talking about .
only GUI buttons are shown , but the 2DImage flashes in a second and is replaced with a gray layer .

Can GUI mix with Draw2DImage ? or with GUI , AddImage must be used ?
Irrlicht.NET user
* * * * * * * * * * * * *
Currently working on:
RPG Turbulence 2
Game Engine Turbulence Engine
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Offcourse he knows what hes talking about. You will get distortion if you shrink the image...I thot u can you 1024X1024 to solve your problem like in previous post? Or if irrlicht's shrinking is too blurry maybe then a different library can do that for u. I wonder if Magic2D can help...
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

Post by shivanraptor »

BlindSide wrote:Offcourse he knows what hes talking about. You will get distortion if you shrink the image...I thot u can you 1024X1024 to solve your problem like in previous post? Or if irrlicht's shrinking is too blurry maybe then a different library can do that for u. I wonder if Magic2D can help...
( confused ... )

i just want to find a way to tackle different resolution , or actually deal with different aspect ratio . i glanced through MSDN , i found some useless codes to detect screen resolution , instead of the display resolution . please help !
Irrlicht.NET user
* * * * * * * * * * * * *
Currently working on:
RPG Turbulence 2
Game Engine Turbulence Engine
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

who is talking about what ??? :lol:

draw2DImage creates no gui image, it must be called every render loop (between startScene and endScene) !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

Post by shivanraptor »

i successfully modified the codes and let the Draw2DImage be run in every render loop , however , the image is still corrupted like before .
am i making mistakes ?

this is my function call :

Code: Select all

pathname : the path of the texture
driver : IrrlichtDevice.VideoDriver
my screen resolution is 1024x768
my display resolution is 1440x900
the texture size is 1024x768

Draw2DImage(driver.GetTexture(pathname), new Position2D(0, 0), new Rect(new Position2D(0,0), new Dimension2D(1440, 900)), new Irrlicht.Video.Color(255, 255, 255, 255), true);
can the function call above stretch the image ?
Irrlicht.NET user
* * * * * * * * * * * * *
Currently working on:
RPG Turbulence 2
Game Engine Turbulence Engine
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

texture size must be in the power of 2 !!!
So the next suitable size would be 1024*1024 !!!

and don't use a color with draw2DImage !!!
It's not a color, it's an array of four colors !!!
Use 0 instead !!!!
it should be like this:

Code: Select all

draw2DImage(texture, recDest, recSource, 0, 0, true);
look ito the api for more informations...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

Post by shivanraptor »

it works , thanks !
i change the texture to 1024x1024 , then clip it by the size i need .

however , isn't the update of Irrlicht 1.2 include the following??
- Non-power-of-two textures are left unscaled if the driver supports such textures.
or it represents other meaning ? actually i don't quite understand this line .
Irrlicht.NET user
* * * * * * * * * * * * *
Currently working on:
RPG Turbulence 2
Game Engine Turbulence Engine
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

AFAIK
ITexture must still have a resolution with 2^n
IImage can have any resoultion you want
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

Post by shivanraptor »

i see . thanks . solved .
Irrlicht.NET user
* * * * * * * * * * * * *
Currently working on:
RPG Turbulence 2
Game Engine Turbulence Engine
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, it's supported for all textures, but your hardware must also support it. If you don't have the hardware support you still have to handle this on your own.
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

Post by shivanraptor »

hybrid wrote:No, it's supported for all textures, but your hardware must also support it. If you don't have the hardware support you still have to handle this on your own.
do you mean display card ? mine is an ATi Raedon 9800 Pro .
what is the hardware requirement ? which hardware will support the non-power-two textures ?
Irrlicht.NET user
* * * * * * * * * * * * *
Currently working on:
RPG Turbulence 2
Game Engine Turbulence Engine
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, I'd thought that it would work with that card. Check out the DirectXCaps tool and read the NPOT feature.
Post Reply