On Wed, Jul 31, 2019 at 12:16 PM Tony V E via SG13 <sg13@lists.isocpp.org> wrote:

On Wed, Jul 31, 2019 at 9:40 AM Klaim - Joël Lamotte via SG13 <sg13@lists.isocpp.org> wrote:

3. Device information should always be acquired through callbacks and
helpers built around them.


Not always.  For some devices, this would require polling, as the device doesn't have a push model.

+1
That's just about all devices game devs care about.
 
Also think of a device connected over a network - do you want a constant data stream, or just get data when needed.

I guess pull-model devices could use a callback model where you set up the callbacks and then call device.check_for_changes() or something like that.

They could, and in game dev we mostly achieve that through an event system. But really important: If you are going to mandate the push model, please also mandate that it be externally driven. Not having control over that causes all kinds of nightmare concurrency interactions (I'm looking at you UIKit).

--
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net