aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11/headless.rs
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2014-12-31 07:49:44 +0100
committertomaka <pierre.krieger1708@gmail.com>2014-12-31 07:49:44 +0100
commit4d5e39f436a1c68475f2dd97b33acf66117ee139 (patch)
tree83dfb936f2577b136536d713414a0fc6355c3442 /src/x11/headless.rs
parentfb42768a14228eba456cc8957820c14c105b1647 (diff)
parentc956559a5158e1d92ccc5acd7c89b025c68de758 (diff)
downloadglutin-4d5e39f436a1c68475f2dd97b33acf66117ee139.tar.gz
glutin-4d5e39f436a1c68475f2dd97b33acf66117ee139.zip
Merge pull request #173 from tomaka/change-builder-attribs
Finalize window building API
Diffstat (limited to 'src/x11/headless.rs')
-rw-r--r--src/x11/headless.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/x11/headless.rs b/src/x11/headless.rs
index d6f1023..22d0654 100644
--- a/src/x11/headless.rs
+++ b/src/x11/headless.rs
@@ -1,4 +1,4 @@
-use HeadlessRendererBuilder;
+use BuilderAttribs;
use CreationError;
use CreationError::OsError;
use libc;
@@ -13,11 +13,13 @@ pub struct HeadlessContext {
}
impl HeadlessContext {
- pub fn new(builder: HeadlessRendererBuilder) -> Result<HeadlessContext, CreationError> {
+ pub fn new(builder: BuilderAttribs) -> Result<HeadlessContext, CreationError> {
+ let dimensions = builder.dimensions.unwrap();
+
Ok(HeadlessContext {
- width: builder.dimensions.0,
- height: builder.dimensions.1,
- buffer: Vec::from_elem(builder.dimensions.0 * builder.dimensions.1, unsafe { mem::uninitialized() }),
+ width: dimensions.0,
+ height: dimensions.1,
+ buffer: Vec::from_elem(dimensions.0 * dimensions.1, unsafe { mem::uninitialized() }),
context: unsafe {
let ctxt = ffi::OSMesaCreateContext(0x1908, ptr::null());
if ctxt.is_null() {