Page 1 of 1

[SOLVED] eventUpdated function not called

Posted: Fri Oct 11, 2013 18:18
by osbios
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->subscribeEvent(CEGUI::FrameWindow::EventUpdated, CEGUI::Event::Subscriber(&ceguiCircuitEditor::eventUpdated, this));

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?

Re: eventUpdated function not called

Posted: Sat Oct 12, 2013 14:12
by Kulik
This *should* work (tm). Show us how you are injecting the time pulses.

Re: eventUpdated function not called

Posted: Mon Oct 14, 2013 00:07
by osbios
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))
  if (closeProgram) break;

  glClearColor(0.0, 0.0f, 0.3f, 0.0f);


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

[SOLVED]Re: eventUpdated function not called

Posted: Wed Oct 16, 2013 14:22
by osbios
Solved: viewtopic.php?f=10&t=6215

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