Panda3D

rocketRegion.I

00001 // Filename: rocketRegion.I
00002 // Created by:  rdb (01Dec11)
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 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: RocketRegion::make
00018 //       Access: Published, Static
00019 //  Description: Creates a libRocket context with the given name
00020 //               (must be unique) for the given window.  Returns
00021 //               a new DisplayRegion where the libRocket context
00022 //               will render to.
00023 //               This variant of make() creates a region that
00024 //               fills the entire window.
00025 ////////////////////////////////////////////////////////////////////
00026 INLINE RocketRegion *RocketRegion::
00027 make(const string &context_name, GraphicsOutput *window) {
00028   return make(context_name, window, LVecBase4(0.0f, 1.0f, 0.0f, 1.0f));
00029 }
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //     Function: RocketRegion::make
00033 //       Access: Published, Static
00034 //  Description: Creates a libRocket context with the given name
00035 //               (must be unique) for the given window.  Returns
00036 //               a new DisplayRegion where the libRocket context   
00037 //               will render to.
00038 ////////////////////////////////////////////////////////////////////
00039 INLINE RocketRegion *RocketRegion::
00040 make(const string &context_name, GraphicsOutput *window,
00041      const LVecBase4 &dimensions) {
00042 
00043   return new RocketRegion(window, dimensions, context_name);
00044 }
00045 
00046 #ifndef CPPPARSER
00047 ////////////////////////////////////////////////////////////////////
00048 //     Function: RocketRegion::get_context
00049 //       Access: Published
00050 //  Description: Returns a pointer to the Rocket context associated
00051 //               with this region.  Does not increase the reference
00052 //               count, so if you want to preserve it for longer
00053 //               than this region exists, be sure to call
00054 //               AddReference() and RemoveReference() yourself.
00055 ////////////////////////////////////////////////////////////////////
00056 Rocket::Core::Context* RocketRegion::
00057 get_context() const {
00058   return _context;
00059 }
00060 #endif
00061 
00062 ////////////////////////////////////////////////////////////////////
00063 //     Function: RocketRegion::set_input_handler
00064 //       Access: Published
00065 //  Description: Sets the RocketInputHandler object from which to
00066 //               gather the keyboard and mouse inputs to pass to
00067 //               the libRocket context before rendering.
00068 //               You may use one input handler to provide inputs to
00069 //               any number of RocketRegion objects.
00070 ////////////////////////////////////////////////////////////////////
00071 INLINE void RocketRegion::
00072 set_input_handler(RocketInputHandler *handler) {
00073   _input_handler = handler;
00074 }
00075 
00076 ////////////////////////////////////////////////////////////////////
00077 //     Function: RocketRegion::get_input_handler
00078 //       Access: Published
00079 //  Description: Returns the RocketInputHandler object previously
00080 //               passed to set_input_handler.
00081 ////////////////////////////////////////////////////////////////////
00082 INLINE RocketInputHandler *RocketRegion::
00083 get_input_handler() const {
00084   return _input_handler;
00085 }
 All Classes Functions Variables Enumerations