[RESOLVED] How to read the frame rate using simconnect?

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

[RESOLVED] How to read the frame rate using simconnect?

Post by ppp333ddd_ »

Hi,
Does SimConnect provide a var for users to read the frame rate of P3D? In var list I cannot find it. I only found a structure

Code: Select all

struct SIMCONNECT_RECV_EVENT_FRAME : public SIMCONNECT_RECV_EVENT {
  float  fFrameRate;
  float  fSimSpeed;
};
So I tried to read SIMCONNECT_RECV_EVENT_FRAME.fFrameRate as other variables which are listed in the variable table but failed. I did not find any working examples for similar situations. Thanks for any help.

Jeff
adiemus
Posts: 120
Joined: Fri Mar 16, 2012 4:19 am
Contact:

Re: How to read the frame rate using simconnect?

Post by adiemus »

Works fine here in P3D v4, going all the way back to FSX.

That structure is returned by the "Frame" event you can subscribe to via SimConnect_SubscribeToSystemEvent(). This will call your SimConnect callback with RECV_ID set to SIMCONNECT_RECV_ID_EVENT_FRAME, which in turn carries a populated SIMCONNECT_RECV_EVENT_FRAME structure that you can read the actual data from.
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

Re: How to read the frame rate using simconnect?

Post by ppp333ddd_ »

Hi adiemus,

Thanks. And I also found an SDK example called Managed System Event which is very helpful.

Jeff
Locked