This commit is contained in:
Drakulix 2017-06-18 19:20:23 +02:00
parent 57833f2b2d
commit f70cc6bf55
1 changed files with 12 additions and 9 deletions

View File

@ -117,14 +117,12 @@ impl error::Error for CreationError {
CreationError::OpenGlVersionNotSupported => { CreationError::OpenGlVersionNotSupported => {
"The requested OpenGL version is not \ "The requested OpenGL version is not \
supported." supported."
}, }
CreationError::NoAvailablePixelFormat => { CreationError::NoAvailablePixelFormat => {
"Couldn't find any pixel format that matches \ "Couldn't find any pixel format that matches \
the criterias." the criterias."
},
CreationError::NonMatchingSurfaceType => {
"Surface type does not match the context type."
} }
CreationError::NonMatchingSurfaceType => "Surface type does not match the context type.",
CreationError::NotSupported => "Context creation is not supported on the current window system", CreationError::NotSupported => "Context creation is not supported on the current window system",
} }
} }
@ -571,11 +569,16 @@ impl EGLContext {
trace!(self.logger, "Creating EGL window surface..."); trace!(self.logger, "Creating EGL window surface...");
match native { match native {
NativeSurface::X11(_) if self.backend_type != NativeType::X11 => return Err(CreationError::NonMatchingSurfaceType), NativeSurface::X11(_) if self.backend_type != NativeType::X11 => {
NativeSurface::Wayland(_) if self.backend_type != NativeType::Wayland => return Err(CreationError::NonMatchingSurfaceType), return Err(CreationError::NonMatchingSurfaceType)
NativeSurface::Gbm(_) if self.backend_type != NativeType::Gbm => }
return Err(CreationError::NonMatchingSurfaceType), NativeSurface::Wayland(_) if self.backend_type != NativeType::Wayland => {
_ => {}, return Err(CreationError::NonMatchingSurfaceType)
}
NativeSurface::Gbm(_) if self.backend_type != NativeType::Gbm => {
return Err(CreationError::NonMatchingSurfaceType)
}
_ => {}
}; };
let surface = { let surface = {