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 / 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 / TestFboChangeBuffer.cpp
Last active Apr 24, 2018
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 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>
@roxlu
roxlu / compile.sh
Created Dec 28, 2014
Apache, PHP and MySQL build script for Mac 10.10
View compile.sh
#!/bin/bash
d=${PWD}
sd=${d}/sources
bd=${d}/build
id=${d}/installed/
PATH_ORIG=${PATH}
CC_ORIG=${CC}
CPP_ORIG=${CPP}
@roxlu
roxlu / CMakeLists.txt
Created Sep 26, 2014
Work in progress, simple cross platform mutex and threading code
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8.11)
set(bd ${CMAKE_CURRENT_LIST_DIR})
set(id ${bd})
include_directories(${id})
add_executable(test_thread test_thread.cpp)
if (WIN32)
@roxlu
roxlu / opengl_wrappers.c
Last active Mar 18, 2018
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.)
View opengl_wrappers.c
/*
See https://gist.github.com/roxlu/6152fccfdd0446533e1b for the latest version.
Author: roxlu
Twitter: http://www.twitter.com/roxlu
*/
/* ------------------------------------------------------------------------*/
@roxlu
roxlu / AsyncUpload.cpp
Last active Apr 26, 2019
Experimental code to test fast pixel transfers using PBOs.
View AsyncUpload.cpp
#include <gfx/AsyncUpload.h>
namespace gfx {
AsyncUpload::AsyncUpload()
:width(0)
,height(0)
,dx(0)
,channels(0)
,n(0)
@roxlu
roxlu / test_fex_load_image.cpp
Created Aug 22, 2014
Examples on how to load + reuse memory using rx_load_png and rx_load_jpg
View test_fex_load_image.cpp
/*
test_fex_load_image
-------------------
Plain test which loads + reloads a couple of images and reallocating the
previously allocated buffer when needed. Just a tiny test to speed up
the image loading process.
*/
@roxlu
roxlu / test_vorbis.c
Last active Aug 29, 2015
Decoding vorbis flow (w/o cleanup yet).
View test_vorbis.c
/*
test_vorbis
------------
See online version: https://gist.github.com/roxlu/af1ffc1290b9dc37b5b9
Example code which decodes a .ogg file that contains vorbis and/or
some other stream, e.g. theora. We ignore all non-vorbis streams and
simply flush the packets.
@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)
You can’t perform that action at this time.