Skip to content

Instantly share code, notes, and snippets.

@roxlu ☾ roxlu

Block or report user

Report or block roxlu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@roxlu
roxlu / cam.cpp
Created Apr 3, 2019
Very rough veresion of turn table camera.
View cam.cpp
void Cam::init(const vec3& p, const vec3& t, const vec3& u, float winWidth, float winHeight) {
win_width = winWidth;
win_height = winHeight;
dir = t - p;
pos = p;
target = t;
up = u;
pm.perspective(60.0f, winWidth / winHeight, 0.1f, 100.0f);
lm.lookat(pos, target, up);
View test-mini-al.cpp
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <vector>
#include <poly/mini_al.h>
#include <poly/Log.h>
using namespace poly;
/* -------------------------------------------- */
@roxlu
roxlu / JanusRecorder.js
Last active Mar 19, 2018
Created this code while debuggging an issue where Janus only records a video of 8 bytes. Janus log: https://gist.github.com/roxlu/08f32169122dd23e132af7abfb37f928 You can clone this into a vhost; the test html contains a working version that allows you to create multiple video recordings w/o interruptions.
View JanusRecorder.js
/*
---------------------------------------------------------------------------------
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 / primitive-restart.cpp
Created Jan 16, 2018
Basic example of using primitive restart
View primitive-restart.cpp
/*
---------------------------------------------------------------
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 / CMakeLists.txt
Last active Apr 10, 2019
CMake example that shows how you can build Freetype2 with support for Harfbuzz and Harfbuzz with support for Freetype2. This example uses ExternalProject which is the standard way to include external dependencies. Note that we have to patch Freetype2 and Harfbuzz because their CMakelists are not fully CMake compatible (still depend on pkg-config…
View CMakeLists.txt
# This CMake file will build Freetype and Harfbuzz as external
# projects. We follow the build description as described here:
# https://sourceforge.net/projects/freetype/files/freetype2/2.5.3/ So,
# first we build Freetype2 w/o Harfbuzz, then we build Harfbuzz with
# freetype support after which we rebuild Freetype2 again.
#
# Both CMake files of Freetype2 and Harfbuzz are depending on
# pkg-config to find the dependencies for both projects. I've
# included a patch for Freetype2 and Harfbuzz which allows you to
# build Freetype2 and Harbuzz with pure CMake features. So I removed
View gist:2cf313df8eb3e59a2892f00988607a1a
0.05 µs glUniformMatrix4fv(0, 1, 0, {1.29904, 0, 0, 0, 0, -1.73205, 0, 0, 0, 0, -1.0202, -1, -831.384, 831.384, 680.224, 831.384});
0.14 µs glUniform4f(9, 1, 1, 1, 1);
0.14 µs glActiveTexture(GL_TEXTURE0);
0.64 µs glBindTexture(GL_TEXTURE_RECTANGLE, 2);
0.45 µs glUniform1i(4, 0);
0.03 µs glActiveTexture(GL_TEXTURE0);
0.75 µs glBindBuffer(GL_ARRAY_BUFFER, 4);
2.44 µs glBufferData(GL_ARRAY_BUFFER, 0x00000030, 0x7fc9ee9ad6f0, GL_STREAM_DRAW);
0.05 µs glBindBuffer(GL_ARRAY_BUFFER, 0);
0.12 µs glBindBuffer(GL_ARRAY_BUFFER, 5);
View OpenCvBackgroundSubtraction.cpp
#include <poly/Log.h>
#include <OpenCvBackgroundSubtraction.h>
namespace poly {
OpenCvBackgroundSubtraction::OpenCvBackgroundSubtraction()
:subtractor(NULL)
,width(0)
,height(0)
{
@roxlu
roxlu / focus.bar
Created Oct 6, 2016
Script to focus application (Windows 10 shows taskbar when application starts) (source: http://stackoverflow.com/questions/8266840/focus-a-batch-started-application)
View focus.bar
:start
call :focus "Title of Window"
timeout /t 10 /nobreak > NUL
goto start
::exit /b
:focus
setlocal EnableDelayedExpansion
if ["%~1"] equ [""] (
@roxlu
roxlu / RendezVousClient.cpp
Created May 25, 2016
STUN + RendezVous Server / Cliet
View RendezVousClient.cpp
#include <poly/Log.h>
#include <RendezVousClient.h>
#include <RendezVousTypes.h>
namespace poly {
/* -------------------------------------------------------------- */
RendezVousClientSettings::RendezVousClientSettings()
:rv_port(0)
@roxlu
roxlu / CMakeLists.txt
Created May 13, 2016
CMakeLists for microprofile; for now it compiles the demo_ui. Tested on Mac and Win.
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(microprofile)
include(ExternalProject)
set(bd ${CMAKE_CURRENT_LIST_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# SDL
ExternalProject_Add(
You can’t perform that action at this time.