Skip to content

Instantly share code, notes, and snippets.

View hadronized's full-sized avatar
🐺
Oublie qu’t’as aucune chance, va-y, fonce.

Dimitri Sabadie hadronized

🐺
Oublie qu’t’as aucune chance, va-y, fonce.
View GitHub Profile
extern crate gl; // 0.6.1
extern crate glfw; // 0.9.1
use std::os::raw::c_void;
pub use glfw::Context;
fn main() {
let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
fn test() -> Foo {
let i = 3;
Foo {
updater: Box::new(|| println!("{}", &i))
}
}
fn main() -> () {
let var0: std::collections::hash::map::HashMap; // a
let var1: &'static std::collections::hash::map::HashMap; // __arg0
let mut tmp0: core::iter::Map, [closure@:4:41: 4:55]>;
let mut tmp1: collections::vec::IntoIter;
let mut tmp2: collections::vec::Vec;
let mut tmp3: ();
let mut tmp4: Box<[i32]>;
let mut tmp5: Box<[i32; 4]>;
let mut tmp6: Box<[i32; 4]>;
struct Buffer<C: HasBuffer, T> {
repr: C::ABuffer
, phantom: PhantomData<T>
}
extern crate glfw;
use glfw::{Action, Context, Key};
fn main() {
let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
// Create a windowed mode window and its OpenGL context
let (mut window, events) = glfw.create_window(300, 300, "Hello this is window", glfw::WindowMode::Windowed)
.expect("Failed to create GLFW window.");
struct Widget {
virtual ~Widget();
virtual void foo() = 0;
};
class Label : public Widget {
std::string _value;
public:
@hadronized
hadronized / Camera.hs
Last active August 29, 2015 14:17
Netwire camera example
{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, TupleSections #-}
module Test where
import Control.Arrow
import qualified Control.Monad as M ( unless )
import Control.Wire
import Control.Wire.Unsafe.Event
import Data.Foldable ( foldMap, for_ )
import Data.Function ( fix )
module AST where
data E a
= Var a
| Add (E a) (E a)
| Sub (E a) (E a)
| Mul (E a) (E a)
| Div (E a) (E a)
deriving (Eq,Show)
Graphics/Rendering/Sky/GL/Framebuffer.hs:95:3: Warning:
Pattern match(es) are overlapped
In a case alternative:
gl_FRAMEBUFFER_UNDEFINED -> ...
gl_FRAMEBUFFER_INCOMPLETE_ATTACHMENT -> ...
gl_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT -> ...
gl_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER -> ...
...
module Test where
import Control.Monad.Trans
import Control.Monad.Trans.Reader
data Env = Env {
-- |A very important value.
important :: Int
-- |A less important value.
, notImportant :: Float