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

test.rs: Change to new task_builder #1

Merged
merged 1 commit into from Jul 24, 2012
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Change rust-glut test.rs to new task::task_builder interface

  • Loading branch information
bblum committed Jul 24, 2012
commit a3752613a4fac684e519bb435588fa9d9257b163
11 test.rs
@@ -16,7 +16,7 @@ import comm::{chan, peek, port, recv, send};
import io::println;
import ptr::{addr_of, null};
import str::bytes;
import task::{builder, get_opts, run_listener, set_opts};
import task::{task_builder, get_opts, run_listener, set_opts};
import vec::unsafe::to_ptr;

fn fragment_shader_source() -> ~str {
@@ -129,16 +129,11 @@ fn display_callback() {

#[test]
fn test_triangle_and_square() unsafe {
let builder = builder();
let opts = {
sched: some({ mode: task::osmain, foreign_stack_size: none })
with get_opts(builder)
};
set_opts(builder, opts);
let builder = task::task().sched_mode(task::osmain);

let po: port<()> = port();
let ch = chan(po);
let _result_ch: chan<()> = run_listener(builder, |_port| {
let _result_ch: chan<()> = builder.spawn_listener(|_port| {
init();
init_display_mode(0 as c_uint);
let window = create_window(~"Rust GLUT");
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.