Direct mode (#23)

* update documentation

* Fix typo

* Added some examples

* changed window names

* Minor fix

* renamed callback setters (added _set_)
Direct / Poll Mode for asking events:
 bool            mfb_is_window_active(struct Window *window);
unsigned        mfb_get_window_width(struct Window *window);
unsigned        mfb_get_window_height(struct Window *window);
int             mfb_get_mouse_x(struct Window *window);            // Last mouse pos X
int             mfb_get_mouse_y(struct Window *window);            // Last mouse pos Y
float           mfb_get_mouse_scrool_x(struct Window *window);     // Mouse wheel X as a sum. When you call this function it resets.
float           mfb_get_mouse_scrool_y(struct Window *window);     // Mouse wheel Y as a sum. When you call this function it resets.
const uint8_t * mfb_get_mouse_button_buffer(struct Window *window);  // One byte for every button. Press (1), Release 0.
const uint8_t * mfb_get_key_buffer(struct Window *window);           // One byte for every key. Press (1), Release 0.

* Minor fixes

* Fixes related to mouse poll

* Minor fix on Win64
This commit is contained in:
Carlos Aragonés
2019-11-14 16:18:42 +01:00
committed by Daniel Collin
parent 25a440f822
commit cdaa54f5d6
17 changed files with 732 additions and 602 deletions

View File

@ -99,13 +99,13 @@ int main()
Events e;
mfb_active_callback(window, &e, &Events::active);
mfb_resize_callback(window, &e, &Events::resize);
mfb_keyboard_callback(window, &e, &Events::keyboard);
mfb_char_input_callback(window, &e, &Events::char_input);
mfb_mouse_button_callback(window, &e, &Events::mouse_btn);
mfb_mouse_move_callback(window, &e, &Events::mouse_move);
mfb_mouse_scroll_callback(window, &e, &Events::mouse_scroll);
mfb_set_active_callback(window, &e, &Events::active);
mfb_set_resize_callback(window, &e, &Events::resize);
mfb_set_keyboard_callback(window, &e, &Events::keyboard);
mfb_set_char_input_callback(window, &e, &Events::char_input);
mfb_set_mouse_button_callback(window, &e, &Events::mouse_btn);
mfb_set_mouse_move_callback(window, &e, &Events::mouse_move);
mfb_set_mouse_scroll_callback(window, &e, &Events::mouse_scroll);
mfb_set_user_data(window, (void *) "Input Events CPP Test");