Robadob / sdl_exp

Low-level graphics engine built over SDL2
MIT License
1 stars 2 forks source link

Keypress callback within scene #16

Closed Robadob closed 8 years ago

Robadob commented 8 years ago

Provide the facility for scenes to hook into the visualisation key press handler (block unwanted default key presses, and add custom actions).

Can't just pass a generic function pointer, because member functions pass their own pointer as the first variable, this would require using a static member function, global function or a lambda, none of which are desirable solutions. Instead will have to hook it up the same as update() is already called.

This would be useful within SP-Bench for toggling the render of the PBM.

Robadob commented 8 years ago

Not technically in progress, but this should be a fast change. I should get it done over the weekend after CUDA interop.

Robadob commented 8 years ago

With this change I think I'll also change update() so it passes a value to indicate the time since the last call to update(). Snip, done this straight into master. d30b2fc

Robadob commented 8 years ago

3b883fe