Commit graph

223 commits

Author SHA1 Message Date
Holden 0b5e39c396 Add additional derived traits to Key enum (#65)
* Add partial ord and partial eq to keys enum

* Derive eq on key

* Derive ord
2018-12-29 08:37:56 +01:00
tdaffin 3aaf613edd Added Window.is_key_released (#62)
* Added Window.is_key_released

* Add is_key_released for the other platforms
2018-12-18 11:20:32 +01:00
Daniel Collin 79608b38a2 merge macos-metal -> master
commit 2d8e0c1692120e9997bd8d376be8a7cc2536429d
Author: Daniel Collin <daniel@collin.com>
Date:   Tue Oct 23 20:51:09 2018 +0200

    Bump to 0.11 and added info about macOS Metal

commit 0f77968317194f2f72b86da287c04484aeee762a
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Oct 21 17:44:26 2018 +0200

    Tripple buffer textures

commit d268c10576c7e9063bd4605aed4a939d956eeb6b
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Oct 21 16:59:20 2018 +0200

    Some cleanup

commit 5544773e62afec6f69d0c3b6309e60a543905fef
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Oct 21 16:24:45 2018 +0200

    Working but no proper sync yet

commit 843a6625cfddac5a6e2d8e61170f796e763e4002
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Oct 21 15:26:45 2018 +0200

    Working texture

commit 1d4446f1f10c497dde07e0d20c92eb8bb6f836ec
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Oct 21 14:45:52 2018 +0200

    Removed vertex data

    We construct this in the shader instead

commit 2e8027d73a1635e26e412dbda6494193fd04a060
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Oct 21 14:42:36 2018 +0200

    Fullscreen triangle setup

commit 5efd974704c11577944ffdeff9eb9dd4fa40bde0
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Oct 21 14:16:23 2018 +0200

    Triangle on screen

commit d9cf4eb7557f73adfbe1764f3da94a837a4ef8d3
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Oct 21 12:17:04 2018 +0200

    Some hacky metal with clear screen
2018-10-23 20:51:50 +02:00
Daniel Collin 335f505ef2 Removed updateLayer 2018-10-20 09:33:21 +02:00
Daniel Collin 2e2bd93a1c fixed tabs 2018-10-20 09:31:46 +02:00
Daniel Collin 450502f672 Fixed macOS warnings 2018-10-19 22:05:15 +02:00
Lukas Kalbertodt 87e742047d Add debug impls (#56)
* Add missing `Debug` impls to public types

In one case, a missing Clone and Copy impl was added, too.

* Remove several `doc(hidden)` & make some modules private

I'm not quite sure why it was done the way it was. This change makes
items that were used in the public API visible in the documentation. It
also makes modules not used in the public API private.

* Add `#![deny(missing_debug_implementations)]` to crate root
2018-08-10 09:14:14 +02:00
Daniel Collin 3d70a5c7dc Added x16 and x32 scale to X11 2018-05-18 21:59:19 +02:00
Nagy Tibor 5e16895b7d Update orbclient to 0.3.14 on Redox (#55) 2018-05-16 07:12:32 +01:00
Daniel Collin 26e6eca208 Fixed auto scaling and added X8 on Linux
Closes #51
Closes #52
2018-05-05 15:14:57 +02:00
Nagy Tibor 3ffa7ad684 Fix Redox build (#41) 2017-08-15 19:28:44 +02:00
Daniel Collin 5d70e6fc5c Another linux fix 2017-08-11 12:51:04 +02:00
Daniel Collin eaa0440e8c Another linux fix 2017-08-11 12:49:06 +02:00
Daniel Collin ca264a7b9a Linux fix 2017-08-11 12:46:34 +02:00
Daniel Collin 900deba9a7 Implemented bounds checking for update_with_buffer 2017-08-11 12:41:24 +02:00
Krzysztof Kondrak 600749fd8a Support period key on *nix. (#37) 2017-07-08 13:57:34 +02:00
xTibor f4bd8b7704 Redox support (#35) 2017-04-24 09:09:05 +02:00
FlyingGaz 933d7662fb Use to_vec in windows/update_with_buffer (#33) 2017-01-15 17:46:02 +01:00
Daniel Collin 76d9351dc2 Fixed warning 2016-08-02 18:20:19 +02:00
Daniel Collin 4087f3c4c3 Added get_unscaled_mouse_pos 2016-08-02 18:01:25 +02:00
Daniel Collin 26d41d1d07 Fixed crash on Mac for large Windows
In some cases a resize event can happen before we have setup our user-data. Now we make sure that user data is present before using it

Closes #26
2016-07-31 18:05:11 +02:00
Daniel Collin d4c7100b44 Fixed “plonk sound” on Mac
Ref #25
2016-07-29 11:00:34 +02:00
Daniel Collin b27ea2bec1 Fixed correct window size on Mac 2016-07-29 11:00:34 +02:00
Aleksey Kladov 0f6b312e5c Fix typos 2016-07-26 14:43:45 +03:00
Daniel Collin f848eaaee5 Merge branch 'master' of https://github.com/emoon/rust_minifb 2016-07-08 20:13:44 +02:00
Daniel Collin d4c9413835 Support for keypad on Linux 2016-07-08 20:13:28 +02:00
Daniel Collin 99c9bbdfac Swapped incorrect order of resize cursors 2016-07-08 14:27:51 +02:00
Daniel Collin 2a8d09fb28 Char input support on Windows 2016-07-08 14:27:25 +02:00
Daniel Collin 1ca62fa111 Fixed Backspace on Linux 2016-07-08 13:56:41 +02:00
Daniel Collin 948dd54595 Implementd char callback on Linux 2016-07-08 13:29:49 +02:00
Daniel Collin 495f7c4cca Added set_title and set_cursor_style 2016-06-24 13:08:01 +02:00
Daniel Collin 596c5a7097 Char callback got lost for some reason 2016-05-27 18:15:58 +02:00
Daniel Collin b5f3cf1ca3 Merge menu-api-rework -> master
Rewrote Menu API
2016-05-12 20:08:37 +02:00
Daniel Collin 57906b26b8 Removed old menu code 2016-05-09 16:42:24 +02:00
Daniel Collin 06c7c6b05b Added code for menu destroy
But it doesn't work for some reason
2016-05-09 16:41:01 +02:00
Daniel Collin 462effd03c Added accel keys
Fn keys doesn't seem to work yet though
2016-05-09 16:05:53 +02:00
Daniel Collin 37292a70cf Inital menus for Windows implemented 2016-05-09 15:49:26 +02:00
Daniel Collin 0f1ed50f36 Cleanup 2016-05-08 13:43:25 +02:00
Daniel Collin 8f687c58db Some more cleanup 2016-05-08 13:37:20 +02:00
Daniel Collin df60ca8ecd Cleanup 2016-05-08 13:34:38 +02:00
Daniel Collin 0ffa3bf196 Support for removing menus 2016-05-08 13:27:55 +02:00
Daniel Collin d3fcfd4bf0 Fixed f-keys 2016-05-08 11:00:50 +02:00
Daniel Collin 3c2451c2ec Rustfmt 2016-05-08 10:33:27 +02:00
Daniel Collin 10de5cd84e Cleanup 2016-05-08 10:31:58 +02:00
Daniel Collin ab924a4b0d Submenu support 2016-05-08 10:24:37 +02:00
Daniel Collin 6f47d190b6 Cleanup + shortcut work 2016-05-08 09:42:21 +02:00
Daniel Collin 835837286f Made it possible to add menu items using builder 2016-05-08 09:28:43 +02:00
Daniel Collin 25ed203497 Fixed shortcuts on Mac 2016-05-08 08:55:22 +02:00
Daniel Collin 42ce3b9286 WIP on new menu stuff 2016-05-08 00:25:31 +02:00
Daniel Collin 4a3eabe8e6 WIP on new Menu system 2016-05-07 12:51:14 +02:00
Marco Castorina 82e48fcea8 Fixed crash when pressing TAB on Mac 2016-05-02 20:55:33 +01:00
Daniel Collin 6de1909445 Added missing InputCallback 2016-05-01 16:06:33 +02:00
Daniel Collin eaf12ebb29 Implemented callback for characters
This is so when typing input on the keyboard characters may not match the layout in non-english for example. Currently Mac has been implemented to support this.
2016-05-01 16:02:29 +02:00
Daniel Collin 822403d1ed Implemented get_size() on Windows 2016-05-01 10:28:34 +02:00
Daniel Collin 75e985d08e Added get_size() on Unix 2016-05-01 10:16:39 +02:00
Daniel Collin f540aae1b9 Started with implementing get_size()
Currently Mac is implemented with stub versions for Linux and Windows
2016-05-01 09:54:34 +02:00
Daniel Collin 3565e1cb3f Fixed F-keys not working correctly on Mac 2016-04-29 08:57:55 +02:00
Daniel Collin d000e199e5 Fixed Unix incorrect get_window_handle
Closes #18
2016-04-25 18:11:50 +02:00
Daniel Collin 5d9ca9e585 Merge work from menu branch 2016-03-04 17:36:28 +01:00
Daniel Collin 73813b63f4 Merged window-opts to master
commit 53e9cd45567a1308fdbd2e46763e15b2a3fa3d4c
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 18:31:38 2016 +0100

    Correct header for v0.4.0

commit fcf64d5dfad0796fee16ce8985e66d1b3e82c5a4
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 18:30:12 2016 +0100

    More cleanup

commit b7f4b187569a753656f19a74b78d8ada3fd95b70
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 18:29:23 2016 +0100

    Minor cleanup

commit 7392cd4a5aaad7f0d8332082c75d6cbc41d50ca6
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 18:28:06 2016 +0100

    Updated example added Changelog link

commit 236a82883a68e576ceb1e38a54b0a18fdc2e4465
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 18:24:58 2016 +0100

    Updated readme

commit e6bc68721513ca66c5566a19e6bfad33875b3280
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 18:20:42 2016 +0100

    Doc fixes

commit edfd688f045764b66c944d4aa616c6d48246816d
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 18:20:35 2016 +0100

    Updated with 0.4.0 release info

commit 784628fa9a1de93280592e634b522fd916a7588a
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 15:45:37 2016 +0100

    Fixed bad comment

commit 2c6d8730b566193b573afb5dc95a82987d1c4ce4
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 15:37:52 2016 +0100

    Linux support for WindowOptions

commit cbf7c17c3a92d676f5707095781071016e8b90e1
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 15:05:10 2016 +0100

    Updated Windows version with WindowOptions

commit ed1254245384e3e64c082a8368cbbe4a9f679efa
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 14:32:04 2016 +0100

    Added get_window_handle

commit e4a15f98c70facda7e7b2f30ba95a42091fa078c
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 14:30:34 2016 +0100

    Cleanup + links

commit 7dadb090d1037eade525093e2a541c99940e6a3a
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 14:25:41 2016 +0100

    And again

commit 70bdb0f88812e12bf9ca9adc55c1e52cc36c3ef9
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 14:24:44 2016 +0100

    Try link again

commit b4b7b3c4cda1d958e8f9cf6a2418db68ac32bcc5
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 14:21:54 2016 +0100

    Some cleanup

commit fb9845bae37f6ce9ba309b8a57128ce8c426fbca
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 13:16:23 2016 +0100

    Renamed resizeable to resize

commit 89c5af826612dbd887855dca3937e99856c9fcf2
Author: Daniel Collin <daniel@collin.com>
Date:   Sun Jan 31 12:59:57 2016 +0100

    Working on making Windows a bit more generic

    * Added WindowOptions that can configure how the Window should look and behave better (resize, title, borderless)
    * Renamed update -> update_with_buffer
    * Added update which doesn't take a buffer (used to updated the window without buffers)
2016-01-31 18:34:05 +01:00
Daniel Collin 9458a1b05e MouseMode::Clamp now clamps to [(0,0) (w-1,h-1)] 2016-01-29 20:56:26 +01:00
Daniel Collin 8bdbc850d5 Merge from mouse-support 2016-01-29 20:16:00 +01:00
Daniel Collin 94bf0daff9 More build fixing 2016-01-09 21:01:23 +01:00
Daniel Collin 72021616e9 Fixed broken build 2016-01-09 20:59:09 +01:00
Daniel Collin f3bd5ddb29 Added X11 set_position 2016-01-09 20:54:46 +01:00
Daniel Collin 001bca8f74 Implemented set_position for Mac 2016-01-09 20:49:14 +01:00
Daniel Collin b576ab3139 Started to add set_position 2016-01-09 20:06:07 +01:00
Daniel Collin 49eba1bc05 Heap allocate drawing buffer
On some system it seems that the stack is quite small so now we heap
allocate the buffer instead. Also updated the docs and examples using
that instead of being on the stack. Bumped version to 0.2.4

Closes #8
2016-01-05 21:29:52 +01:00
Daniel Collin 57b734457e Fixed x86 (32-bit) build
Closes #7
2016-01-05 21:22:20 +01:00
Daniel Collin d6cbb705c1 Mac fixes
* Removed resizing of window as that isn't supported
* Fixed issue that content view would be too small and top of window wouldn't be visible
* Removed some code that isn't needed

Bump lib version to 0.2.3
2016-01-04 21:14:06 +01:00
Daniel Collin 63966e4a68 Removed unused file 2016-01-03 15:29:30 +01:00
Daniel Collin 20e1b228cd Make sure we handle *nix correctly 2016-01-03 15:28:00 +01:00
Daniel Collin 264a630c39 Handle scaling and window close 2016-01-03 15:11:18 +01:00
Daniel Collin fa8101b885 Added X11 keyboard support 2016-01-03 13:37:17 +01:00
Daniel Collin 9c07aaae60 WIP on X11 version 2016-01-03 11:25:05 +01:00
Daniel Collin ae5917741f Fixed bad usage of incorrect Window 2016-01-02 22:07:38 +01:00
Daniel Collin c5f45664ef More documentation 2016-01-02 21:42:37 +01:00
Daniel Collin 4b87f68125 Moved stuff around + documentation 2016-01-02 21:26:13 +01:00
Daniel Collin a7e1df51ad Use the new key_handler code 2016-01-02 19:40:56 +01:00
Daniel Collin 867daf1ca9 Added working keyboard support for Mac
Also moved all code out from windows.rs to a shared key_handler impl
2016-01-02 18:55:46 +01:00
Daniel Collin 8e9f8d33a1 Add support for scaling 2016-01-02 15:49:53 +01:00
Daniel Collin 946aa5ec14 Mac fixes
* Removed hard coded global values for width, height, buffer - These are now tracked on a per window basis.
* Fixed multi-window support
* Various cleanup and fixes
2016-01-02 15:37:50 +01:00
Daniel Collin 092965cb49 Removed VSync flag 2016-01-02 15:36:08 +01:00
Daniel Collin 6c6d611599 Merge branch 'windows-rs' into wip
# Conflicts:
#	Cargo.toml
#	README.md
#	examples/noise.rs
#	src/lib.rs
#	src/windows.rs
2016-01-02 11:33:08 +01:00
Daniel Collin 1e477cd47f Rust format 2016-01-02 11:32:05 +01:00
Daniel Collin d4ca056adc New version running with keyboard support 2016-01-02 11:32:04 +01:00
Daniel Collin 60e28c4a74 Removed double Key0 2016-01-02 11:31:54 +01:00
Daniel Collin b66fbe709a WIP on Windows version 2016-01-02 11:31:54 +01:00
Krzysztof Kondrak bd5ac066a2 fixed braces formatting + dropped err_code variable 2015-12-28 17:17:23 +01:00
Krzysztof Kondrak de47861fe3 Ignore the "Class already exists" error in multiple-window application 2015-12-28 16:50:51 +01:00
Krzysztof Kondrak 6fd476783c Added backquote/tilde key 2015-12-22 12:54:06 +01:00
Daniel Collin 1455bd375e WIP on Mac version 2015-12-19 14:47:34 +01:00
Daniel Collin 026be10b8b Finally a visible window! 2015-12-19 11:44:36 +01:00
Daniel Collin 08028c1e54 WIP on Mac version 2015-12-19 08:25:04 +01:00
Daniel Collin aa5d84eb2b Added support for key repeat
* Added get_keys_pressed(KeyRepeat::Yes/No) in order for the user to
decide if repeat should be used or not
* added is_key_pressed(key, KeyRepeat::Yes/No)
* Added set_key_repeat_delay/rate in order to control the rate/delays of
keys
2015-12-18 20:21:47 +01:00
Krzysztof Kondrak 3bbbd46dd9 remove println\ 2015-12-17 12:33:21 +01:00
Krzysztof Kondrak 2f91a754d5 added ScrollLock and numeric keypad 2015-12-17 12:27:46 +01:00
Krzysztof Kondrak 3d54525d46 added support for Ctrl and Shift keys 2015-12-16 09:31:14 +01:00
Daniel Collin 0c2e4cee7c Added get_keys() function 2015-12-15 14:20:04 +01:00
Daniel Collin 03e8075157 Implemented FitScreen 2015-12-11 14:12:29 +01:00
Daniel Collin ef9ac3e88c Fixed broken scaling 2015-12-11 11:26:00 +01:00
Daniel Collin 6f47463a2e Implemented scaling
BestFit isn't implemented yet though
2015-12-11 10:33:20 +01:00
Daniel Collin 2f5503d115 Make sure to keep wchars alive 2015-12-11 09:46:10 +01:00
Daniel Collin 474e6db31d Null terminate wchar string 2015-12-11 09:25:06 +01:00
Daniel Collin b05fb33fb3 Use CreateWindowExW instead of A 2015-12-11 08:52:38 +01:00
Daniel Collin 58565b9812 Added more error checking when creating window 2015-12-10 21:27:18 +01:00
Daniel Collin d8c2a38f39 Changed keys api and added check if window is open
Also removed ugly CLOSE_APP global
2015-12-09 15:44:34 +01:00
Daniel Collin b46868121e Fixed overflow on windows 2015-12-09 13:04:46 +01:00
Daniel Collin e89cb04189 Rust format 2015-12-08 23:08:52 +01:00
Daniel Collin 0b2911ca30 New version running with keyboard support 2015-12-08 22:57:14 +01:00
Daniel Collin 6bb0f1f479 Removed double Key0 2015-12-08 18:53:26 +01:00
Daniel Collin c8b45d8577 WIP on Windows version 2015-12-08 18:49:03 +01:00
Daniel Collin 99e106fe93 WIP on latest Mac version 2015-12-06 19:14:34 +01:00
Daniel Collin 29e744bc19 WIP on pure Rust version of the Mac backend 2015-12-04 20:35:35 +01:00
Daniel Collin e83c66b8dd Minor fixup 2015-11-27 23:49:24 +01:00
Daniel Collin 860f8b4f3d Ran rustfmt 2015-11-27 23:47:15 +01:00
Daniel Collin 15ec55aae2 Working Win32 version in pure Rust 2015-11-27 23:42:28 +01:00
Daniel Collin a9b0a11853 Window gets created 2015-11-27 21:25:50 +01:00
Daniel Collin ccfeeb24da WIP on Windows version 2015-11-27 19:14:24 +01:00
Daniel Collin 298e535de2 Started to work on Rust only version for Windows 2015-11-24 21:46:52 +01:00
Daniel Collin 858b07f506 Fixed Linux version 2015-11-23 20:44:21 +01:00
Daniel Collin 48da30a25f Fixed Windows version 2015-11-23 20:21:11 +01:00
Daniel Collin 0c1fd92275 Initial version 2015-11-22 18:55:38 +01:00