Panda3D
panda
src
rocket
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
*/
20
INLINE
RocketRegion
*
RocketRegion::
21
make
(
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
*/
30
INLINE
RocketRegion
*
RocketRegion::
31
make
(
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
*/
44
Rocket::Core::Context*
RocketRegion::
45
get_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
*/
56
INLINE
void
RocketRegion::
57
set_input_handler
(
RocketInputHandler
*handler) {
58
_input_handler = handler;
59
}
60
61
/**
62
* Returns the RocketInputHandler object previously passed to
63
* set_input_handler.
64
*/
65
INLINE
RocketInputHandler
*
RocketRegion::
66
get_input_handler
()
const
{
67
return
_input_handler;
68
}
RocketRegion::set_input_handler
set_input_handler
Sets the RocketInputHandler object from which to gather the keyboard and mouse inputs to pass to the ...
Definition:
rocketRegion.h:54
RocketRegion::get_input_handler
get_input_handler
Returns the RocketInputHandler object previously passed to set_input_handler.
Definition:
rocketRegion.h:54
RocketRegion::get_context
Rocket::Core::Context * get_context() const
Returns a pointer to the Rocket context associated with this region.
Definition:
rocketRegion.I:45
GraphicsOutput
This is a base class for the various different classes that represent the result of a frame of render...
Definition:
graphicsOutput.h:63
RocketInputHandler
DataNode that listens for keyboard and mouse events and passes them to libRocket.
Definition:
rocketInputHandler.h:31
RocketRegion
Represents a region in a window or buffer where the libRocket UI will be rendered to.
Definition:
rocketRegion.h:28
RocketRegion::make
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.
Definition:
rocketRegion.I:21
Generated on Sun Dec 27 2020 13:23:16 for Panda3D by
1.8.20