Skip to content

Instantly share code, notes, and snippets.

View armadillu's full-sized avatar

Oriol Ferrer Mesià armadillu

View GitHub Profile
@roxlu
roxlu / VideoSurface.cpp
Created January 29, 2013 11:25
Fast texture uploads using pixel buffer objects. Improved upload of a 768x1366 texture from 16-20ms to 1-3ms (we can improve the performance a bit more by using GPU default pixel formats)
#include <shared/VideoSurface.h>
GLuint VideoSurface::prog = 0;
GLint VideoSurface::u_pm = 0;
GLint VideoSurface::u_mm = 0;
GLint VideoSurface::u_tex = 0;
GLfloat VideoSurface::pm[16] = {0};
VideoSurface::VideoSurface()
:width(0)
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 28, 2025 00:02
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@roxlu
roxlu / AppDelegate.h
Created December 14, 2012 22:42
Bare openGL application template for IOS. This application templates creates a basic GL context with a framebuffer without the need of a nibb. Note: I've based this on the examples from Apple. If something is wrong or there is a better way to create a full screen GL application, please add a comment or fork this.
#import <UIKit/UIKit.h>
#import "AppViewController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate> {
AppViewController* view_controller;
}
@property (strong, nonatomic) UIWindow *window;
@end
@roxlu
roxlu / Socket.cpp
Created September 12, 2012 20:53
Basic Winsock/Posix client socket wrapper (windows/mac)
#include <roxlu/io/Socket.h>
Socket::Socket() {
#ifdef _WIN32
int result = WSAStartup(MAKEWORD(2,2), &wsa_data);
if(result != 0) {
printf("Error: cannot initialize WinSock.\n");
WSACleanup();
}
#endif
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Generates Gource config file from git submodules, starts Gource.
# Place to /usr/local/bin and run at the main repository root.
#
# (c) 2010 Mikael Lammentausta
# License is the same as Gource (GPLv3)
import os
import re
@armadillu
armadillu / gist:2395589
Created April 16, 2012 00:37
IOS Font Names
(
"Thonburi-Bold",
Thonburi
)
2012-04-16 02:42:59.725 myApp[12412:707] (
"SnellRoundhand-Bold",
"SnellRoundhand-Black",
SnellRoundhand
)
2012-04-16 02:42:59.729 myApp[12412:707] (
@Bokugene
Bokugene / CGFontToFontData.m
Created February 23, 2012 13:21
Read Table Data from a CGFont, then wrap them into a OTF/TTF font.
typedef struct FontHeader {
int32_t fVersion;
uint16_t fNumTables;
uint16_t fSearchRange;
uint16_t fEntrySelector;
uint16_t fRangeShift;
}FontHeader;
typedef struct TableEntry {
uint32_t fTag;
@roxlu
roxlu / ptf.cpp
Created December 27, 2011 22:05
Parallel Transport Frames - TEST
//--------------------------------------------------------------
void testApp::setup(){
ofSetFrameRate(60);
ofSetVerticalSync(true);
ofBackground(33);
donnie.create(125);
donnie.si.drawUsingQuads();
//renderer.addSceneItem(donnie.si);