This file contains hidden or 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
/** | |
* rutabaga: an OpenGL widget toolkit | |
* Copyright (c) 2013 William Light. | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright notice, this | |
* list of conditions and the following disclaimer. |
This file contains hidden or 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
/** | |
* code from http://burtleburtle.net/bob/rand/smallprng.html | |
* "I wrote this PRNG. I place it in the public domain." | |
*/ | |
#pragma once | |
#include <stdint.h> | |
#define JPRNG_RAND_MAX UINT32_MAX |
This file contains hidden or 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
/** | |
* released under http://unlicense.org/ | |
*/ | |
#include <time.h> | |
#ifdef _WIN32 | |
#include <windows.h> | |
static void |
This file contains hidden or 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
class LameError < RuntimeError | |
end | |
ShibeTest::Suite.new('ShibeTest') do | |
should_pass 'assert true' do |assert| | |
assert.true { true } | |
end | |
should_fail 'fail assert true' do |assert| | |
assert.true { false } |
This file contains hidden or 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
/* | |
** keeping track of objects that exist in both C and mruby is tricky! in | |
** situations where you're binding to a library which maintains its own | |
** internal lists of child objects (say, in a UI toolkit, a container | |
** object with a list of contained widgets), you want to do the least | |
** amount of bookkeeping possible, lest you do your bookkeeping wrong. | |
** | |
** here's a simple solution. it works by mapping a cptr to a ruby object, | |
** which preferably you'd use to wrap around said cptr with a MRB_TT_DATA | |
** object. the way you use it is simple: whenever you get a pointer back |
This file contains hidden or 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
/** | |
* rutabaga: an OpenGL widget toolkit | |
* Copyright (c) 2013 William Light. | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright notice, this | |
* list of conditions and the following disclaimer. |
This file contains hidden or 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
#!/bin/sh | |
# ustream | |
STREAM_KEY="" | |
STREAM_URL="rtmp://1.12617548.fme.ustream.tv/ustreamVideo/12617548/$STREAM_KEY flashver=FMLE/3.0\20(compatible;\20FMSc/1.0)" | |
# livestream | |
#LS_USER= | |
#LS_PASSWD= | |
#URL="mogulus/$LS_USER/username=$LS_USER/password=$LS_PASS/isAutoLive=true" |
This file contains hidden or 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
#include <stdlib.h> | |
#include <stdio.h> | |
/** | |
* this code has been placed into the public domain | |
*/ | |
/** | |
* ideally you'd have a hashmap (or lately i've been pretty happy with | |
* binary-trie-backed dicts), but in a pinch this sort of thing can be |
This file contains hidden or 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
/** | |
* william light <[email protected]> wrote this in 2012 | |
* | |
* released under creative commons CC0 | |
* http://creativecommons.org/publicdomain/zero/1.0/ | |
*/ | |
#include <sys/stat.h> | |
#include <stdlib.h> | |
#include <fcntl.h> |
This file contains hidden or 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
static void fb_status(const char *where) | |
{ | |
switch (glCheckFramebufferStatus(GL_FRAMEBUFFER)) { | |
case GL_FRAMEBUFFER_COMPLETE: | |
printf(" :: GL_FRAMEBUFFER_COMPLETE in %s\n", where); | |
break; | |
case GL_FRAMEBUFFER_UNDEFINED: | |
printf(" :: GL_FRAMEBUFFER_UNDEFINED in %s\n", where); | |
break; |