Dear all,
I've been having a problem with the sim frame rate slowly decreasing over the course of 45 mins or so and have been trying to figure it out.
Visual Studio says the CPU is executing external code and using trial and error (and disabling bits until it works properly) I've found that it's something to do with simconnect.
Everything seems to work as normal, all I can see is that when I receive data (in the SIMCONNECT_RECV_SIMOBJECT_DATA struct) the dwDefineCount is always increasing. I know the SDK isn't always quite as complete and accurate as we would like but I was fairly confident that this was just saying how many 8 byte elements are in the array. The data I'm expecting to receive seems fine, everything runs as expected, it's just that, over time, the sim gets bogged down, I'm guessing by transmitting ever increasing amounts of data.
I'm expecting about 50 odd variables (all FLOAT64) but the dwDefineCount keeps increasing, at about 215000, the frame rate is down to about 10.
I want to check I'm not being a numpty, is there some 'release' or 'free' command that I should be using after I've received the data, at the moment I just memcpy it to the local structure and carry on.
I've checked I'm not repeatedly calling SimConnect_AddToDataDefinition and I'm not, just the once to set it up.
Data added to the definition with:
SimConnect_AddToDataDefinition(hSc, DEF_FSX_SIM_DATA, "GENERAL ENG MIXTURE LEVER POSITION:1", "percent");
Obviously there's lots of them but they all look like the above.
The data request is called once:
SimConnect_RequestDataOnSimObject(hSc, REQ_FSX_SIM_DATA, DEF_FSX_SIM_DATA, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_SIM_FRAME);
When received, the data is copied with:
memcpy(&sc_fsx_sim_data, (_SIMCONNECT_FSX_SIM_DATA*)&pObjd->dwData, sizeof(_SIMCONNECT_FSX_SIM_DATA));
The data received is all correct, I don't really know what it's padding it with, does anyone know why it's doing this and how I can stop it?
Many thanks,
Ian
I've been having a problem with the sim frame rate slowly decreasing over the course of 45 mins or so and have been trying to figure it out.
Visual Studio says the CPU is executing external code and using trial and error (and disabling bits until it works properly) I've found that it's something to do with simconnect.
Everything seems to work as normal, all I can see is that when I receive data (in the SIMCONNECT_RECV_SIMOBJECT_DATA struct) the dwDefineCount is always increasing. I know the SDK isn't always quite as complete and accurate as we would like but I was fairly confident that this was just saying how many 8 byte elements are in the array. The data I'm expecting to receive seems fine, everything runs as expected, it's just that, over time, the sim gets bogged down, I'm guessing by transmitting ever increasing amounts of data.
I'm expecting about 50 odd variables (all FLOAT64) but the dwDefineCount keeps increasing, at about 215000, the frame rate is down to about 10.
I want to check I'm not being a numpty, is there some 'release' or 'free' command that I should be using after I've received the data, at the moment I just memcpy it to the local structure and carry on.
I've checked I'm not repeatedly calling SimConnect_AddToDataDefinition and I'm not, just the once to set it up.
Data added to the definition with:
SimConnect_AddToDataDefinition(hSc, DEF_FSX_SIM_DATA, "GENERAL ENG MIXTURE LEVER POSITION:1", "percent");
Obviously there's lots of them but they all look like the above.
The data request is called once:
SimConnect_RequestDataOnSimObject(hSc, REQ_FSX_SIM_DATA, DEF_FSX_SIM_DATA, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_SIM_FRAME);
When received, the data is copied with:
memcpy(&sc_fsx_sim_data, (_SIMCONNECT_FSX_SIM_DATA*)&pObjd->dwData, sizeof(_SIMCONNECT_FSX_SIM_DATA));
The data received is all correct, I don't really know what it's padding it with, does anyone know why it's doing this and how I can stop it?
Many thanks,
Ian