Skip to content

Instantly share code, notes, and snippets.

@roxlu
roxlu / opengl_wrappers.c
Last active March 18, 2018 16:05
A couple of wrappers for opengl which are handy when you want to provide some openGL features in your library. Simply embed these into your cpp file. (Note that your executable will become slightly bigger because of this.)
/*
See https://gist.github.com/roxlu/6152fccfdd0446533e1b for the latest version.
Author: roxlu
Twitter: http://www.twitter.com/roxlu
*/
/* ------------------------------------------------------------------------*/
@roxlu
roxlu / install_arch_linux.org
Created March 5, 2013 22:42
Install arch-linux - work in progress gui

Installing ARCH linux

Preparation:

  • Get an empty USB disk
  • Create 2 partitions:
    • ARCH - filesystem FAT
    • FAT - filesystem FAT
  • Downlaod Arch linux from: www.archlinux.org/download and put on your USB ARCH partition
  • Make sure you have an Ubuntu install somewhere (VMware would work)

Fix the iso to be usable for UEFI:

@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 / Oils.cpp
Created July 10, 2013 14:36
Attribute-less rendering with openGL - you're not allowed to draw with the default VertexArray so you need to create one.
#include <assert.h>
#include <roxlu/core/Log.h>
#include "Oils.h"
Oils::Oils()
:win_w(0)
,win_h(0)
,br_prog(0)
,br_vert(0)
,br_frag(0)
@roxlu
roxlu / PointCloudCompile.sh
Created July 8, 2012 10:40
Pointcloud PCL, compile script
#!/bin/sh
# PCL version 1.5.1
# Boost 1.49
# Eigen 6e7488e20373
# Flann 1.7.1
# QHull 2012.1
# VTK 5.10.0
d=${PWD}
bd=${PWD}/build
@roxlu
roxlu / Oil.cpp
Created March 2, 2013 17:23
Oil Painting a la Petros Vrellis Starry Night
#include "Oil.h"
Oil::Oil()
:gray_pixels(0)
,color_pixels(0)
{
}
Oil::~Oil() {
}
@roxlu
roxlu / example.h
Created December 22, 2012 19:45
Using inline shaders with macro which 'stringifies' the shader code.
#ifndef JADI_DEPTH_OF_FIELDH
#define JADI_DEPTH_OF_FIELDH
#include <jadi/Jadi.h>
#include <vector>
#define GLSL(version, shader) "#version " #version "\n" #shader
static const char* DOF_DEBUG_VS = GLSL(120,
uniform mat4 u_pm;
@roxlu
roxlu / focus.bar
Created October 6, 2016 15:09
Script to focus application (Windows 10 shows taskbar when application starts) (source: http://stackoverflow.com/questions/8266840/focus-a-batch-started-application)
:start
call :focus "Title of Window"
timeout /t 10 /nobreak > NUL
goto start
::exit /b
:focus
setlocal EnableDelayedExpansion
if ["%~1"] equ [""] (
@roxlu
roxlu / compile.sh
Created December 28, 2014 18:03
Apache, PHP and MySQL build script for Mac 10.10
#!/bin/bash
d=${PWD}
sd=${d}/sources
bd=${d}/build
id=${d}/installed/
PATH_ORIG=${PATH}
CC_ORIG=${CC}
CPP_ORIG=${CPP}
@roxlu
roxlu / onb.cpp
Created July 10, 2012 08:51
Fast coordinate systems from direction vector, from Jeppe Revall Frisvad
/*
* The following source code accompanies the JGT article
*
* Building an Orthonormal Basis from a 3D Unit Vector
* Without Normalization
*
* By author: Jeppe Revall Frisvad
*
* After submitting the article to production, I found an
* improvement for my implementation of the Hughes-Moeller