Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Rust 0.6 syntax. #2

Merged
merged 3 commits into from Apr 1, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Remove fail_unless!.

  • Loading branch information
metajack committed Apr 1, 2013
commit 055562a049a4739502279e621af7db87f89c1140
@@ -46,20 +46,20 @@ pub fn init_cgl() -> CGLContextObj {
let gl_error = CGLChoosePixelFormat(transmute(&attributes[0]),
to_unsafe_ptr(&pixel_format),
to_unsafe_ptr(&pixel_format_count));
fail_unless!(gl_error == kCGLNoError);
assert!(gl_error == kCGLNoError);

// Create the context.
let cgl_context = null();
let gl_error = CGLCreateContext(pixel_format, null(), to_unsafe_ptr(&cgl_context));
fail_unless!(gl_error == kCGLNoError);
assert!(gl_error == kCGLNoError);

// Set the context.
let gl_error = CGLSetCurrentContext(cgl_context);
fail_unless!(gl_error == kCGLNoError);
assert!(gl_error == kCGLNoError);

// Lock the context.
let gl_error = CGLLockContext(cgl_context);
fail_unless!(gl_error == kCGLNoError);
assert!(gl_error == kCGLNoError);

return cgl_context;
}
@@ -122,14 +122,14 @@ pub fn bind_surface_to_texture(context: &CGLContextObj, surface: &IOSurface, siz
UNSIGNED_INT_8_8_8_8_REV,
transmute(copy surface.obj),
0);
fail_unless!(gl_error == kCGLNoError);
assert!(gl_error == kCGLNoError);
}
}

pub fn bind_texture_to_framebuffer(texture: GLuint) {
gl2::bind_texture(TEXTURE_RECTANGLE_ARB, 0);
gl2::framebuffer_texture_2d(FRAMEBUFFER, COLOR_ATTACHMENT0, TEXTURE_RECTANGLE_ARB, texture, 0);
fail_unless!(gl2::check_framebuffer_status(FRAMEBUFFER) == FRAMEBUFFER_COMPLETE);
assert!(gl2::check_framebuffer_status(FRAMEBUFFER) == FRAMEBUFFER_COMPLETE);
}

impl ShareContext for MacContext {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.