Compiling sources.

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
alipolatolu
Just popping in
Just popping in
Posts: 14
Joined: Wed Jan 12, 2005 12:06
Location: Turkey
Contact:

Compiling sources.

Postby alipolatolu » Tue May 11, 2004 20:00

Yep, i modified drawself method and worked. Everything is great. But It's working slowly now. when I added three window, FPS downs to ~25.
I added picture below. You can see where the frame is and where the image :) RenderableImage is in center. And you can understand what i did. This is a frame window that has two frames :D Notice that, I changed the RenderableImage's colour to different, so it can be seen :D

Image
Don't think that FPS:436 is great :D I don't know why it wrote it :D

I examined your renderer class code. And see that we can only add quads for rendering. Will you update this in future? Can we render other shapes that have more vertices?

Thanks,

Polat

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

Compiling sources.

Postby CrazyEddie » Wed May 12, 2004 08:14

:-D

That screenshot looks very cool, thanks for posting it :) I see I'm going to have to improve the demos in the next version to keep up with some of you guys! :twisted:

With reference to frame rates, you should be able to do better than ~25FPS with 3 windows. My best guess would be that you're running the debug build? This really suffers in the performance stakes, how do things change if you compile and run a release version? Also this may be affected by the DirectX debug/release runtime. I get better performance on a system with an AMD 1.4Ghz with GF2MX then I do on my development system which is a 2.0Ghz with GF4Ti - I attribute the difference (~800FPS compared to ~450FPS) to the fact the my dev system runs the debug DirectX runtime.

There are no current plans to add additional shapes to the renderer since it may not be of great benefit to the majority of users, though if someone came up with a compelling reason I would certainly consider putting it on the to-do list for some future version.

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

Compiling sources.

Postby leedgitar » Tue May 18, 2004 19:19

Also, keep in mind that alpha blending starts dipping in to your fill rate, so a few big windows blending with everything else will definately cause a noticable FPS hit.

Nice screenshot by the way!

User avatar
alipolatolu
Just popping in
Just popping in
Posts: 14
Joined: Wed Jan 12, 2005 12:06
Location: Turkey
Contact:

Compiling sources.

Postby alipolatolu » Tue May 18, 2004 20:13

Thanks a lot for your interest. I will post new screen shots when they are ready. :D

Polat

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

Compiling sources.

Postby CrazyEddie » Wed May 19, 2004 08:14

Also, keep in mind that alpha blending starts dipping in to your fill rate, so a few big windows blending with everything else will definately cause a noticable FPS hit.


This is one area where some optimisation could be achieved, as currently alpha-blending is 'always-on'. It's possible that modifying the renderer to do thins in two batches (alpha and non-alpha) could improve performance, though I have not tried anything like this yet.

User avatar
alipolatolu
Just popping in
Just popping in
Posts: 14
Joined: Wed Jan 12, 2005 12:06
Location: Turkey
Contact:

Compiling sources.

Postby alipolatolu » Sun May 30, 2004 14:13

Hi paul,

I have some problems, I will be glad if you help me. I made a topBar and bottomBar widgets, you can see them in the picture.

Image

In topBar there is a some extra windows showing some information about Weather and about the day :) I created them with a new class and called it PLMiniWindow :) It's a derived class from Window, like a frame window. and PLMiniWindow also has a client area to show sub-windows (widgets). as you can see there is some WLStatic and Button. I also make a ImageBox for showing weather status icon and added to the PLMiniWindow in the topBar.

In PLTopBar there is two window defined as

Code: Select all

PLMiniWindow*     d_weather;
PLMiniWindow*     d_today;


I create these windows in topBar's "layoutSubControls" void.

I also have PLWeather and PLToday classes that has some WLStatic, WLButton components. These sub components of PLWeather and PLToday are adding to the d_weather and d_today's child-window list :)

and this is the code what I'm trying to explain

Code: Select all

void PLTopBar::layoutSubControls()
{
   PLMiniWindow* d_weatherMini = new PLMiniWindow();
   d_weatherMini->initialise();
   getClientAreaWindow()->addChildWindow(*d_weatherMini);
   d_weatherMini->setPosition(850, 2);
   d_weatherMini->setSize(75, 61);
   d_weatherMini->setAlpha(0.5);
   d_weatherMini->setCaptionText("Weather");
   d_weatherMini->show();

   d_weatherMini->getClientAreaWindow()->addChildWindow(*d_weather->getSTMax());
   d_weatherMini->getClientAreaWindow()->addChildWindow(*d_weather->getSTMin());
   d_weatherMini->getClientAreaWindow()->addChildWindow(*d_weather->getSTHum());
   d_weatherMini->getClientAreaWindow()->addChildWindow(*d_weather->getBTDetails());
   d_weatherMini->getClientAreaWindow()->addChildWindow(*d_weather->getWeatherImg());


   d_todayMini = new PLMiniWindow();
   d_todayMini->initialise();
   getClientAreaWindow()->addChildWindow(*d_todayMini);
   d_todayMini->setPosition(930, 2);
   d_todayMini->setSize(55, 61);
   d_todayMini->setAlpha(0.5);
   d_todayMini->setCaptionText("Today");
   d_todayMini->show();

   d_todayMini->getClientAreaWindow()->addChildWindow(*d_today->getDay());
   d_todayMini->getClientAreaWindow()->addChildWindow(*d_today->getDate());
   d_todayMini->getClientAreaWindow()->addChildWindow(*d_today->getTime());
   d_todayMini->getClientAreaWindow()->addChildWindow(*d_today->getSet());

}


the PLToday and PLWeather components has their own UpdateSelf() void for updating values of date and weather status, or anything else. The problem is here :) Where can I update this values, what is the event for this, I only need to call UpdateSelf() method to update the time, date or anything.

Will I create a timer? if yes, how can i do that :D

After this top and bottom bar completed, i will start coding SideBar widget.

Thanks,

Polat

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

Compiling sources.

Postby CrazyEddie » Sun May 30, 2004 14:45

Hi,

First off I have to say that the screenshot looks awesome! :D

To answer your question... There is no updating method in the system. What I suggest is this:

Add a method to Window called onUpdateEvent, and pass in some parameters of relevance - either a timecode to say how long has passed or a object of some type which has the relevant data for the update (I'm just using a 'seconds elapsed' approach in the example below). You'll also want a virtual function in Window to do the actual update (basically just promote your updateSelf method to the base class and give it an empty implementation).

Example:

In Window.h:

Code: Select all

// Do updates
void onUpdateEvent(float seconds_elapsed);

// function to perform actual update
virtual void updateSelf(float seconds_elapsed);


In Window.cpp:

Code: Select all

void Window::onUpdateEvent(float seconds_elapsed)
{
   // do update on child windows
   for (std::vector<Window*>::iterator child = d_children.begin(); child != d_children.end(); ++lc) {
      (*lc)->onUpdateEvent(seconds_elpased);
   }

   // do actual update for this window
   updateSelf(seconds_elapsed);
}

void Window::updateSelf(float seconds_elapsed)
{
   // Default implementation does nothing.
   // Override this virtual function to perform update operations
}


Within Windows you will have your timer running, and when the timer reaches the appropriate value you need to trigger an event within the GUI.
You could add a method to Utils to pump this in or simply do:

Code: Select all

CEGUI::Utils::instance()->getRootWindow()->onUpdateEvent(seconds);


Obviously this is just an example, you may or may not need the parameter in there depending on your exact needs (probably the derived windows have the info they need to update already, so you could leave out the parameter).

Hope this helps :)

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

Compiling sources.

Postby CrazyEddie » Sun May 30, 2004 14:56

Polat,

One other thing I noticed...

Depending if layoutSubControls() gets called a lot, you'll be constantly creating new copies of those child windows (which may be a major perfomance drain, and also leak memory).

What I suggest is that the windows all be created one time only in the initialise() function, and then the layoutSubControls is just used for updating the size and position of the child windows (rather than re-creating them from scratch). This may be a non-issue if layoutSubControls is only called once, but if it's called more than once I think you'll have a problem. ;)

User avatar
alipolatolu
Just popping in
Just popping in
Posts: 14
Joined: Wed Jan 12, 2005 12:06
Location: Turkey
Contact:

Compiling sources.

Postby alipolatolu » Sun May 30, 2004 21:46

Thanks for suggestion paul, I have moved the creation code to constructor of PLTopBar class. I saw it when copying code to the forum ;)

By the way, I made timer and wrote Update events, It's working now. thanks for your help. I use setText method of WLStatic control, OnUpdateEvent triggers every 1000 miliseconds but WLStatic control is not show it's value. Do you have suggestion for this?

Thanks a lot paul, take care

Polat,

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

Compiling sources.

Postby CrazyEddie » Mon May 31, 2004 06:34

I'm not sure at the moment. Is the problem that it is not updating (so after you call setText it still has the previous text) or that it is not drawing at all?

The setText on WLStatic is supposed to react to the text change (via onTextChanged) and set the same text on the embedded RenderableText object (which is used for the rendering) - if this mechanism is somehow broken then that will be the problem.

I'll keep thinking about it and post back if I come up with anything else...


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests