Polling events for different subsystems

Hello all,

Currently I’m working on a (not yet open-source) cross
platform gaming engine.
I’ve made different subsystems for video, audio and
input,
not depending on any multimedia library such as SDL
and DirectX.

The problem occure when writing the subsystems using
SDL,
what I want is to poll events separately for each
subsystem
(while syncing with a timer of course) and I’m not
sure how
to do that the right way?

It’s important that the SDL events are not being
polled
at the main loop to keep it independent of using SDL.
I already polled events in each SDL subsystem, but it
didn’t work as expected.

What I don’t understand is, there is the possibility
to initialize
and unitialize subsystems separately, so I assume it’s
also possible
to poll events separately for each subsystem.

My questions are:

  • How to poll events for different subsystems?
  • How to sync the different subsystems with a timer
    (Not a SDL question I assume) the right way?

Thanks in advance,

Mike Machuidel__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

The problem occure when writing the subsystems using SDL,
what I want is to poll events separately for each subsystem
(while syncing with a timer of course) and I’m not sure how
to do that the right way?

I’m not sure what you mean by polling an event for each subsystem?
You can always call SDL_PollEvent() and discard the event and then
check the current device state later in your program.

Is that what you want?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment