diff --git a/lib.rs b/lib.rs index a397e3d..2f0f0a8 100644 --- a/lib.rs +++ b/lib.rs @@ -7,7 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[link(name = "sharegl", vers = "0.1")]; +#[crate_id = "github.com/mozilla-servo/sharegl#0.1"]; extern mod std; extern mod extra; diff --git a/platform/linux.rs b/platform/linux.rs index 25e9ca7..9733e48 100644 --- a/platform/linux.rs +++ b/platform/linux.rs @@ -135,8 +135,8 @@ type Window = c_uint; // compatible with Drawable type XID = c_uint; type XPointer = *c_void; -#[link_args="-lX11 -lGL"] -#[nolink] +#[link(name = "X11")] +#[link(name = "GL")] extern { fn XOpenDisplay(n: c_int) -> *Display; fn XCreatePixmap(display: *Display, d: Drawable, width: c_uint, height: c_uint, depth: c_uint) @@ -179,7 +179,6 @@ pub struct GraphicsContext { impl GraphicsContext { // Creates a new, possibly shared, GLX context. - #[fixed_stack_segment] fn new_possibly_shared(share_context: Option) -> GraphicsContext { let (display, visual, pixmap) = GraphicsContext::create_display_visual_and_pixmap(); @@ -202,7 +201,6 @@ impl GraphicsContext { } } - #[fixed_stack_segment] fn create_display_visual_and_pixmap() -> (*Display, *XVisualInfo, GLXPixmap) { unsafe { // Get a connection. @@ -253,7 +251,6 @@ impl GraphicsContextMethods for GraphicsContext { } /// Makes this context the current context. - #[fixed_stack_segment] fn make_current(&self) { unsafe { let result = glXMakeContextCurrent(self.display, diff --git a/platform/macos.rs b/platform/macos.rs index 2ffa77c..b059c28 100644 --- a/platform/macos.rs +++ b/platform/macos.rs @@ -27,11 +27,6 @@ use opengles::gl2; use std::cast; use std::ptr; -// FIXME: This is not good. -#[link_args="-framework IOSurface -framework CoreFoundation"] -#[nolink] -extern {} - /// Mac-specific interface to 3D graphics contexts. pub struct GraphicsContext { cgl_context: Arc, @@ -39,7 +34,6 @@ pub struct GraphicsContext { impl GraphicsContext { /// Returns a new context, possibly shared with another context. - #[fixed_stack_segment] fn new_possibly_shared(share_context: Option) -> GraphicsContext { unsafe { // Choose a pixel format. @@ -91,7 +85,6 @@ impl GraphicsContextMethods for GraphicsContext { } /// Makes this context the current context. - #[fixed_stack_segment] fn make_current(&self) { unsafe { let gl_error = CGLSetCurrentContext(*self.cgl_context.get()); @@ -170,7 +163,6 @@ pub fn init_texture() -> GLuint { } // Assumes the texture is already bound via gl2::bind_texture(). -#[fixed_stack_segment] pub fn bind_surface_to_texture(context: &GraphicsContext, surface: &IOSurface, size: Size2D) { use core_foundation::base::TCFType; // FIXME: There should be safe wrappers for this.