Skip to content

Instantly share code, notes, and snippets.

@kayru
kayru / gist:2624992
Created May 6, 2012 23:32
Premake4 vararg compatibility changes for LuaJIT 2.0
# HG changeset patch
# User Yuriy O'Donnell <yuriyo@gmail.com>
# Date 1336346476 -3600
# Node ID 9abcac50982464079bc7ef681fa6dccefceeb704
# Parent 1c40bd936d1f6f919f1e9bc9225621b4f9e38aad
luajit 2.0 varargs compatibility fix
diff --git a/src/base/globals.lua b/src/base/globals.lua
--- a/src/base/globals.lua
+++ b/src/base/globals.lua
@kayru
kayru / gist:2624976
Created May 6, 2012 23:30
premake4 luajit test results
$ time ./test_release
Building configurations...
Running action 'test'...
running time : 5.01
789 tests passed, 0 failed
Done.
real 0m5.079s
user 0m0.539s
sys 0m4.531s
@kayru
kayru / generate_points_inside_sphere.py
Created April 30, 2012 18:22
Generate random points inside a sphere
import sys
import random
def GeneratePointsInsideSphere(num_points) :
points = []
for i in range(num_points) :
while True :
x = random.uniform(-1,1)
@kayru
kayru / generate_points_inside_disc.py
Created April 30, 2012 18:20
Generate random points on disc
import sys
import random
def GeneratePointsInsideDisc(num_points) :
points = []
for i in range(num_points) :
while True :
x = random.uniform(-1,1)
@kayru
kayru / Jamfile.jam
Created April 21, 2012 12:58
Data build jamfile
# JamPlus script
SubDir TOP ;
DEPCACHE.standard = ../bin/data/depcache ;
# Global paths
PATH_DATA = "../bin/data" ;
PATH_CONTENT = "../content" ;
@kayru
kayru / Jamrules.jam
Created April 21, 2012 12:58
Data build jamrules
# JamPlus script
MODEL_TOOL = "..\\bin\\datatool.exe" ;
TEXTURE_TOOL = "..\\scripts\\win32\\texconv.exe" ;
SHADER_TOOL = "..\\scripts\\win32\\fxc.exe" ;
# --------------------------------------------------------------------------
actions ModelAction
{
@kayru
kayru / gist:1654357
Created January 21, 2012 22:54
librush sample: hello world
#include <Rush/Rush.h>
#include <Rush/Platform.h>
#include <stdio.h>
using namespace Rush;
RushAppConfig g_appConfig;
static void startup(RushPlatformContext* context)
@kayru
kayru / gist:1654356
Created January 21, 2012 22:54
librush sample: embedded font
#include <Rush/Rush.h>
#include <Rush/Platform.h>
#include <Rush/RenderPrimitiveBatch.h>
#include <Rush/GraphicsBitmapFont.h>
#include <stdio.h>
using namespace Rush;
RushAppConfig g_appConfig;
@kayru
kayru / opencl_device_info.cpp
Created December 31, 2011 04:35
Dump basic information about OpenCL devices in the system
// On MacOS X compile with g++ -framework OpenCL <filename>
#include <stdio.h>
#include <OpenCL/opencl.h>
#define P(x) x,#x
void printClDeviceInfoString(cl_device_id device_id, cl_device_info param_name, const char* printable_name)
{
char val[1024];
@kayru
kayru / BoilerplateD3D11.cpp
Last active November 29, 2020 11:21
D3D11 Boilerplate code
// clang main.cpp
#include <tchar.h>
#include <stdint.h>
#include <stdio.h>
#include <windows.h>
#include <D3D11.h>
#include <D3Dcompiler.h>