Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from .run_forever() to .poll_events() in gfx_app #1822

Merged
merged 1 commit into from
Feb 17, 2018

Conversation

jturner314
Copy link

This commit uses .poll_events() to allow processing multiple events per rendered frame. (Before, only one event was processed per frame.) This is necessary because it's easy for the user to generate events much faster than frames can be rendered (e.g. by moving the mouse).

Additionally, with .run_forever(), rendering blocked on receiving events. (An event had to occur before a frame was rendered.) In order to see an animation such as the particle example, the user had to generate events fast enough to cause frames to be rendered (e.g. by moving the mouse over the window).

See also rust-windowing/winit#276 and rust-windowing/winit#231

PR checklist:

  • make succeeds (on *nix)
    I don't see a Makefile. make says make: *** No targets specified and no makefile found. Stop.
  • make reftests succeeds
    I don't see a Makefile. I did run cargo test, though, and that succeeded (although it ran only 3 tests).
  • tested examples with the following backends:
    When I run glxinfo, I see OpenGL core profile version string: 3.3 (Core Profile) Mesa 17.3.3. I tested all of the examples. They all worked correctly, except terrain_tessellated (which failed to build even before this commit) and triangle (which still has the .run_forever() issue since it doesn't use gfx_app).

This commit uses `.poll_events()` to allow processing multiple events
per rendered frame. (Before, only one event was processed per frame.)
This is necessary because it's easy for the user to generate events much
faster than frames can be rendered (e.g. by moving the mouse).

Additionally, with `.run_forever()`, rendering blocked on receiving
events. (An event had to occur before a frame was rendered.) In order to
see an animation such as the `particle` example, the user had to
generate events fast enough to cause frames to be rendered (e.g. by
moving the mouse over the window).

See also rust-windowing/winit#276 and
rust-windowing/winit#231
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
bors r+

bors bot added a commit that referenced this pull request Feb 17, 2018
1822: Switch from .run_forever() to .poll_events() in gfx_app r=kvark a=jturner314

This commit uses `.poll_events()` to allow processing multiple events per rendered frame. (Before, only one event was processed per frame.) This is necessary because it's easy for the user to generate events much faster than frames can be rendered (e.g. by moving the mouse).

Additionally, with `.run_forever()`, rendering blocked on receiving events. (An event had to occur before a frame was rendered.) In order to see an animation such as the `particle` example, the user had to generate events fast enough to cause frames to be rendered (e.g. by moving the mouse over the window).

See also rust-windowing/winit#276 and rust-windowing/winit#231

PR checklist:
- [ ] `make` succeeds (on *nix)
  I don't see a Makefile. `make` says `make: *** No targets specified and no makefile found.  Stop.`
- [ ] `make reftests` succeeds
  I don't see a Makefile. I did run `cargo test`, though, and that succeeded (although it ran only 3 tests).
- [X] tested examples with the following backends:
  When I run `glxinfo`, I see `OpenGL core profile version string: 3.3 (Core Profile) Mesa 17.3.3`. I tested all of the examples. They all worked correctly, except `terrain_tessellated` (which failed to build even before this commit) and `triangle` (which still has the `.run_forever()` issue since it doesn't use `gfx_app`).
@bors
Copy link
Contributor

bors bot commented Feb 17, 2018

@bors bors bot merged commit f0b2a50 into gfx-rs:pre-ll Feb 17, 2018
@jturner314 jturner314 deleted the poll-events branch February 17, 2018 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants