Commit Graph

32 Commits

Author SHA1 Message Date
GEMALTO\caragone
8179d09c76 Android Support (beta) 2021-11-12 23:05:06 +01:00
Carlos Aragones
cc79a85e3d input_events: Show mouse point on mouse button pressed 2021-02-19 11:13:32 +01:00
Carlos Aragones
fa8bf266f0 Changes related to dpi.
Introduced new function mfb_get_monitor_scale
Deprecated function mfb_get_monitor_dpi
2021-02-19 10:57:13 +01:00
Carlos Aragones
d9a9fe554f Added to iOS
not working on X11 & Wayland
2020-09-21 14:38:51 +02:00
Carlos Aragones
9e3704b96c hidpi compiling on Windows
Fix OpenGL backend for multiple windows
2020-09-21 10:03:35 +02:00
drfuchs
5691ca1441 Add hidpi test
Test hi-dpi "retina" display, where there are four times as many pixels as the window's (height x width) would have you believe.

On hi-res displays, the "HighRes" window will have one-pixel-wide vertical black bars within the red-to-purple gradient, while in the "LowRes" window they'll be two-pixel-wide. On regular displays, LowRes will have the one-pixel bars, and HiRes should be a down-sampled gradient with no bars.
2020-09-20 09:40:03 -07:00
Carlos Aragones
6a1e7e0b71 Wayland support 2020-09-16 13:32:27 +02:00
Carlos Aragones
72df95f7bb working on iOS 2020-09-16 12:54:08 +02:00
Carlos Aragones
82595a8d74 working for windows 2020-09-16 11:38:05 +02:00
Carlos Aragones
5f9594cb23 update_ex working on iOS 2020-09-15 21:05:49 +02:00
Carlos Aragones
f09780d761 added mfb_update_ex - Windows version 2020-09-15 11:35:11 +02:00
Carlos Aragones
2be0d5a7e0 refactor iOS
added mfb_set_resize_callback to iOS
minor fixes on iOS & MacOS X
2020-05-17 18:31:00 +02:00
Carlos Aragones
6a96ceb1f5 Merge branch 'master' into ios_support 2020-04-26 19:52:13 +02:00
Carlos Aragones
78efec66c5 fix issue with mfb_set_viewport on macos x 2020-04-26 19:50:53 +02:00
Carlos Aragones
d0dd063b8f fix issue on macos x 2020-04-26 17:43:19 +02:00
Carlos Aragones
fdd7d8bedb work with and without already created window 2020-04-26 17:42:23 +02:00
Carlos Aragones
6452ec1bfd Merge branch 'master' into ios_tmp
* master:
  fix issue on macos x
  refactor

