I am going to take OpenInput for a spin.
And then, just bite the bullet and port OIS - or rewrite it in C. (It's basically just wrapping C code anyway..)
OpenInput hasn't been updated in 3 years, but so what?
Input hasn't really changed much.
I think it's silly to rely on beasts like Allegro (nice beast none the less) or SDL when all we really need is input for the samples (sounds familiar?
)
The only bad thing about
OpenInput (aside from the fact that it's not maintained) is the license.. But SDL is just as bad.
Allegro is nice, but they still don't have the option of passing it a window handle.
Code: Select all
// Placeholder for the event
oi_event ev;
// Initialise
oi_init("c:0 s:0 w:0", OI_FLAG_NOWINDOW);
// Wait for an event
oi_events_wait(&ev);
// Print something to the screen
printf("Hello OpenInput event!\n");
// Cleanup after ourselves
oi_close();
And giving it the window handle is easy:
Code: Select all
HWND hwnd;
char hook[40];
hwnd = CreateWindow("Hello OpenInput", ..., ...);
sprintf(hook, "c:0 s:0 w:%u", (unsigned int)hwnd);
oi_init(hook, 0);
If it's not too horrible, I'll rather use that instead of the 'monsters'.