[SOLVED] eventUpdated function not called

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

osbios
Just popping in
Just popping in
Posts: 13
Joined: Thu Jul 21, 2011 20:34

[SOLVED] eventUpdated function not called

Postby osbios » Fri Oct 11, 2013 18:18

I have a simple frameWindow directly on the root window. Now I try to get a function called each time injectTimePulse runs. But my eventUpdated function never gets called.

Code: Select all

CEGUI::FrameWindow *editorWindow;
editorWindow = static_cast<CEGUI::FrameWindow*>(wmgr.createWindow("Vanilla/FrameWindow", ""));
editorWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(0.0f, 50), CEGUI::UDim(0.0f, 50)));
editorWindow->setSize(CEGUI::USize(CEGUI::UDim(0.0f, 500), CEGUI::UDim(0.0f, 400)));
editorWindow->setUpdateMode(WUM_ALWAYS);
editorWindow->subscribeEvent(CEGUI::FrameWindow::EventUpdated, CEGUI::Event::Subscriber(&ceguiCircuitEditor::eventUpdated, this));
CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->addChild(editorWindow);


Code: Select all

bool ceguiCircuitEditor::eventUpdated(const CEGUI::EventArgs& e)
{
    std::cout << "Nobody sees this text :*(";
    return false;
}


---- Version: 0.8.2 (Build: Sep 24 2013 GNU/Linux g++ 4.6.3 64 bit) ----
---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based 2nd generation renderer module. TextureTarget support enabled via FBO extension. ----
---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
---- Image Codec module is: DevILImageCodec - Official DevIL based image codec ----
---- Scripting module is: None ----


How to get that callback?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: eventUpdated function not called

Postby Kulik » Sat Oct 12, 2013 14:12

This *should* work (tm). Show us how you are injecting the time pulses.

osbios
Just popping in
Just popping in
Posts: 13
Joined: Thu Jul 21, 2011 20:34

Re: eventUpdated function not called

Postby osbios » Mon Oct 14, 2013 00:07

SDL_GetTicks returns milliseconds.

Code: Select all

SDL_Event event;
float runtime = 0.0f;
float runtimeElapsed;
while (1)
{
  float oldRuntime = runtime;
  runtime = static_cast<float>(SDL_GetTicks()) / 1000.0f;
  runtimeElapsed = runtime - oldRuntime;

  if (SDL_PollEvent(&event))
  {
    handleEvent(event);
    ceguiProcessEvent(event);
  }
  if (closeProgram) break;

  glClearColor(0.0, 0.0f, 0.3f, 0.0f);
  glClear(GL_COLOR_BUFFER_BIT);
  CEGUI::System::getSingleton().injectTimePulse(runtimeElapsed);
  CEGUI::System::getSingleton().renderAllGUIContexts();

  SDL_GL_SwapWindow(mainWindow);
}


Another question on injectTimePulse, does it also trigger if the input value is 0.0f?

osbios
Just popping in
Just popping in
Posts: 13
Joined: Thu Jul 21, 2011 20:34

[SOLVED]Re: eventUpdated function not called

Postby osbios » Wed Oct 16, 2013 14:22

Solved: viewtopic.php?f=10&t=6215

Porting from a pre-0.8 cegui version I didn't suspect injectTimePulse to be the culprit.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 8 guests