Skip to main content
BParh.1
Senior III
September 14, 2021
Question

How to modify frame per rate (fps) speed in simulator?

  • September 14, 2021
  • 4 replies
  • 1118 views

I want to experiment different fps speed in simulator of TouchGFXDesigner, where is location to modify the code?

This topic has been closed for replies.

4 replies

Romain DIELEMAN
ST Employee
September 14, 2021

Hi,

I have not tried it but I think you could change the value of the VsyncInterval() in mainBase.cpp in the TouchGFX/generated/simulator/src folder.

/Romain

Romain DIELEMAN
ST Employee
September 14, 2021

So instead of the initial value of 16.6667ms (corresponding to a frequency of 60Hz) you could put 33.3334ms for 30Hz

BParh.1
BParh.1Author
Senior III
September 16, 2021

Thank you @Romain DIELEMAN​ , it works! However the file mainBase.cpp is meant for read only, and would override next time I generate code. Is there any place where it would not be overridden? I want the change committed to repository as well.

Romain DIELEMAN
ST Employee
September 16, 2021

What you could maybe do is modify the main.cpp in the TouchGFX/simulator folder. The VsyncInterval function I told you to modify is part of the setupSimulator function which is found in the generated folder like you said and will be overwritten. But this function is called that the main.cpp which can be modified.

So instead of calling setupSimulator(), just copy the content/code of that function from mainBase.cpp to the main.cpp so that you can modify it without being overwritten at every code generation.

/Romain