I can get a window open but I'm struggling to get it to move according to keypress, I know part of that issue is down to a previously mentioned issue in my last thread so I won't ask for help on that here but when I close the window glut decides to panic for some reason, this is how I've been using it so far (excuse the lua code, I've been mapping the calls and defines to behave as close to the way the C API behaves so just apply that knowledge here):
Code:
print("Calling " .. glut.api .. ".init()...")
glut.init()
print("Calling " .. glut.api .. ".initDisplayMode(DEPTH|RGBA|DOUBLE)...")
glut.initDisplayMode(glut.DEPTH|glut.RGBA|glut.DOUBLE)
print("Calling " .. glut.api .. ".initWindowPosition(150,150)...")
glut.initWindowPosition( 150, 150 )
print("Calling " .. glut.api .. ".initWindowSize(480,640)...")
glut.initWindowSize( 480, 640 )
print("Calling " .. glut.api .. ".createWindow()...")
main_window = glut.createWindow("Final Fantasy XV Cheat App Window")
print("Calling " .. glut.api .. ".displayFunc()...")
glut.displayFunc(
function()
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT)
glut.swapBuffers()
end
)
glut.keyboardFunc(
function(key,x,y)
print( "key = ".. key .. ", x = " .. x .. "y == " .. y ) -- Not currently reached
local wx = glut.get(glut.WINDOW_X)
local wy = glut.get(glut.WINDOW_Y)
if key == 27 then
glut.destroyWindow(main_window)
elseif key == glut.KEY_UP then
glut.positionWindow(wx,wy-1)
elseif key == glut.KEY_DOWN then
glut.positionWindow(wx,wy-1)
elseif key == glut.KEY_LEFT then
glut.positionWindow(wx-1,wy)
elseif key == glut.KEY_RIGHT then
glut.positionWindow(wx+1,wy)
end
glut.postRedisplay()
end
)
print("Calling " .. glut.api .. ".mainLoop()...")
glut.mainLoop()
Edit: Specific error message thrown is:
Error: foo_atexit() 0x0000000B Resource temporarily unavailable