RunFrame() public static method

Synchronize API state with the latest Steam Controller inputs available. This

is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest

possible latency, you call this directly before reading controller state.

public static RunFrame ( ) : void
return void
Exemplo n.º 1
0
        public static void RunCallbacks()
        {
            CallbackMsg_t callbackmsg;
            HSteamPipe    pipe = SteamAPI.GetHSteamPipe();

            while (NativeMethods.Steam_BGetCallback(pipe, out callbackmsg))
            {
                m_LastActivePipe = pipe;

                List <ICallbackBase> callbackList;
                if (m_RegisteredCallbacks.TryGetValue(callbackmsg.m_iCallback, out callbackList))
                {
                    foreach (ICallbackBase callback in callbackList)
                    {
                        callback.Run(callbackmsg.m_pubParam);
                    }
                }

                NativeMethods.Steam_FreeLastCallback(pipe);
            }

            // These need to be called every frame to process matchmaking results and poll the controller
            SteamUtils.RunFrame();
            SteamController.RunFrame();
        }