- Demonstrate example first:
- Initial resource loading is done in parallel. Completely safe AND super easy to use.
- Multiple behaviors run in parallel each frame. API isn't final, just proof of concept.
- Go low-level, work our way up through the API.
- Start with fibers:
- Basic overview of fibers:
- Similar to threads. Each has own stack, can be suspended and resumed.
- Basic overview of fibers:
- For threads, the system manages all threads and suspends and resumes them to give them all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property surface_diffuse: Texture2d; | |
property surface_color: Color; | |
property surface_specular: Color; | |
property surface_shininess: f32; | |
program frag { | |
// Calculate phong illumination. | |
vec4 ambient = vec4(0.0, 0.0, 0.0, 1.0); | |
vec4 diffuse = vec4(0.0, 0.0, 0.0, 1.0); | |
vec4 specular = vec4(0.0, 0.0, 0.0, 1.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(fnbox)] | |
use std::boxed::FnBox; | |
/// Represents a single unit of work that needs doing. | |
/// | |
/// Erases type information about the work that needs to be done, reducing it | |
/// to a single function invocation. | |
struct Worker(Box<FnBox()>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::rc::Rc; | |
#[macro_use] | |
mod alias { | |
use std::ops::Deref; | |
use std::rc::Rc; | |
#[derive(Debug, Clone)] | |
pub struct RcAlias<T, U> { | |
rc: Rc<T>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! More shareable, mutable containers. | |
//! | |
//! [`Cell<T>`][cell] and [`RefCell<T>`][refcell] are a good start, but they | |
//! don't represent all the forms of interior mutability that developers might | |
//! need. This crate provides a more comprehensive suite of cell types to cover | |
//! the cases not solved by the standard library. For more information on cells | |
//! and interior mutability in general please see [the std::cell module's | |
//! documentation][std::cell]. | |
//! | |
//! # When Should You Use Which Cell? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void NotACoroutine() | |
{ | |
Action callback = null; | |
for (var index = 0; index < 5; index++) | |
{ | |
Guid guid = Guid.NewGuid(); | |
var indexCopy = index; | |
Debug.Log("Guid in loop body: " + guid + ", index: " + index + ", index copy: " + indexCopy); | |
if (callback == null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(plugin)] | |
#![plugin(rocket_codegen)] | |
use std::sync::RwLock; | |
use std::sync::Arc; | |
use std::time; | |
use std::thread; | |
extern crate rocket; | |
use rocket::State; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Unity.Entities; | |
using Unity.Mathematics; | |
using UnityEngine; | |
using Unity.Transforms2D; | |
namespace TwoStickPureExample | |
{ | |
public class PlayerMoveSystem : ComponentSystem | |
{ | |
public struct Data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let app_root = application_root_dir().unwrap(); | |
// TIRED | |
let mut path = app_root.clone(); | |
path.push("examples/pong/resources/display.ron"); | |
// WIRED | |
let path = app_root | |
.clone() | |
.tap(|path| path.push("examples/pong/resources/display.ron")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hypothetical pipeline syntax. | |
let value = foo()? |> bar()? |> baz()?; | |
// Command example. | |
// ------------------------------------------ | |
let command = Command::new("foo") | |
..arg("--bar"); | |
if set_baz { |
OlderNewer