You probably need to specify the "win32" calling convention on the pointer, or else when calling through the function pointer the wrong calling convention is used, and the stack is not cleaned up properly.
Something like that is worth a try, and is very likely to correct your problem:
Something like that is worth a try, and is very likely to correct your problem:
Local wglSwapInterval(interval) "win32" = Byte Ptr(POINTER_wglSwapInterval)