OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // TickCallback you pass in to SetTickCallback. It will be deleted if you call | 291 // TickCallback you pass in to SetTickCallback. It will be deleted if you call |
292 // SetTickCallback a second time or if you call ClearTickCallback. | 292 // SetTickCallback a second time or if you call ClearTickCallback. |
293 void ClearTickCallback(); | 293 void ClearTickCallback(); |
294 | 294 |
295 // Tick the client. This method is called by the plugin to give the client | 295 // Tick the client. This method is called by the plugin to give the client |
296 // a chance to process NaCl messages and update animation. | 296 // a chance to process NaCl messages and update animation. |
297 // Returns: | 297 // Returns: |
298 // true if message check was ok. | 298 // true if message check was ok. |
299 bool Tick(); | 299 bool Tick(); |
300 | 300 |
| 301 // Indicates whether a call to Tick() is in progress. This is needed |
| 302 // to avoid reentrancy problems on some platforms. |
| 303 bool IsTicking() const { |
| 304 return is_ticking_; |
| 305 } |
| 306 |
301 // Searches in the Client for an object by its id. This function is for | 307 // Searches in the Client for an object by its id. This function is for |
302 // Javascript. | 308 // Javascript. |
303 // Parameters: | 309 // Parameters: |
304 // id: id of object to look for. | 310 // id: id of object to look for. |
305 // Returns: | 311 // Returns: |
306 // Pointer to the object or NULL if not found. | 312 // Pointer to the object or NULL if not found. |
307 ObjectBase* GetObjectById(Id id) const { | 313 ObjectBase* GetObjectById(Id id) const { |
308 return object_manager_->GetObjectById(id); | 314 return object_manager_->GetObjectById(id); |
309 } | 315 } |
310 | 316 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 496 |
491 // Tick Callback. | 497 // Tick Callback. |
492 TickCallbackManager tick_callback_manager_; | 498 TickCallbackManager tick_callback_manager_; |
493 | 499 |
494 // Tick Event to pass to the tick callback. | 500 // Tick Event to pass to the tick callback. |
495 TickEvent tick_event_; | 501 TickEvent tick_event_; |
496 | 502 |
497 // Timer for getting the elapsed time between tick updates. | 503 // Timer for getting the elapsed time between tick updates. |
498 ElapsedTimeTimer tick_elapsed_time_timer_; | 504 ElapsedTimeTimer tick_elapsed_time_timer_; |
499 | 505 |
| 506 // Whether a call to Tick() is currently active. |
| 507 bool is_ticking_; |
| 508 |
500 // Used to gather render time from mulitple RenderTree calls. | 509 // Used to gather render time from mulitple RenderTree calls. |
501 float total_time_to_render_; | 510 float total_time_to_render_; |
502 | 511 |
503 // Time used for tick and message processing. | 512 // Time used for tick and message processing. |
504 float last_tick_time_; | 513 float last_tick_time_; |
505 | 514 |
506 // Reference to global transform graph root for Client. | 515 // Reference to global transform graph root for Client. |
507 Transform::Ref root_; | 516 Transform::Ref root_; |
508 | 517 |
509 // Global Render Graph root for Client. | 518 // Global Render Graph root for Client. |
510 RenderNode::Ref rendergraph_root_; | 519 RenderNode::Ref rendergraph_root_; |
511 | 520 |
512 ParamObject::Ref sas_param_object_; | 521 ParamObject::Ref sas_param_object_; |
513 | 522 |
514 // The id of the client. | 523 // The id of the client. |
515 Id id_; | 524 Id id_; |
516 | 525 |
517 int calls_; // Used to check reentrancy along with ScopedIncrement. | 526 int calls_; // Used to check reentrancy along with ScopedIncrement. |
518 | 527 |
519 RenderSurface::Ref offscreen_render_surface_; | 528 RenderSurface::Ref offscreen_render_surface_; |
520 RenderDepthStencilSurface::Ref offscreen_depth_render_surface_; | 529 RenderDepthStencilSurface::Ref offscreen_depth_render_surface_; |
521 | 530 |
522 DISALLOW_COPY_AND_ASSIGN(Client); | 531 DISALLOW_COPY_AND_ASSIGN(Client); |
523 }; // Client | 532 }; // Client |
524 | 533 |
525 } // namespace o3d | 534 } // namespace o3d |
526 | 535 |
527 #endif // O3D_CORE_CROSS_CLIENT_H_ | 536 #endif // O3D_CORE_CROSS_CLIENT_H_ |
OLD | NEW |