RugnirViking

Untitled

May 3rd, 2020
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. ///// RENDERING THREAD
  2.  
  3. void V4Core::LoadingThread()
  4. {
  5. sf::Context context;
  6. window.setActive(true);
  7. while (continueLoading)
  8. {
  9. window.clear();
  10. // drawing some text
  11. t_version.setPosition(config.GetInt("resX")/2,config.GetInt("resY")/2);
  12. window.draw(t_version);
  13.  
  14. window.display();
  15. }
  16.  
  17. window.setActive(false);
  18. }
  19.  
  20. ///// CALLING THE THREAD (from a different class)
  21.  
  22. sf::Thread loadingThreadInstance(v4core->LoadingThread,v4core);
  23. v4core->continueLoading=true;
  24. v4core->window.setActive(false);
  25. loadingThreadInstance.launch();
  26.  
  27. // Some code that takes some time
  28.  
  29. v4core->continueLoading=false;
Advertisement
Add Comment
Please, Sign In to add comment