Skip to content

Instantly share code, notes, and snippets.

glGenFramebuffers(1, &(priv->framebuffer));
glGenRenderbuffers(1, &(priv->depthbuffer));
glGenTextures(1, &(priv->colorbuffer));
/* set up the color buffer */
glBindTexture(GL_TEXTURE_2D, priv->colorbuffer);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8UI, im->width, im->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glBindTexture(GL_TEXTURE_2D, 0);
/* set up our depth buffer */
/* create and populate a VBO and VAO */
glGenBuffers(1, &vbo);
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(OILVertex) * vertices_length, vertices, GL_STATIC_DRAW);
glVertexPointer(3, GL_FLOAT, sizeof(OILVertex), (void *)offsetof(OILVertex, x));
glTexCoordPointer(2, GL_FLOAT, sizeof(OILVertex), (void *)offsetof(OILVertex, s));
@agrif
agrif / html.scm
Created January 4, 2013 04:52
a simple scheme example to output HTML
; helper to let us know when a symbol starts with :
(define attr?
(lambda (sym)
(and (symbol? sym)
(eq? #\: (string-ref (symbol->string sym) 0)))))
; handles tag contents, and the end tag
(define (tag-finish name args)
(if (null? args)
`((display "</")
import hesperus
import irc
import asyncore
import sys
#
# the irc node
#
irc = irc.IRCHandler.connect_to('irc.freenode.net', 6667)
I am the psychotherapist. Please, describe your problems. Each time
you are finished talking, type RET twice.
I have to recompile my kernel again.
Why do you say?
because the network driver is pretty horrible...
Can you elaborate on that?
@flowerpot.inlineFutures
def main():
_, prot = yield flowerpot.create_connection(HTTPProtocol.with_host('www.google.com'), 'www.google.com', 80)
code, status, headers, data = yield prot.send_request('get', '/', {'Connection' : 'close'})
print(code, status, len((yield data.read())))
09:35 < agrif> he acts like a duck and quacks like a duck, but he's a man
23:01 < aheadley|away> quacking up
23:48 < brownan> my alert noise on my phone is the old school macintosh "quack"
23:48 < brownan> so you're quacking my phone
23:48 < achin> quack quack brownan quack
23:50 < aheadley> i wasn't the one quacking up
13:42 < Corazu|work> you're such a quack
12:46 < EmceeBridge> <~brownan> also I left irc on my phone and now it quacks every time I send a message from minecraft
23:51 < achin> -o< *quack*
10:49 < brownan> -o< quack
11:39 -!- brownan [[email protected]] has joined #overviewer
11:39 < aheadley> brownan!
11:39 < achin> woah. it's brownan!
11:39 < brownan> greetings all
11:39 < CounterPillow> Holy shit it's brownan :O
11:39 < brownan> achin: got your github message
@agrif
agrif / python-do.py
Last active December 15, 2015 07:09
from functools import wraps
class Monad:
def bind(self, fn):
raise NotImplementedError
@classmethod
def pure(cls, val):
raise NotImplementedError
@classmethod
def fail(cls, e):
each byte looks like:
76543210 -> 7654
3210
bytes are laid out like:
00 02 04 06 08 0a 0c 0e 10 12 14 16
01 03 05 07 09 0b 0d 0f 11 13 15 17