Commit 58afc41
authored
examples: Reuse
When testing the `glutin` example on Android, after suspending and
resuming the app no triangle appears. As it turns out the `winit 0.30`
bump in #1678 never reuses the `not_current_context` that was set apart
in `suspend()`, but creates a new one, without re-running initialization
code such as creating the `Renderer`.
Partially restore original code before the `winit 0.30` bump, which
never created a context in `resume()` because it was already available
before the loop started (and moved back in place in `suspend()`). Note
also that more initialization code that now (unnecessarily) lives in
`resume()` used to be outside of the loop.not_current_context in resumed() handler1 parent 3296c9a commit 58afc41
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
124 | | - | |
125 | | - | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
0 commit comments