Nothing too special, but useful:
1) A routine to increase the priority of your game.
@GetCurrentProcess = Win32API.new('kernel32', 'GetCurrentProcess', [], 'i').call
@SetPriorityClass = Win32API.new('kernel32', 'SetPriorityClass', ['p', 'i'], 'i')
@SetPriorityClass.call(@GetCurrentProcess, 0x00000080)
2) A routine to reduce the fragmentation of the heap. You don't need to capture the return... I'm showing it just for completeness. If the function fails, you will default to the standard allocation scheme.
@GetProcessHeap = Win32API.new('kernel32', 'GetProcessHeap', [], 'i').call
@HeapSetInformation = Win32API.new('kernel32', 'HeapSetInformation', ['i', 'i', 'p', 'i'], 'i')
HeapInfo = 2
test = @HeapSetInformation.call(@GetProcessHeap, 0, HeapInfo, 2)
if (test == 0)
printf("HeapSetInfo failed!")
end
3) A routine to launch the joystick (aka: "Game controllers") control panel applet.
@ShellExec = Win32API.new('shell32', 'ShellExecuteA', ['i', 'p', 'p','p','p', 'i'], 'i')
@ShellExec.call(0, "open", "rundll32.exe", "shell32.dll,Control_RunDLL joy.cpl", 0, 1)
If there are routines you'd like... feel free to ask...
-Brycej
1) A routine to increase the priority of your game.
@GetCurrentProcess = Win32API.new('kernel32', 'GetCurrentProcess', [], 'i').call
@SetPriorityClass = Win32API.new('kernel32', 'SetPriorityClass', ['p', 'i'], 'i')
@SetPriorityClass.call(@GetCurrentProcess, 0x00000080)
2) A routine to reduce the fragmentation of the heap. You don't need to capture the return... I'm showing it just for completeness. If the function fails, you will default to the standard allocation scheme.
@GetProcessHeap = Win32API.new('kernel32', 'GetProcessHeap', [], 'i').call
@HeapSetInformation = Win32API.new('kernel32', 'HeapSetInformation', ['i', 'i', 'p', 'i'], 'i')
HeapInfo = 2
test = @HeapSetInformation.call(@GetProcessHeap, 0, HeapInfo, 2)
if (test == 0)
printf("HeapSetInfo failed!")
end
3) A routine to launch the joystick (aka: "Game controllers") control panel applet.
@ShellExec = Win32API.new('shell32', 'ShellExecuteA', ['i', 'p', 'p','p','p', 'i'], 'i')
@ShellExec.call(0, "open", "rundll32.exe", "shell32.dll,Control_RunDLL joy.cpl", 0, 1)
If there are routines you'd like... feel free to ask...
-Brycej