Commit Graph

121 Commits

Author SHA1 Message Date
Carlos Aragones
649560ef2f Quick fix for the init_key_codes issue 2020-06-03 17:28:30 +02:00
Carlos Aragonés
3226ac3aad
Merge pull request #38 from emoon/revert-37-fix/build-break
Revert "Fixes build break in linux"
2020-06-03 17:14:24 +02:00
Carlos Aragonés
698b50c664 Revert "Fixes build break in linux (#37)"
This reverts commit 83d7dbc678.
2020-06-03 17:14:09 +02:00
eccard
83d7dbc678
Fixes build break in linux (#37) 2020-06-02 06:13:03 +02:00
Carlos Aragones
1c3054d320 refactor: A little bit more similar iOS & MacOS 2020-05-17 21:22:12 +02:00
Carlos Aragones
ed0afc6b22 Fixed bug on old MacOS X 2020-05-17 20:05:47 +02:00
Carlos Aragones
51d00541e5 OSX Refactor -> renamed OSXViewController to OSXViewDelegate 2020-05-17 19:53:06 +02:00
Carlos Aragones
80a7a33b7c unify a little bit more iOS & MacOS 2020-05-17 19:48:59 +02:00
Carlos Aragones
75de20e4cc OSX refactor -> renamed OSXWindowFrameView to OSXView 2020-05-17 18:39:51 +02:00
Carlos Aragones
235dc1e670 Merge branch 'master' into ios_support 2020-05-17 18:34:20 +02:00
Carlos Aragones
6254705203 refactor OSX to be more similar to iOS 2020-05-17 18:34:12 +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
2b1d7633ae Added WF_FULLSCREEN_DESKTOP and WF_FULLSCREEN on macos x 2020-04-26 23:33:30 +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
ab5a7919a6 Updated readme 2020-04-26 18:40:46 +02:00
Carlos Aragones
5981107bdd Merge branch 'master' into ios_tmp
* master:
  fix issue on macos x
2020-04-26 17:44:52 +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 Aragones
894e7cca5e fix issue #25 2020-04-22 15:59:42 +02:00
Carlos Aragones
f793114403 fix latest commit 2020-04-22 15:39:34 +02:00
Carlos Aragonés
c381721dad
Merge pull request #15 from lkesteloot/master
Fix size of window on MacOS.
2020-04-22 15:28:56 +02:00
Carlos Aragonés
c65e93ff88
Merge branch 'master' into master 2020-04-22 15:28:10 +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 Aragones
4175cec89e minor fix 2020-04-19 23:04:11 +02:00
Carlos Aragonés
661092081c
Renamed typo scrool by scroll (#29)
* 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

* fix issue 32

Co-authored-by: Carlos Aragones <>
Co-authored-by: caragones <carlos.aragonesmartinez-external@gemalto.com>
2020-03-06 07:51:57 +01: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
Daniel Collin
4286f055c6
Fix issue #32 (#33)
* 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

* fix issue 32
2020-03-05 18:51:57 +01:00
Shotaro Uchida
219e7d0c20
Fix shader warning for macOS Catalina (#30)
In Catalina, shader creation will fail because of the following issue:

```
Compilation succeeded with:

program_source:22:21: warning: writable resources in non-void vertex function
vertex VertexOutput vertFunc2(unsigned int vID[[vertex_id]], device Vertex *pos [[buffer(0)]])
                    ^
program_source:22:77: note: writable buffer defined here
vertex VertexOutput vertFunc2(unsigned int vID[[vertex_id]], device Vertex *pos [[buffer(0)]])
                                                                            ^
```

Adding const to ensure the buffer is read-only.
2020-02-26 07:57:25 +01:00
Carlos Aragonés
f10bcfeabf Simplify cmake (#28)
* 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
2020-01-04 18:21:45 +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
25a440f822 Update documentation (#20)
* update documentation

* Fix typo

* Minor fix
2019-06-09 08:50:42 +02: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
Darky-Lucera
d6a52459ef added metal support for macosx version (based on rust_minifb) (#17) 2019-03-03 23:34:38 +01:00
Lawrence Kesteloot
2023380cbf Fix size of window on MacOS.
The API for NSWindow's creation has a contentRect parameter,
but it seems to be handled like a frameRect. So convert from
contentRect to frameRect first. Without this change the
top 20-ish lines of the image are under the title bar.
2018-08-27 10:05:54 -07:00
Robert Swain
cb49ea94a0 Update for macOS 10.13 (#13) 2018-08-26 08:47:18 +02:00
Ankeet
4f01702f81 Got this working on 10.11 (#12) 2017-05-13 23:00:44 +02:00
Nicolas Guillemot
a5e8dd4e2e fix close window notif and unused vars (#10)
It wasn't detecting that the window was closed when I closed it by
clicking the red X button. As a result, the window would close, but
mfb_update() didn't return -1, so the program kept running.

This was fixed by listening to the willClose event and using it to set a
flag. I'm not sure if this is the best way to do it, I really know
nothing about OSX/Cocoa.

Also, I fixed a few unused varible warnings. And warnings related to
NSUInteger not matching the expected signature with NSWindowStyleMask.
2017-01-24 21:18:06 +01:00
Marcus Fritzsch
b0f1590fc5 Basic wayland support though wl_shm (#8)
* x11: need to return somethin from processEvents()

* Added wayland support

* Documented how to use wayland support

* wayland: re-attach the buffer to actually trigger an update

* wayland: use the seat_listener
2017-01-24 20:14:11 +01:00
Daniel Collin
494af34aab Merge pull request #9 from nlguillemot/master
woops: didnt allocate enough and also clear to zero.
2017-01-24 18:48:18 +01:00
Nicolas Guillemot
920e11a9e5 woops: didnt allocate enough and also clear to zero. 2017-01-24 09:30:21 -08:00