Panda3D
 All Classes Functions Variables Enumerations
rocketSystemInterface.cxx
00001 // Filename: rocketSystemInterface.h
00002 // Created by:  rdb (03Nov11)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "rocketSystemInterface.h"
00016 #include "clockObject.h"
00017 
00018 ////////////////////////////////////////////////////////////////////
00019 //     Function: RocketSystemInterface::GetElapsedTime
00020 //       Access: Public
00021 //  Description: Get the number of seconds elapsed since the start
00022 //               of the application.
00023 ////////////////////////////////////////////////////////////////////
00024 float RocketSystemInterface::
00025 GetElapsedTime() {
00026   ClockObject *clock = ClockObject::get_global_clock();
00027   //XXX not sure exactly how Rocket uses uses it, maybe get_frame_time is better?
00028   return clock->get_real_time();
00029 }
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //     Function: RocketSystemInterface::LogMessage
00033 //       Access: Public
00034 //  Description: Log the specified message.  Returns true to
00035 //               continue execution, false to break into the
00036 //               debugger.
00037 ////////////////////////////////////////////////////////////////////
00038 bool RocketSystemInterface::
00039 LogMessage(Rocket::Core::Log::Type type, const Rocket::Core::String& message) {
00040   switch(type) {
00041   case Rocket::Core::Log::LT_ALWAYS:
00042   case Rocket::Core::Log::LT_ERROR:
00043   case Rocket::Core::Log::LT_ASSERT:
00044     rocket_cat.error() << message.CString() << "\n";
00045     return true;
00046   case Rocket::Core::Log::LT_WARNING:
00047     rocket_cat.warning() << message.CString() << "\n";
00048     return true;
00049   case Rocket::Core::Log::LT_INFO:
00050     rocket_cat.info() << message.CString() << "\n";
00051     return true;
00052   case Rocket::Core::Log::LT_DEBUG:
00053     rocket_cat.debug() << message.CString() << "\n";
00054   }
00055   return true;
00056 }
 All Classes Functions Variables Enumerations