2
0

HeadlessApp.cpp 485 B

1234567891011121314151617181920212223242526
  1. #include "HeadlessApp.h"
  2. #include "platform/PlatformHelper.h"
  3. USING_NS_BF;
  4. void HeadlessApp::Init()
  5. {
  6. mRunning = true;
  7. Beefy::String exePath;
  8. BfpGetStrHelper(exePath, [](char* outStr, int* inOutStrSize, BfpResult* result)
  9. {
  10. BfpSystem_GetExecutablePath(outStr, inOutStrSize, (BfpSystemResult*)result);
  11. });
  12. mInstallDir = GetFileDir(exePath) + "/";
  13. }
  14. void HeadlessApp::Run()
  15. {
  16. while (mRunning)
  17. {
  18. BfpThread_Sleep((uint32)(1000 / mRefreshRate));
  19. Process();
  20. }
  21. }