Skip to content

Instantly share code, notes, and snippets.

@roxlu
roxlu / tinylib.h
Last active July 24, 2019 15:22
Tinylib - the most basic features for easy graphics development with GL
/*
--------------------------------------------------------------------------------
oooo
`888
oooo d8b .ooooo. oooo ooo 888 oooo oooo
`888""8P d88' `88b `88b..8P' 888 `888 `888
888 888 888 Y888' 888 888 888
888 888 888 .o8"'88b 888 888 888
@roxlu
roxlu / code.cpp
Last active June 4, 2020 01:56
Signature :)
---------------------------------------------------------------
oooo
`888
oooo d8b .ooooo. oooo ooo 888 oooo oooo
`888""8P d88' `88b `88b..8P' 888 `888 `888
888 888 888 Y888' 888 888 888
888 888 888 .o8"'88b 888 888 888
d888b `Y8bod8P' o88' 888o o888o `V88V"V8P'
@roxlu
roxlu / .gitignore
Last active September 17, 2020 05:49
Super basic glfw setup - this uses GLFX to setup function pointers
._DS*
*DS_Store*
build
install
extern
node-*
references
@roxlu
roxlu / Config.cpp
Last active February 18, 2019 21:33
Tiny, fast and clean configuration file parser using rapidxml with example of a to be released streaming video library http://rapidxml.sourceforge.net/
#include <iostream>
#include <fstream>
#include <rapidxml.hpp>
#include "Config.h"
Config::Config() {
}
Config::~Config() {
}
@roxlu
roxlu / YUV420PGrabber.cpp
Created September 16, 2013 11:06
YUV420P grabber
#include <assert.h>
#include <roxlu/core/Utils.h>
#include <roxlu/core/Log.h>
#include <image/Image.h>
#include <video/YUV420PGrabber.h>
YUV420PGrabber::YUV420PGrabber()
:y_prog(0)
,y_vert(0)
,y_frag(0)
@roxlu
roxlu / TestPattern.cpp
Created September 5, 2013 18:12
Example usage of X264. We create a raw YUV pattern and encode it with x264.
#include <cmath>
#include <assert.h>
#include <core/TestPattern.h>
TestPattern::TestPattern()
:w(0)
,h(0)
,frame_num(0)
,duration(0)
@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 / YUV420PGrabber.cpp
Created July 2, 2013 08:36
OpenGL RGB > YUV420P shader/class (doesn't do much more. implementation/usage is up to you)
#include <assert.h>
#include <roxlu/core/Utils.h>
#include <roxlu/core/Log.h>
#include "YUV420PGrabber.h"
YUV420PGrabber::YUV420PGrabber()
:y_prog(0)
,y_vert(0)
,y_frag(0)
,uv_prog(0)
@roxlu
roxlu / X264Encoder.cpp
Created June 26, 2013 21:01
X264 encoder example
#include <roxlu/core/Log.h>
#include <roxlu/core/Utils.h>
#include <video/X264Encoder.h>
X264Encoder::X264Encoder()
:in_width(0)
,in_height(0)
,in_pixel_format(AV_PIX_FMT_NONE)
,out_width(0)
,out_height(0)
@roxlu
roxlu / CMakeLists.txt
Created June 23, 2013 09:50
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/…
cmake_minimum_required(VERSION 2.8)
set(bd ${CMAKE_CURRENT_LIST_DIR}/)
set(src
${bd}/src/main.cpp
)
find_library(fr_co Cocoa)