diff --git a/platform/linux.rs b/platform/linux.rs index 2d305c2..179ff84 100644 --- a/platform/linux.rs +++ b/platform/linux.rs @@ -179,6 +179,7 @@ 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(); @@ -201,6 +202,7 @@ impl GraphicsContext { } } + #[fixed_stack_segment] fn create_display_visual_and_pixmap() -> (*Display, *XVisualInfo, GLXPixmap) { unsafe { // Get a connection. @@ -251,6 +253,7 @@ 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 86c0482..c050680 100644 --- a/platform/macos.rs +++ b/platform/macos.rs @@ -39,6 +39,7 @@ 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. @@ -90,6 +91,7 @@ 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()); @@ -165,6 +167,7 @@ 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) { // FIXME: There should be safe wrappers for this. unsafe {