Orx event call order

edited September 2013 in General discussions
No info on this any where, what is the event call order for single frame ? There are
1. Main clock update,
2. Secondary clock update
3. Object event
4. Physics event
5. Animation event
6. Render Event
7. Input event

Maybe I have missed a few, but which one is called first and which one is called last in a frame. Its not super necessary, but I am kinda curious.


  • edited September 2013
    It's a very good question, I'm actually surprised no one asked it earlier! :)

    I'm not sure what you mean by secondary clock though.
    Orx creates 2 clocks internally: the "main" one of type "core" with a frequency defined in config, and another one of type "second" with a frequency of 1Hz.

    The second clock is only used for computing the framerate. :)
    The first one is used everywhere else internally.

    Many more clocks can be added. They'll be ticked according to their frequency and time modifier.
    When two clocks are getting ticked during the same frame, they'll be processed in their order of creation.

    When a clock is ticked:
    - first all the timers are updated;
    - then all the registered callbacks get called depending on their priority.

    Priorities go from highest to lowest.

    In the current implementation of orx, here's their order during a single frame:
    1. [highest]: Render calls (previous frame)
    2. [higher] : GLFW internals: display / joystick / mouse
    3. [high] : Console / Input
    4. [normal] : *nothing* (usually user code)
    5. [low] : Objects / Sound streaming
    6. [lower] : Physics / GLFW mouse clean
    7. [lowest] : Display swap

    All the objects components (animations, FXs, spawners, timelines & sounds) are updated directly from their owner object, during the objects updates [low].
  • jimjim
    edited September 2013
    By secondary clock I meant, user defined clock. And thanks for the clarifications. I have more questions but I would wait till I actually encounter them while venturing orx :)
  • edited September 2013
    No worries, ask as many questions as you have, I'll be happy to answer them to the best of my knowledge. :)
Sign In or Register to comment.