Advertisement
Guest User

Untitled

a guest
Jun 21st, 2012
66
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     NodePath box = window->load_model(render, "box");
  2.     PT(Loader) loader = new Loader("My Async Loader");
  3.     LoaderOptions options;
  4.     PT(ModelLoadRequest) request = new ModelLoadRequest("MyPandaModel", "diaEnoite", options, loader);
  5.     loader->load_async(request);
  6.  
  7.     /* Until here is all instantly */
  8.     bool loaded = false;
  9.     NodePath my_model;
  10.     while(!loaded){
  11.         nout << "Before do_frame" << endl;
  12.         /* Placeholder loader screen */
  13.         box.set_x(box, 2 * ClockObject::get_global_clock()->get_dt());
  14.  
  15.         /* Issue the poll */
  16.         framework.do_frame(current_thread);
  17.         nout << "After do frame" << endl;
  18.  
  19.         if(request->is_ready()){
  20.             my_model = NodePath(request->get_model());
  21.             my_model.reparent_to(render);
  22.             loaded = true;
  23.         }
  24.     }
  25.  
  26.     framework.main_loop();
Advertisement
RAW Paste Data Copied
Advertisement