Panda3D

config_rocket.cxx

00001 // Filename: config_rocket.cxx
00002 // Created by:  rdb (04Nov11)
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 "config_rocket.h"
00016 #include "rocketFileInterface.h"
00017 #include "rocketInputHandler.h"
00018 #include "rocketRegion.h"
00019 #include "rocketSystemInterface.h"
00020 
00021 #include "pandaSystem.h"
00022 #include "dconfig.h"
00023 
00024 #include <Rocket/Core.h>
00025 
00026 Configure(config_rocket);
00027 NotifyCategoryDef(rocket, "");
00028 
00029 ConfigureFn(config_rocket) {
00030   init_librocket();
00031 }
00032 
00033 ////////////////////////////////////////////////////////////////////
00034 //     Function: init_librocket
00035 //  Description: Initializes the library.  This must be called at
00036 //               least once before any of the functions or classes in
00037 //               this library can be used.  Normally it will be
00038 //               called by the static initializers and need not be
00039 //               called explicitly, but special cases exist.
00040 ////////////////////////////////////////////////////////////////////
00041 void
00042 init_librocket() {
00043   static bool initialized = false;
00044   if (initialized) {
00045     return;
00046   }
00047   initialized = true;
00048 
00049   RocketInputHandler::init_type();
00050   RocketRegion::init_type();
00051 
00052   RocketFileInterface* fi = new RocketFileInterface;
00053   Rocket::Core::SetFileInterface(fi);
00054 
00055   RocketSystemInterface* si = new RocketSystemInterface;
00056   Rocket::Core::SetSystemInterface(si);
00057 
00058   Rocket::Core::Initialise();
00059 }
 All Classes Functions Variables Enumerations