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