Skip to content

Instantly share code, notes, and snippets.

View nilium's full-sized avatar
🍉
internal screaming intensifies

Noel nilium

🍉
internal screaming intensifies
View GitHub Profile
@nilium
nilium / ffitest.ooc
Created November 30, 2009 07:43
libffi ooc bindings WIP
use libffi
import libffi
import structs/Array
main: func {
closure := FFIClosure new()
cif := FFICIF new()
types: Array<FFIType*> = Array<FFIType*> new(2)
types[0] = FFIType SINT&
types[1] = FFIType POINTER&
Strict
Type AbstractEnumerator Abstract
Method NextObject:Object() Abstract
Method HasNext:Int() Abstract
End Type
Type List
Method ObjectEnumerator:AbstractEnumerator()
Type Enumerator Extends AbstractEnumerator
SuperStrict
Type Animation
?Threaded
Global AnimationsLock:TMutex = TMutex.Create()
?
Global Animations:TList = New TList
Global AnimationTimer:TTimer = TTimer.Create(60, Null)
Field o:Object ' Object being animated, used to keep pointer to object in scope during animation
Mat4: class {
m:Double[16]
}
operator [] (mat:Mat4, row:Int) -> Double* {
return mat m[row*4]&
}
someMat := Mat4 new()
Nut: class {
cracker: Int
init: func(cracker: Int) {
this cracker = cracker
}
bust: func {
cracked *= 5
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdbool.h>
#include <ctype.h>
#include <string.h>
#include "lexer.h"
/*
Copyright (c) 2010 Noel R. Cower
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
/*
Copyright (c) 2010 Noel R. Cower
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
SuperStrict
'buildopt:threads
'buildopt:gui
Import "Source/Nihilit/Animation.bmx"
Type NButton
Field c_r%, c_g%, c_b%
Field x!, y!, width!, height!
@nilium
nilium / NLayoutRule.h
Created April 12, 2010 05:31
View for handling layout of subviews in Cocoa
//
// NLayoutRule.h
// NToolkit
//
// Created by Noel Cower on 4/10/10.
// Copyright (c) 2010 Noel R. Cower
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights