Skip to content

Instantly share code, notes, and snippets.

@roxlu ☾ roxlu

View GitHub Profile
@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(
View convert_movies.sh
#!/bin/sh
set -x
if [ ! -d ${PWD}/h264 ] ; then
mkdir h264
fi
if [ ! -d ${PWD}/r264 ] ; then
mkdir r264
fi
@roxlu
roxlu / AudioConverterBrain.cpp
Created May 6, 2016
Example implementation of using the amazing b8brain audio samplerate converter, https://github.com/avaneev/r8brain-free-src This was used for a real time audio stream converter.
View AudioConverterBrain.cpp
#include <poly/AudioConverterBrain.h>
#include <poly/AudioDataConverter.h>
namespace poly {
AudioConverterBrain::AudioConverterBrain()
:listener(NULL)
{
}
View cache.cpp
#if 0
/* takes ~0.038ms */
for (size_t k = 0; k < convert_from.nchannels; ++k) {
std::vector<double>& prepared_data = channel_data[k];
for (size_t i = 0; i < nframes; i++) {
prepared_data[i] = src_ptr[k + (i * convert_from.nchannels)];
}
}
#else
/* takes 0.0025 ms*/
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(PluginTest)
add_library(Transportation STATIC Car.cpp SomeFunctions.c)
add_library(Plugin MODULE Plugin.cpp)
target_link_libraries(Plugin Transportation)
@roxlu
roxlu / TestFboChangeBuffer.cpp
Last active Jul 16, 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 / fun.cpp
Last active Jul 11, 2019 — 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
{
@roxlu
roxlu / fun.cpp
Last active Aug 29, 2015 — forked from kizzx2/fun.cpp
THIS DOES NOT WORK WITH 5.2
View fun.cpp
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
You can’t perform that action at this time.