lcjava / angel-engine

Automatically exported from code.google.com/p/angel-engine
0 stars 0 forks source link

UserInterface takes no state for callbacks #96

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use the UserInterface class
2. Attempt work in callback function

What is the expected behavior? What do you see instead?

The callback lacks closure - There is no way to pass a state to the callback, 
by means of either std::function or a void* pointer, for example.
I'd like to see a way to pass a state to the callback.

What version of Angel are you using? On what operating system? Is it
a downloaded distribution or from Mercurial?
Angel 3.2
Any O/S

Please provide any additional information below.

Please see the attached diffs for the fix.
I chose void* in order not to introduce a dependency on either boost or a 
<functional>, since some standard libraries don't have that header yet.
Note that this will break existing code; should this maybe be available through 
_2 functions externally?

Original issue reported on code.google.com by hanvan11...@gmail.com on 7 May 2015 at 7:00

Attachments: