Panda3D
Loading...
Searching...
No Matches
rocketRegion.I
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 rocketRegion.I
10 * @author rdb
11 * @date 2011-12-01
12 */
13
14/**
15 * Creates a libRocket context with the given name (must be unique) for the
16 * given window. Returns a new DisplayRegion where the libRocket context will
17 * render to. This variant of make() creates a region that fills the entire
18 * window.
19 */
21make(const std::string &context_name, GraphicsOutput *window) {
22 return make(context_name, window, LVecBase4(0.0f, 1.0f, 0.0f, 1.0f));
23}
24
25/**
26 * Creates a libRocket context with the given name (must be unique) for the
27 * given window. Returns a new DisplayRegion where the libRocket context will
28 * render to.
29 */
31make(const std::string &context_name, GraphicsOutput *window,
32 const LVecBase4 &dimensions) {
33
34 return new RocketRegion(window, dimensions, context_name);
35}
36
37#ifndef CPPPARSER
38/**
39 * Returns a pointer to the Rocket context associated with this region. Does
40 * not increase the reference count, so if you want to preserve it for longer
41 * than this region exists, be sure to call AddReference() and
42 * RemoveReference() yourself.
43 */
44Rocket::Core::Context* RocketRegion::
45get_context() const {
46 return _context;
47}
48#endif
49
50/**
51 * Sets the RocketInputHandler object from which to gather the keyboard and
52 * mouse inputs to pass to the libRocket context before rendering. You may
53 * use one input handler to provide inputs to any number of RocketRegion
54 * objects.
55 */
56INLINE void RocketRegion::
58 _input_handler = handler;
59}
60
61/**
62 * Returns the RocketInputHandler object previously passed to
63 * set_input_handler.
64 */
66get_input_handler() const {
67 return _input_handler;
68}
This is a base class for the various different classes that represent the result of a frame of render...
DataNode that listens for keyboard and mouse events and passes them to libRocket.
Represents a region in a window or buffer where the libRocket UI will be rendered to.
Rocket::Core::Context * get_context() const
Returns a pointer to the Rocket context associated with this region.
get_input_handler
Returns the RocketInputHandler object previously passed to set_input_handler.
set_input_handler
Sets the RocketInputHandler object from which to gather the keyboard and mouse inputs to pass to the ...
static RocketRegion * make(const std::string &context_name, GraphicsOutput *window)
Creates a libRocket context with the given name (must be unique) for the given window.