aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/wayland
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 11:52:21 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 12:04:33 +0200
commit5182023fd6f14469290b80f0f5e9b0dead73048e (patch)
tree91fcb81cec8fad69f956712b97da79e58331203e /src/api/wayland
parentb5d0a3eb67247a8ed5e43a9161f7e9567e1c1ea7 (diff)
downloadglutin-5182023fd6f14469290b80f0f5e9b0dead73048e.tar.gz
glutin-5182023fd6f14469290b80f0f5e9b0dead73048e.zip
Switch X11 and wayland to the new design
Diffstat (limited to 'src/api/wayland')
-rw-r--r--src/api/wayland/mod.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/api/wayland/mod.rs b/src/api/wayland/mod.rs
index 56b9218..10d2acb 100644
--- a/src/api/wayland/mod.rs
+++ b/src/api/wayland/mod.rs
@@ -13,14 +13,16 @@ use api::dlopen;
use api::egl;
use api::egl::Context as EglContext;
-use BuilderAttribs;
use ContextError;
use CreationError;
use Event;
use PixelFormat;
use CursorState;
use MouseCursor;
+use GlAttributes;
use GlContext;
+use PixelFormatRequirements;
+use WindowAttributes;
use std::collections::VecDeque;
use std::ops::{Deref, DerefMut};
@@ -241,7 +243,9 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
}
impl Window {
- pub fn new(builder: BuilderAttribs) -> Result<Window, CreationError> {
+ pub fn new(window: &WindowAttributes, pf_reqs: &PixelFormatRequirements,
+ opengl: &GlAttributes<&Window>) -> Result<Window, CreationError>
+ {
use self::wayland::internals::FFI;
let wayland_context = match *WAYLAND_CONTEXT {
@@ -251,7 +255,7 @@ impl Window {
if !is_egl_available() { return Err(CreationError::NotSupported) }
- let (w, h) = builder.window.dimensions.unwrap_or((800, 600));
+ let (w, h) = window.dimensions.unwrap_or((800, 600));
let surface = EGLSurface::new(
wayland_context.compositor.create_surface(),
@@ -259,12 +263,12 @@ impl Window {
h as i32
);
- let mut shell_window = if let Some(PlatformMonitorID::Wayland(ref monitor)) = builder.window.monitor {
+ let mut shell_window = if let Some(PlatformMonitorID::Wayland(ref monitor)) = window.monitor {
let shell_surface = wayland_context.shell.get_shell_surface(surface);
shell_surface.set_fullscreen(ShellFullscreenMethod::Default, Some(&monitor.output));
ShellWindow::Plain(shell_surface)
} else {
- if builder.window.decorations {
+ if window.decorations {
ShellWindow::Decorated(match DecoratedSurface::new(
surface,
w as i32,
@@ -291,7 +295,7 @@ impl Window {
});
try!(EglContext::new(
egl,
- &builder.pf_reqs, &builder.opengl.clone().map_sharing(|_| unimplemented!()), // TODO:
+ pf_reqs, &opengl.clone().map_sharing(|_| unimplemented!()), // TODO:
egl::NativeDisplay::Wayland(Some(wayland_context.display.ptr() as *const _)))
.and_then(|p| p.finish((**shell_window.get_shell()).ptr() as *const _))
)