Skip to content

Instantly share code, notes, and snippets.

Avatar

@roxlu ☾ roxlu

View GitHub Profile
@roxlu
roxlu / CMakeLists.txt
Created Jun 23, 2013
Setting color bit depth. The GLFW 3.0.0 release used a color bit depth of 5,6,5 by default. You should update to 3.0.2 to fix this or set the bit depth yourself. Download the latest from https://github.com/glfw/glfw. This source is a test case I used to figure out why my colors/texcoords were interpolating wrongly. Using this dir structure: src/…
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
set(bd ${CMAKE_CURRENT_LIST_DIR}/)
set(src
${bd}/src/main.cpp
)
find_library(fr_co Cocoa)
@roxlu
roxlu / TestPattern.cpp
Created Sep 5, 2013
Example usage of X264. We create a raw YUV pattern and encode it with x264.
View TestPattern.cpp
#include <cmath>
#include <assert.h>
#include <core/TestPattern.h>
TestPattern::TestPattern()
:w(0)
,h(0)
,frame_num(0)
,duration(0)
@roxlu
roxlu / list.txt
Created Jan 25, 2013
List of compiler targets. Use for example: ./configure --target=x86-darwin11-gcc
View list.txt
armv5te-android-gcc armv5te-linux-rvct armv5te-linux-gcc
armv5te-none-rvct
armv6-darwin-gcc armv6-linux-rvct armv6-linux-gcc
armv6-none-rvct
armv7-android-gcc armv7-darwin-gcc armv7-linux-rvct
armv7-linux-gcc armv7-none-rvct
mips32-linux-gcc
ppc32-darwin8-gcc ppc32-darwin9-gcc ppc32-linux-gcc
ppc64-darwin8-gcc ppc64-darwin9-gcc ppc64-linux-gcc
sparc-solaris-gcc
@roxlu
roxlu / H264_Decoder.cpp
Created Mar 3, 2014
LibAV parser and decoder example with openGL (YUV420 -> RGB shader).
View H264_Decoder.cpp
#include "H264_Decoder.h"
H264_Decoder::H264_Decoder(h264_decoder_callback frameCallback, void* user)
:codec(NULL)
,codec_context(NULL)
,parser(NULL)
,fp(NULL)
,frame(0)
,cb_frame(frameCallback)
,cb_user(user)
@roxlu
roxlu / GridDrawer.cpp
Created Mar 5, 2013
Probably the most basic example of using Texture Buffer Objects (TBOs) with openGL
View GridDrawer.cpp
#include "GridDrawer.h"
#include "Grid.h"
GridDrawer::GridDrawer(Grid& grid)
:grid(grid)
,grid_prog(0)
,grid_vbo(0)
,grid_vao(0)
,u_projection_matrix(0)
{
@roxlu
roxlu / install_cygwin_sshd.txt
Last active Sep 24, 2020
Installing CYGWIN + SSHD for remote access through SSH on windows
View install_cygwin_sshd.txt
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p
@roxlu
roxlu / .gitignore
Last active Sep 17, 2020
Super basic glfw setup - this uses GLFX to setup function pointers
View .gitignore
._DS*
*DS_Store*
build
install
extern
node-*
references
@roxlu
roxlu / TestFboChangeBuffer.cpp
Last active Sep 11, 2020
Comparing the performance of different ping/pong techniques when using FBOs. One version uses two fbos and swaps between these, the other switches the draw and read buffer. See these results https://docs.google.com/spreadsheets/d/1ZyTQGkjYQajQtu8OvgRyaXJl46F4rZJStBCEK2kebgE/edit?usp=sharing for a comparison. It seems that switching read / draw b…
View TestFboChangeBuffer.cpp
#include <poly/Log.h>
#include <TestFboChangeBuffer.h>
using namespace poly;
TestFboChangeBuffer::TestFboChangeBuffer()
:fbo(0)
,dx(0)
{
tex[0] = 0;
@roxlu
roxlu / ssl_test2.c
Created Mar 28, 2014
Compact example of how to use openSSL with self signed (no password) keys/certificates, DTLS and memory BIOs
View ssl_test2.c
/*
Create server/client self-signed certificate/key (self signed, DONT ADD PASSWORD)
openssl req -x509 -newkey rsa:2048 -days 3650 -nodes -keyout client-key.pem -out client-cert.pem
openssl req -x509 -newkey rsa:2048 -days 3650 -nodes -keyout server-key.pem -out server-cert.pem
*/
#include <stdio.h>
@roxlu
roxlu / fun.cpp
Last active Aug 30, 2020 — forked from kizzx2/fun.cpp
Using lua 5.2 with C++
View fun.cpp
// fun.cpp
// This is for Lua 5.2, for Lua 5.1, see https://gist.github.com/kizzx2/1594905
#include <lua.hpp>
#include <iostream>
#include <sstream>
class Foo
{
You can’t perform that action at this time.