Skip to content

Instantly share code, notes, and snippets.

View tomaka's full-sized avatar

Pierre Krieger tomaka

  • Freelance
  • Berlin, Germany
View GitHub Profile
@tomaka
tomaka / ThreadedCommandsQueue.cpp
Created May 1, 2014 19:51
Class which allows parallel execution in a separate thread
#include "ThreadedCommandsQueue.hpp"
#include <future>
ThreadedCommandsQueue::ThreadedCommandsQueue()
{
std::promise<void> initializationFinished;
auto future = initializationFinished.get_future();
mExecutingThread = std::thread([this,&initializationFinished]() {
try {
@tomaka
tomaka / gl.rs
Last active August 29, 2015 14:02
Binding for OpenGL 4.4 in Rust, generated by bjz/gl-rs
// Copyright 2013 The gl-rs developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
@tomaka
tomaka / chipmunk2d.rs
Created June 23, 2014 12:00
Rust FFI for Chipmunk2D
/* automatically generated by rust-bindgen */
#![crate_id = "chipmunk-rs"]
#![crate_type = "lib"]
extern crate libc;
pub type size_t = ::libc::c_ulong;
pub type wchar_t = ::libc::c_int;
pub type idtype_t = ::libc::c_uint;
@tomaka
tomaka / Cargo.toml
Last active September 26, 2015 16:35
[package]
name = "test"
version = "0.0.1"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
build = "build.rs"
[dependencies]
libc = "*"
[build-dependencies]
; ModuleID = 'test.0.rs'
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
%str_slice = type { i8*, i32 }
%"2.core::fmt::Write::write_fmt::Adapter<collections::string::String>" = type { %"3.collections::string::String"* }
%"3.collections::string::String" = type { %"3.collections::vec::Vec<u8>" }
%"3.collections::vec::Vec<u8>" = type { %"5.alloc::raw_vec::RawVec<u8>", i32 }
%"5.alloc::raw_vec::RawVec<u8>" = type { %"2.core::ptr::Unique<u8>", i32 }
%"2.core::ptr::Unique<u8>" = type { %"2.core::nonzero::NonZero<*const u8>", %"2.core::marker::PhantomData<u8>" }
; ModuleID = 'test.0.rs'
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
%str_slice = type { i8*, i32 }
%"2.core::fmt::Formatter" = type { i32, i32, i8, %"2.core::option::Option<usize>", %"2.core::option::Option<usize>", { i8*, void (i8*)** }, %"2.core::slice::Iter<core::fmt::ArgumentV1>", { %"2.core::fmt::ArgumentV1"*, i32 } }
%"2.core::option::Option<usize>" = type { i32, [0 x i32], [1 x i32] }
%"2.core::slice::Iter<core::fmt::ArgumentV1>" = type { %"2.core::fmt::ArgumentV1"*, %"2.core::fmt::ArgumentV1"*, %"2.core::marker::PhantomData<&'static core::fmt::ArgumentV1>" }
%"2.core::fmt::ArgumentV1" = type { %"2.core::fmt::Void"*, i8 (%"2.core::fmt::Void"*, %"2.core::fmt::Formatter"*)* }
%"2.core::fmt::Void" = type {}
; ModuleID = 'test.0.rs'
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
%str_slice = type { i8*, i32 }
%"2.core::fmt::Formatter" = type { i32, i32, i8, %"2.core::option::Option<usize>", %"2.core::option::Option<usize>", { i8*, void (i8*)** }, %"2.core::slice::Iter<core::fmt::ArgumentV1>", { %"2.core::fmt::ArgumentV1"*, i32 } }
%"2.core::option::Option<usize>" = type { i32, [0 x i32], [1 x i32] }
%"2.core::slice::Iter<core::fmt::ArgumentV1>" = type { %"2.core::fmt::ArgumentV1"*, %"2.core::fmt::ArgumentV1"*, %"2.core::marker::PhantomData<&'static core::fmt::ArgumentV1>" }
%"2.core::fmt::ArgumentV1" = type { %"2.core::fmt::Void"*, i8 (%"2.core::fmt::Void"*, %"2.core::fmt::Formatter"*)* }
%"2.core::fmt::Void" = type {}
; ModuleID = 'test.0.rs'
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
%"1.std::ffi::c_str::CStr" = type { i8 }
%"2.core::raw::Slice<u8>" = type { i8*, i32 }
@const3150 = internal unnamed_addr constant i32 1, align 4
@byte_str3151 = internal unnamed_addr constant [4 x i8] c"foo\00", align 1
@const3152 = internal unnamed_addr constant { i8*, i32 } { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @byte_str3151, i32 0, i32 0), i32 4 }, align 4
; ModuleID = 'test.0.rs'
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
%"1.std::ffi::c_str::CStr" = type { i8 }
%"2.core::raw::Slice<u8>" = type { i8*, i32 }
@const3150 = internal unnamed_addr constant i32 1, align 4
@byte_str3151 = internal unnamed_addr constant [4 x i8] c"foo\00", align 1
@const3152 = internal unnamed_addr constant { i8*, i32 } { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @byte_str3151, i32 0, i32 0), i32 4 }, align 4
function __ZN5hello20h898a0b35c963e11dgaaE() {
var $$sreg$field = 0, $$sreg$field2 = 0, $$sreg$index1 = 0, $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $f = 0, $v = 0, label = 0, sp = 0;
sp = STACKTOP;
STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort();
$0 = sp;
$f = sp + 16|0;
$v = sp + 8|0;
$$sreg$field = HEAP32[$0>>2]|0;
$$sreg$index1 = ((($0)) + 4|0);
$$sreg$field2 = HEAP32[$$sreg$index1>>2]|0;