This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print ("Starting Lua ramp bench") | |
local startTime = os.clock() | |
do | |
local floor = math.floor | |
local function image_ramp_green(n) | |
local img = {} | |
local f = 255/(n-1) | |
for i=1,n do | |
img[i] = { red = 0, green = floor((i-1)*f), blue = 0, alpha = 255 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int handleNilIndexing (lua_State* luaState) | |
{ | |
return 0; // zero return values is equivalent to returning nil | |
} | |
lua_State* setupLua() | |
{ | |
// Create the new lua state | |
lua_State* luaState = luaL_newstate(); | |