Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Mar 2002
Offline Last Active Aug 11 2016 12:03 PM

Journal Entries

Journal of Daivuk > async loading and syncing threads with your mainloop in C++11

Posted 10 October 2014

Loading resources or map data asynchronously in games is not an easy task. C++11 makes all of this a lot easier. I am going to demonstrate how to create a thread using async. And then how to sync back to the main loop using lambda functions.

Consider the following code, that is blocking:
void onNewGame(){ // Load the map loadMap("level1-1.map");...