Panda3D
rocketSystemInterface.cxx
1 // Filename: rocketSystemInterface.h
2 // Created by: rdb (03Nov11)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "rocketSystemInterface.h"
16 #include "clockObject.h"
17 
18 ////////////////////////////////////////////////////////////////////
19 // Function: RocketSystemInterface::GetElapsedTime
20 // Access: Public
21 // Description: Get the number of seconds elapsed since the start
22 // of the application.
23 ////////////////////////////////////////////////////////////////////
27  //XXX not sure exactly how Rocket uses uses it, maybe get_frame_time is better?
28  return clock->get_real_time();
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: RocketSystemInterface::LogMessage
33 // Access: Public
34 // Description: Log the specified message. Returns true to
35 // continue execution, false to break into the
36 // debugger.
37 ////////////////////////////////////////////////////////////////////
39 LogMessage(Rocket::Core::Log::Type type, const Rocket::Core::String& message) {
40  switch(type) {
41  case Rocket::Core::Log::LT_ALWAYS:
42  case Rocket::Core::Log::LT_ERROR:
43  case Rocket::Core::Log::LT_ASSERT:
44  rocket_cat->error() << message.CString() << "\n";
45  return true;
46  case Rocket::Core::Log::LT_WARNING:
47  rocket_cat->warning() << message.CString() << "\n";
48  return true;
49  case Rocket::Core::Log::LT_INFO:
50  rocket_cat->info() << message.CString() << "\n";
51  return true;
52  case Rocket::Core::Log::LT_DEBUG:
53  rocket_cat->debug() << message.CString() << "\n";
54  return true;
55  case Rocket::Core::Log::LT_MAX:
56  // Not really sent; just to keep compiler happy
57  break;
58  }
59  return true;
60 }
static ClockObject * get_global_clock()
Returns a pointer to the global ClockObject.
Definition: clockObject.I:271
A ClockObject keeps track of elapsed real time and discrete time.
Definition: clockObject.h:66
double get_real_time() const
Returns the actual number of seconds elapsed since the ClockObject was created, or since it was last ...
Definition: clockObject.I:68
bool LogMessage(Rocket::Core::Log::Type type, const Rocket::Core::String &message)
Log the specified message.
float GetElapsedTime()
Get the number of seconds elapsed since the start of the application.