minifb-zig-port/src/WindowData.h
Carlos Aragonés cdaa54f5d6 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
2019-11-14 16:18:42 +01:00

43 lines
1.3 KiB
C

#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <MiniFB_enums.h>
typedef struct {
void *specific;
void *user_data;
mfb_active_func active_func;
mfb_resize_func resize_func;
mfb_keyboard_func keyboard_func;
mfb_char_input_func char_input_func;
mfb_mouse_button_func mouse_btn_func;
mfb_mouse_move_func mouse_move_func;
mfb_mouse_scroll_func mouse_wheel_func;
uint32_t window_width;
uint32_t window_height;
uint32_t dst_offset_x;
uint32_t dst_offset_y;
uint32_t dst_width;
uint32_t dst_height;
void *draw_buffer;
uint32_t buffer_width;
uint32_t buffer_height;
uint32_t buffer_stride;
uint32_t mod_keys;
bool close;
bool is_active;
int32_t mouse_pos_x;
int32_t mouse_pos_y;
float mouse_wheel_x;
float mouse_wheel_y;
uint8_t mouse_button_status[8];
uint8_t key_status[512];
} SWindowData;