# Conflicts:
#	src/macosx/MacMiniFB.m
#	src/macosx/OSXWindowFrameView.h
#	src/macosx/OSXWindowFrameView.m
2020-04-26 14:20:48 +02:00
Carlos Aragones
68ecd983f0 fix issue on macos x 2020-04-26 14:10:18 +02:00
Carlos Aragones
8d57780915 refactor 2020-04-26 13:21:08 +02:00
Carlos Aragones
f5db43e07d test 2 & refactor 2020-04-26 13:16:25 +02:00
Carlos Aragones
8e1a981085 test 1 2020-04-26 00:01:14 +02:00
Carlos Aragones
4bd40299eb refactor 2020-04-25 23:16:35 +02:00
Carlos Aragonés
35b8439b26
Add timers and ability to set a target fps for the application (#36)
* working on windows

* minor fix

* working on macosx

* Oops! I reversed resolution and frequency on macos

* working on X11

* working on wayland

* update the readme

* format the readme

Co-authored-by: Carlos Aragones <>
2020-04-22 13:00:15 +02:00
Carlos Aragonés
6b30baa7e4
Type prefixes (#34)
* update documentation

* Fix typo

* Added some examples

* changed window names

* Minor fix

* Added mfb_update_events to all platforms. Checked on Windows, X11 and Wayland

* simplify CMake

* Upgrade to CMake 3.5, simplify script and generalize it
Now the users only have to add_directory and link_libraries(minifb) in CMake

* Renamed typo scrool by scroll
Added some checks
Removed some warnings

* working Windows, X11 and Wayland

* fix issue 32

Co-authored-by: Carlos Aragones <>
Co-authored-by: caragones <carlos.aragonesmartinez-external@gemalto.com>
2020-03-06 07:06:54 +01:00
Carlos Aragonés
0257a60419 mfb_update_events (#27)
* update documentation

* Fix typo

* Added some examples

* changed window names

* Minor fix

* Added mfb_update_events to all platforms. Checked on Windows, X11 and Wayland
2019-12-14 11:20:59 +01:00
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
Carlos Aragonés
e679c38955 Add some examples for the new features (#21)
* Added some examples

* changed window names
2019-06-09 08:50:28 +02:00
Carlos Aragonés
21d9377822 Add multiple windows2 (#19)
* MacOSX with input events and mfb_set_viewport

* Windows with input events and mfb_set_viewport

* Minor changes in macosx and windows

* X11 with input and mfb_set_viewport

* Minor changes on X11

* Fix bug in X11 resize event

* Fix bug in windows resize

* added scale image to X11

* Added stretch_image with & without bilinear interpolation

* moved MiniFB_internal.h

* Added wayland events

* minor changes

* unify a bit the window structs

* More work on wayland

* Added cmake file

* minor fix on windows

* modified test

* Fix on wayland.
Unset wayland as default for linux

* Use stdbool instead of our own macro eBool
Remove prefix e from all enums

* Remove _ex sufix in common files

* merge X11MiniFB_ex.c into X11MiniFB.c

* Merge WaylandMiniFB_ex.c into WaylandMiniFB.c

* Add user_data to callbacks

* Merge WinMiniFB_ex.c into WinMiniFB.c

* Some minor changes on Windows

* Fix bug on Wayland

* Multiple Windows for MacOS X & Linux

* Multiple Windows for Windows
Refactor

* Refactor

* Added mfb_get_key_name

* remove some warnings

* Events per window working on MacOS & Linux (maybe Windows)

* Fix on Windows

* Added default key callback on macos & wayland

* Unify keyboard_default on all platforms

* keyboard_default on all platforms
2019-06-08 20:34:05 +02:00
Carlos Aragonés
8b6148cf97 Add input events (#18)
* MacOSX with input events and mfb_set_viewport

* Windows with input events and mfb_set_viewport

* Minor changes in macosx and windows

* X11 with input and mfb_set_viewport

* Minor changes on X11

* Fix bug in X11 resize event

* Fix bug in windows resize

* added scale image to X11

* Added stretch_image with & without bilinear interpolation

* moved MiniFB_internal.h

* Added wayland events

* minor changes

* unify a bit the window structs

* More work on wayland

* Added cmake file

* minor fix on windows

* modified test

* Fix on wayland.
Unset wayland as default for linux

* Use stdbool instead of our own macro eBool
Remove prefix e from all enums

* Remove _ex sufix in common files

* merge X11MiniFB_ex.c into X11MiniFB.c

* Merge WaylandMiniFB_ex.c into WaylandMiniFB.c

* Add user_data to callbacks

* Merge WinMiniFB_ex.c into WinMiniFB.c

* Some minor changes on Windows

* Fix bug on Wayland

* Added mfb_get_key_name

* keyboard_default on all platforms
2019-06-08 20:11:02 +02:00
Daniel Collin
a00f42a83b Fixed return and removed ESC check 2014-06-06 18:28:39 +02:00
Daniel Collin
e8d4574091 Fixed MSVC warning + grayscale colors 2014-06-06 14:39:09 +02:00
Daniel Collin
d119cfccc8 Added noise test 2014-06-06 10:13:51 +02:00