Skip to content

Instantly share code, notes, and snippets.

View fkaa's full-sized avatar

Felix Nemo Kaaman fkaa

  • 08:09 (UTC +11:00)
View GitHub Profile
fn example() -> Result<()> {
let mut state = flu::State::new();
// lua_createtable and luaL_ref
let meta = flu::Table::reference(&state, |cxt| {
fn __add(stack: flu::FunctionStack) -> Result<i32> {
let a = stack.with_arg::<flu::Table, _, _>(1, |cxt| {
cxt.get::<f64>("a")
})?;
fn example() -> Result<()> {
let mut state = State::new();
fn add(stack: FunctionStack) -> Result<i32> {
let sz = stack.check_size(1..)?;
let mut sum = 0f64;
for i in 1..(sz + 1) {
sum += stack.arg::<f64>(i)?;
}
float increment = 0.009;
float yy = 0;
void setup() {
size(640, 360);
}
int checkerboard(int x, int y) {
if ((x + y & 1) == 0) {
return color(74, 104, 139, 255);
use std::env;
use std::path::Path;
use std::process::Command;
macro_rules! compile_hlsl {
( $( $file:expr => ($entry:ident, $target:ident) -> $output:expr),* ) => {
{
let mut funcs = Vec::new();
$(
cobalt/daisyMoon/sounds.lua:292: attempt to concatenate local 'filename' (a boolean value)
stack traceback:
[1] cobalt/daisyMoon/sounds.lua:291: in function playSound
[2] cobalt/daisyMoon/player.lua:6294: in function confirmEditOffer
[3] cobalt/daisyMoon/player.lua:3378: in function onOfferEditAction
[4] cobalt/daisyMoon/player.lua:3238: in function handler
[5] cobalt/daisyMoon/player.lua:3249: in function onInput
[6] cobalt/daisyMoon/input.lua:815: in function set
[7] cobalt/daisyMoon/input.lua:889: in function transmitChanges
[8] cobalt/daisyMoon/controller.lua:3149: in function updateTransmit
use winit::{WindowEvent, ElementState};
static mut KEYS: [bool; 256] = [false; 256];
static mut KEYS_PRESSED: [bool; 256] = [false; 256];
static mut KEYS_RELEASED: [bool; 256] = [false; 256];
pub fn key_poll(evt: WindowEvent) {
match evt {
WindowEvent::KeyboardInput(ElementState::Pressed, scan, _, _) => {
unsafe {
2016-11-03 15:43:57.854061 teapot[40882:584608] [DYMTLInitPlatform] platform initialization successful
2016-11-03 15:43:57.871593 teapot[40882:584588] Metal GPU Frame Capture Enabled
2016-11-03 15:43:57.872004 teapot[40882:584588] Metal API Validation Enabled
[mvk-info] Device Intel HD Graphics 4000 supports Metal Feature Set: macOS GPU Family 1 v1
Using device: Intel HD Graphics 4000 (type: IntegratedGpu)
[mvk-info] You require a license for the MoltenVK Vulkan Core feature set. Reverting to evaluation mode.
[mvk-info] Created 2 swapchain images with initial size (1024, 768).
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: OomError(OutOfDeviceMemory)', ../src/libcore/result.rs:799
stack backtrace:
1: 0x101f7d528 - std::sys::backtrace::tracing::imp::write::h22f199c1dbb72ba2
@fkaa
fkaa / e.rs
Created September 13, 2016 13:45
> cargo run --example deferred
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target/debug/examples/deferred`
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:317
stack backtrace:
1: 0x10f196bea - std::sys::backtrace::tracing::imp::write::h4b09e6e8c01db097
2: 0x10f198baf - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
3: 0x10f198015 - std::panicking::default_hook::h96c288d728df3ebf
4: 0x10f1985c6 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
5: 0x10f198464 - std::panicking::begin_panic::hfbeda5aad583dc32
diff --git a/Building.md b/Building.md
index f04bec7..8405bf9 100644
--- a/Building.md
+++ b/Building.md
@@ -14,7 +14,7 @@ Out of these, only `sackit` should require manual building. Here are a few examp
$ apt-get install lua5.1 libenet-dev libsdl2-dev
# OS X
-$ brew install lua, enet, SDL
+$ brew install lua, enet, SDL2
examples/caps/main.rs:20:42: 20:46 error: overflow evaluating the requirement `_: std::marker::Sized` [E0275]
examples/caps/main.rs:20 println!("Device name: {:?}", device.name());
^~~~
<std macros>:2:25: 2:56 note: in this expansion of format_args!
<std macros>:3:1: 3:54 note: in this expansion of print! (defined in <std macros>)
examples/caps/main.rs:20:5: 20:50 note: in this expansion of println! (defined in <std macros>)
examples/caps/main.rs:20:42: 20:46 help: run `rustc --explain E0275` to see a detailed explanation
examples/caps/main.rs:20:42: 20:46 note: consider adding a `#![recursion_limit="128"]` attribute to your crate
examples/caps/main.rs:20:42: 20:46 note: required because it appears within the type `(_, _)`
examples/caps/main.rs:20:42: 20:46 note: required because it appears within the type `(_, (_, _))`