Skip to content

Commit fe22e5b

Browse files
committed
Misc changes.
Signed-off-by: Hal Gentz <zegentzy@protonmail.com>
1 parent f0946f5 commit fe22e5b

File tree

12 files changed

+100
-323
lines changed

12 files changed

+100
-323
lines changed

glutin/src/api/egl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ impl Context {
585585
}
586586

587587
#[inline]
588-
pub unsafe fn make_current_window(
588+
pub unsafe fn make_current_surface(
589589
&self,
590590
surface: &WindowSurface,
591591
) -> Result<(), ContextError> {

glutin/src/context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ impl Context {
1818
}
1919

2020
#[inline]
21-
pub unsafe fn make_current_window(
21+
pub unsafe fn make_current_surface(
2222
&self,
2323
surface: &WindowSurface,
2424
) -> Result<(), ContextError> {
25-
self.context.make_current_window(surface.inner())
25+
self.context.make_current_surface(surface.inner())
2626
}
2727

2828
#[inline]

glutin/src/platform_impl/unix/unix.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ impl Context {
118118
}
119119

120120
#[inline]
121-
pub unsafe fn make_current_window(
121+
pub unsafe fn make_current_surface(
122122
&self,
123123
surface: &WindowSurface,
124124
) -> Result<(), ContextError> {
125125
match (self, surface) {
126126
(
127127
Context::Wayland(ref ctx),
128128
WindowSurface::Wayland(ref surface),
129-
) => ctx.make_current_window(surface),
129+
) => ctx.make_current_surface(surface),
130130
}
131131
}
132132

@@ -242,14 +242,14 @@ impl WindowSurface {
242242
el: &EventLoopWindowTarget<T>,
243243
ctx: &Context,
244244
wb: WindowBuilder,
245-
) -> Result<(Self, Window), CreationError> {
245+
) -> Result<(Window, Self), CreationError> {
246246
match ctx {
247247
// Context::X11(ref ctx) => x11::WindowSurface::new(el, ctx, wb)
248248
// .map(|(surface, win)| (WindowSurface::X11(surface), win)),
249249
Context::Wayland(ref ctx) => wayland::WindowSurface::new(
250250
el, ctx, wb,
251251
)
252-
.map(|(surface, win)| (WindowSurface::Wayland(surface), win)),
252+
.map(|(win, surface)| (win, WindowSurface::Wayland(surface))),
253253
}
254254
}
255255

glutin/src/platform_impl/unix/wayland.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl WindowSurface {
3939
el: &EventLoopWindowTarget<T>,
4040
ctx: &Context,
4141
wb: WindowBuilder,
42-
) -> Result<(Self, Window), CreationError> {
42+
) -> Result<(Window, Self), CreationError> {
4343
let win = wb.build(el)?;
4444

4545
let dpi_factor = win.hidpi_factor();
@@ -69,7 +69,7 @@ impl WindowSurface {
6969
&ctx.context,
7070
wsurface.ptr() as *const _,
7171
)
72-
.map(|surface| (WindowSurface { wsurface, surface }, win))
72+
.map(|surface| (win, WindowSurface { wsurface, surface }))
7373
}
7474

7575
#[inline]
@@ -156,11 +156,11 @@ impl Context {
156156
}
157157

158158
#[inline]
159-
pub unsafe fn make_current_window(
159+
pub unsafe fn make_current_surface(
160160
&self,
161161
surface: &WindowSurface,
162162
) -> Result<(), ContextError> {
163-
self.context.make_current_window(&surface.surface)
163+
self.context.make_current_surface(&surface.surface)
164164
}
165165

166166
#[inline]

glutin/src/surface.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub struct PBuffer {
99

1010
impl PBuffer {
1111
#[inline]
12-
pub fn new<TE>(
12+
pub unsafe fn new<TE>(
1313
el: &EventLoopWindowTarget<TE>,
1414
ctx: &Context,
1515
size: dpi::PhysicalSize,
@@ -46,13 +46,13 @@ pub struct WindowSurface {
4646

4747
impl WindowSurface {
4848
#[inline]
49-
pub fn new<TE>(
49+
pub unsafe fn new<TE>(
5050
el: &EventLoopWindowTarget<TE>,
5151
ctx: &Context,
5252
wb: WindowBuilder,
53-
) -> Result<(WindowSurface, Window), CreationError> {
53+
) -> Result<(Window, WindowSurface), CreationError> {
5454
platform_impl::WindowSurface::new(el, ctx.inner(), wb)
55-
.map(|(surface, window)| (WindowSurface { surface }, window))
55+
.map(|(window, surface)| (window, WindowSurface { surface }))
5656
}
5757

5858
#[inline]

glutin_examples/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ publish = false
1313
[dependencies]
1414
glutin = { path = "../glutin" }
1515
glutin_lighter = { path = "../glutin_lighter" }
16-
winit = "0.19"
1716
takeable-option = "0.5"
1817
image = "0.21"
1918
env_logger = "0.6"

0 commit comments

Comments
 (0)