Commit graph

90 commits

Author SHA1 Message Date
mitchmindtree db9e80bdb6 Update examples and tests to addition of ControlFlow 2017-06-08 00:12:41 +10:00
mitchmindtree f2dd2f0752 WIP - Make poll_events and run_forever take &mut self
This removes the need for the EventsLoop::interrupt method by inroducing
a ControlFlow type. This new type is to be returned by the user's
callback and indicates whether the `EventsLoop` should continue waiting
for events or break from the loop.

Only the wayland, x11 and api_transition backends have been updated so
far, and only the wayland backend has actually been tested.
2017-06-02 21:19:45 +10:00
mitchmindtree f6587aed39 [WIP] Have EventsLoopProxy::wakeup return a Result. Begin linux impl.
X11 and Wayland implementations are now half implemented, however both
still do not correctly break from the inner blocking event dispatch
functions when `wakeup` is called, which they should do.
2017-05-25 23:19:13 +10:00
mitchmindtree 06a5ec35b3 [WIP] Remove Sync and Clone from EventsLoop. Add EventsLoopProxy.
This commit only updates the top-level API to get some early feedback.
None of the platform-specific code has been updated yet. I'm hoping to
get around to this over the next couple days however if someone more
familiar with the windows backend would like to do a PR against this
fork that would be a great help.

Closes #187.
2017-05-25 20:13:54 +10:00
Benjamin Saunders 22bc119cd7 Richer input events
This expands input events to represent sub-pixel mouse positions, devices responsible for generating events, and raw
device-oriented events. The X11 back end is refactored to make full use of the new expressiveness. Other backends have
had new functionality minimally stubbed out, save for the macos backend which already supports sub-pixel mouse
positions.
2017-04-23 01:08:15 -07:00
Erik Rigtorp f3ccdb7aec Add keyboard modifiers to input event
Making applications track modifier keys results in unnecessary work for
consumers, it's error prone, and it turns out to have unavoidable bugs.
For example, alt-tabbing with x11 results in the alt modifier state
getting stuck.

To resolve these problems, this patch adds a Mods value to the keyboard
input event.

Based on this patch: d287fa96e3
2017-02-27 13:36:11 -06:00
Pierre Krieger b5d8d305fc Fix unreachable patterns 2017-01-28 16:21:41 +01:00
Pierre Krieger 7da96121a2 Fix examples 2017-01-28 15:45:01 +01:00
Pierre Krieger 0242daa242 Add interrupting the events loop 2017-01-28 15:09:01 +01:00
Pierre Krieger 2c4db6b16e Update window example 2017-01-28 15:01:59 +01:00
Pierre Krieger 422b332c1b Add a transition macro system 2017-01-28 15:00:17 +01:00
Pierre Krieger 289bb7bc9f Remove android_main! call 2016-11-23 19:33:44 +01:00
Corey Farwell b500808d1a Rename example, remove debug logging. 2016-11-23 10:51:15 -05:00
Corey Farwell f8666a05fb Add example demonstrating min/max window dimension constraints. 2016-11-23 09:41:53 -05:00
mitchmindtree eb18b3d8b6 Add a WindowBuilder::with_window_resize_callback method.
This allows for passing the window_resize_callback fn during the window
building stage. More importantly, this allows setting the callback
without the need for mutable access to the Window, making it possible
to set the callback in the downstream glium crate.

This may solve tomaka/glium#1232 for most folk.
2016-11-11 22:08:46 +11:00
Andrey Lesnikov 7f6ae8910e Merge https://github.com/tomaka/glutin
Conflicts:
	.travis.yml
	Cargo.toml
	examples/fullscreen.rs
	src/api/android/mod.rs
	src/api/cocoa/headless.rs
	src/api/cocoa/helpers.rs
	src/api/cocoa/mod.rs
	src/api/glx/mod.rs
	src/api/osmesa/mod.rs
	src/api/win32/callback.rs
	src/headless.rs
	src/lib.rs
	src/platform/linux/mod.rs
	src/window.rs
2016-09-19 19:53:28 +03:00
Ivan Ukhov 54f442ea06 Generalize WindowBuilder::with_title 2016-05-08 09:28:42 +02:00
Richard Lettich 117069ef90 Changed MouseMoved((i32, i32)) to MouseMoved(i32, i32), breaking change 2016-03-27 14:39:20 -04:00
Pierre Krieger 007ad0f911 Fix the test and the examples 2016-03-26 18:10:19 +01:00
Pierre Krieger 10bb03c5f0 Remove most OpenGL stuff and make it compile on win32 2016-02-23 12:56:23 +01:00
Pierre Krieger 982279bc39 Update the emscripten port of glutin 2016-02-09 14:25:21 +01:00
Rengierof d2ac6cfa11 Fixed grabbing example. 2015-12-26 16:47:25 +02:00
Rengierof 11e27889ae Fixes cursor behavior with windows 2015-12-26 16:38:00 +02:00
Pierre Krieger 37262fb228 Remove public exports of gl_common and libc 2015-11-09 08:46:52 +01:00
mitchmindtree 947effd3a0 unwrap to fix unused result warning 2015-11-08 21:14:58 +11:00
Adam Badawy 9493458b8e Fix issue #543
I added a match arm for the Escape key.
2015-10-24 21:44:43 -04:00
Adam Badawy d6f44a7f56 Flush monitor prompt 2015-10-24 21:38:36 -04:00
Pierre Krieger 2b35a6c9d1 Fix the examples 2015-10-04 18:39:17 +02:00
Josh Matthews 77b3743117 Warning fixes for OS X. 2015-09-28 12:19:36 -04:00
Pierre Krieger 326ea3555b Fix the triangle in the examples 2015-08-30 18:48:26 +02:00
Pierre Krieger 9261408cc8 Use modern GL code for the examples 2015-08-05 22:31:34 +02:00
Akos Kiss 07c8154cb7 Add aarch64-unknown-linux-gnu support
* Adding dependencies
* Replacing `i8` with `c_char` ot `_` (since `c_char` can be
  unsigned on some platforms, aarch64 is one of them)
2015-07-23 06:19:54 +00:00
Pierre Krieger 39128dd7e1 Remove the is_closed function 2015-06-16 14:03:58 +02:00
Felix Kaaman a8fef35dbf Make legacy functions crash on osx core contexts 2015-06-16 09:00:02 +02:00
Robert Knight f0bab95c4d Express scroll deltas as either line or pixel deltas
Depending on the platform and device, scroll deltas may either
be represented as pixel deltas specifying the amount
in pixels to scroll or they may be expressed in 'lines' or 'chunks'
for low resolution devices (eg. a traditional mouse wheel).

Pixel deltas are currently available on OS X. X11 currently
supports only integer line deltas, though pixel deltas
are available via XInput2. Windows supports fractional
line deltas.
2015-06-13 23:19:31 +01:00
Pierre Krieger 81314f91d8 Add API for transparency and decorations and add support for win32 2015-05-24 09:10:44 +02:00
Pierre Krieger 05c24b39cc Print the pixel format in the window example 2015-05-04 09:23:43 +02:00
Pierre Krieger 2f9272e1cb Fix the GLES code in examples/support/mod.rs 2015-04-30 23:04:07 +02:00
Pierre Krieger e12f06ad48 Fix and re-enable the fullscreen example 2015-04-24 09:35:49 +02:00
Pierre Krieger c68fdf3af2 Fix examples so that travis passes again 2015-04-17 15:23:13 +02:00
Steven Sheldon 9c21758bb7 Removed unused features from build and examples. 2015-04-03 02:31:15 -07:00
Pierre Krieger d33c138164 Rustup 2015-04-02 22:41:35 +02:00
Pierre Krieger bae1e42b8b More work on win32 implementation 2015-03-30 11:42:19 +02:00
Pierre Krieger 3d692870e2 Change grab_cursor and ungrab_cursor to set_cursor_state 2015-03-26 17:15:18 +01:00
tomaka d6ebaaaf5c Merge pull request #227 from aepsil0n/grab-cursor
Implement grabbing of the mouse pointer for X11
2015-03-26 16:48:40 +01:00
Pierre Krieger cedc85c550 Rustup 2015-03-25 20:27:18 +01:00
Eduard Bopp 77d033d672 Add an example for (un-)grabbing the mouse cursor 2015-03-25 13:17:47 +01:00
Pierre Krieger 106ca8a30a Fix "fullscreen" example with latest rustc 2015-02-05 09:20:12 +01:00
Andrew Kelley 6a27fa9d26 fix for rust nightly 2015-01-28 12:43:44 -07:00
Pierre Krieger b05ef16d81 Implement vsync for x11 and add vsync example 2015-01-23 09:33:22 +01:00