StaticImage broken in 040? (warning screenshots)

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

StaticImage broken in 040? (warning screenshots)

Postby Van » Sun Sep 18, 2005 22:59

Window XP
Ogre: 104
CEGUI 040
MS Dev: 7.1

I have compiled (serveral times now) the 040 CEGUI lib and the only issue I have is that the StaticImage no longer displays my background image properly. The only thing that has changed in the CEGUI lib...

Here is how the screen is suppose to look:
(white boxes are there on purpose to blank out information).

Image


But here is how it is appearing in CEGUI in the StaticImage window:
Note how the bottom of the image exceeds the window rect boundry.


Image


Here is my ImageSet definition

Code: Select all

<?xml version="1.0" ?>
   <Imageset Name="IntroImageset" Imagefile="Intro.png" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="true">
   <Image Name="Intro" XPos="0" YPos="0" Width="1024" Height="768" />
</Imageset>


Here is my Intro.XML file:

Code: Select all

<?xml version="1.0" ?>
<GUILayout>
      <Window Type="TaharezLook/StaticImage" Name="Intro/StaticImage">
         <Property Name="AbsoluteRect" Value="l:0.000000 t:0.000000 r:1024.000000 b:768.000000" />
         <Property Name="ClippedByParent" Value="False" />
         <Property Name="FrameEnabled" Value="True" />
         <Property Name="RelativeRect" Value="l:0.000000 t:0.000000 r:1.000000 b:1.000000" />
      </Window>
</GUILayout>


Here is the code in C++

Code: Select all

   CEGUI::WindowManager& mWinMgr = CEGUI::WindowManager::getSingleton();
   mRootWindow = mWinMgr.loadWindowLayout((CEGUI::utf8*)"Intro.xml");
   CEGUI::System::getSingleton().getGUISheet()->addChildWindow(mRootWindow);

   // Bind special pointers to the widgets
   mIntroImage = static_cast<CEGUI::StaticImage*>(mWinMgr.getWindow((CEGUI::utf8*)"Intro/StaticImage"));
   if (mIntroImage)
   {
      mIntroImage->setImage("IntroImageset", "Intro");
      mIntroImage->setVisible(true);
      mIntroImage->show();
   }



Has something changed? Am I missing something?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: StaticImage broken in 040? (warning screenshots)

Postby CrazyEddie » Mon Sep 19, 2005 09:15

Ensure the physical dimensions of the source image file are powers of two.

Nothing has changed with regards to this,

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Re: StaticImage broken in 040? (warning screenshots)

Postby Van » Mon Sep 19, 2005 16:42

CrazyEddie wrote:
Ensure the physical dimensions of the source image file are powers of two.

Nothing has changed with regards to this,


The first screen shot (above) IS the background image. It's 1024 x 768. Are you saying that this ratio is not correct?

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Re: StaticImage broken in 040? (warning screenshots)

Postby Gaal » Mon Sep 19, 2005 17:42

I would like to tell you that I noticed the same problem. The same ImageSet does not work with 0.4.0.
In 0.3.0 my image was not powers of 2 ( 181 * 358 ) (neither width not length!) and it worked! :P

Which dimension should be power of 2?
each of width and length ?
or only the area (width*length) ? :hammer:

User avatar
saetrum
Quite a regular
Quite a regular
Posts: 55
Joined: Wed Jan 12, 2005 12:06
Location: Albuquerque, NM USA

Re: StaticImage broken in 040? (warning screenshots)

Postby saetrum » Mon Sep 19, 2005 18:17

As CE said, the texture that is being used for the image has to be a power of 2 (both dimensions), 64x64, 128x128, 32 x 256, etc.

This was the case in previous versions, but was not enforced until now for some reason.
There are 10 types of people in the world: those that understand binary and those that don't.

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Re: StaticImage broken in 040? (warning screenshots)

Postby Van » Tue Sep 20, 2005 12:03

I guess I have to ask:

1. Why does it have to be a power of 2?

2. Why enforce it now if it worked in the past?

3. 1024 x 768 is a power of two... Why isn't it working?
Please stop automatically logging me out of the forums!

User avatar
paddy
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Jan 12, 2005 12:06

Re: StaticImage broken in 040? (warning screenshots)

Postby paddy » Tue Sep 20, 2005 19:44

Van wrote:
I guess I have to ask:

1. Why does it have to be a power of 2?

2. Why enforce it now if it worked in the past?

3. 1024 x 768 is a power of two... Why isn't it working?


1024 x 512 and 1024 x 1024 would be powers of two, but 768 is 1.5 x 2^9

add empty space up to 1024 for your height, or shave off enough to fit it in 512, and it should work. I believe in ogre when you use 768, it bumps it up to the next higher power anyway, so your memory footprint wouldn't change. I think thats the case at least.

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Re: StaticImage broken in 040? (warning screenshots)

Postby Van » Wed Sep 21, 2005 00:07

well crap.. CEGUI can't do my splash screens anymore... :cry:
Please stop automatically logging me out of the forums!

User avatar
paddy
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Jan 12, 2005 12:06

Re: StaticImage broken in 040? (warning screenshots)

Postby paddy » Wed Sep 21, 2005 02:16

Van wrote:
well crap.. CEGUI can't do my splash screens anymore... :cry:


Only the image source needs to be in powers of two, it shouldn't effect the dimensions of any of your actual display. If you are loading that splash screen from disk, edit it and set it to have a 1024 height as well. I am pretty sure something to that effect happens when ogre loads any image as a texture anyway.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: StaticImage broken in 040? (warning screenshots)

Postby CrazyEddie » Wed Sep 21, 2005 10:43

I don't want to drag this out any longer than is required. But the facts are as follows:

* Nothing within CEGUI has changed for the 0.4.0 release relating to loading textures.
* CEGUI does not directly load the textures.
* Textures are loaded by the underlying rendring system via the Renderer object
* CEGUI does not manipulate the loaded textures in any way, it just uses what it is returned by the underlying systems.

Most of the renderers seem to stretch images to the next power of two - this is nothing new, there are many threads right here on the forums with exactly this issue. It dates back to before the 0.1.0 release.

All of the above is not speculation, or possibilities, it is the facts. Reverting to an earlier release would demonstrate this to be so. This being so, and my prior knowledge of this, is why the system always specified that image file dimensions should be powers of 2, and also that image files should ideally be square. This was not specified because we had any intention of changing behaviour (because behaviour has not changed within CEGUI); this was specified because we knew that we could not guarantee behaviour of all the underlying APIs and engines, except in the case where the source image is square and has dimensions that are powers of 2.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 10 guests