Panda3D

Loading...
Searching...
No Matches
rocketRegion.h
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.h
10 * @author rdb
11 * @date 2011-11-30
12 */
13
14#ifndef ROCKETREGION_H
15#define ROCKETREGION_H
16
17#include "config_rocket.h"
18#include "displayRegion.h"
19#include "rocketRenderInterface.h"
20#include "rocketInputHandler.h"
21
22 class OrthographicLens;
23
24/**
25 * Represents a region in a window or buffer where the libRocket UI will be
26 * rendered to.
27 */
28 class EXPCL_ROCKET RocketRegion : public DisplayRegion {
29 protected:
30 RocketRegion(GraphicsOutput *window, const LVecBase4 &dimensions,
31 const std::string &context_name);
32
33 virtual void do_cull(CullHandler *cull_handler, SceneSetup *scene_setup,
34 GraphicsStateGuardian *gsg, Thread *current_thread);
35
36PUBLISHED:
37 virtual ~RocketRegion();
38
39 INLINE static RocketRegion* make(const std::string &context_name,
40 GraphicsOutput *window);
41 INLINE static RocketRegion* make(const std::string &context_name,
42 GraphicsOutput *window,
43 const LVecBase4 &dimensions);
44#ifndef CPPPARSER
45 INLINE Rocket::Core::Context* get_context() const;
46#endif
47#ifdef HAVE_ROCKET_PYTHON
48 EXTENSION(PyObject *get_context() const);
49 MAKE_PROPERTY(context, get_context);
50#endif
51
52 INLINE void set_input_handler(RocketInputHandler *handler);
53 INLINE RocketInputHandler *get_input_handler() const;
54 MAKE_PROPERTY(input_handler, get_input_handler, set_input_handler);
55
56 bool init_debugger();
57 void set_debugger_visible(bool visible);
58 bool is_debugger_visible() const;
59 MAKE_PROPERTY(debugger_visible, is_debugger_visible, set_debugger_visible);
60
61 private:
62 RocketRenderInterface _interface;
63 Rocket::Core::Context* _context;
64 PT(OrthographicLens) _lens;
65 PT(RocketInputHandler) _input_handler;
66
67 public:
68 static TypeHandle get_class_type() {
69 return _type_handle;
70 }
71 static void init_type() {
72 DisplayRegion::init_type();
73 register_type(_type_handle, "RocketRegion",
74 DisplayRegion::get_class_type());
75 }
76 virtual TypeHandle get_type() const {
77 return get_class_type();
78 }
79 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
80
81 private:
82 static TypeHandle _type_handle;
83};
84
85#include "rocketRegion.I"
86
87#endif /* ROCKETREGION_H */
CullHandler
This defines the abstract interface for an object that receives Geoms identified by the CullTraverser...
Definition cullHandler.h:28
GraphicsStateGuardian
Encapsulates all the communication with a particular instance of a given rendering backend.
Definition graphicsStateGuardian.h:65
OrthographicLens
An orthographic lens.
Definition orthographicLens.h:30
RocketInputHandler
DataNode that listens for keyboard and mouse events and passes them to libRocket.
Definition rocketInputHandler.h:31
RocketRegion::get_context
Rocket::Core::Context * get_context() const
Returns a pointer to the Rocket context associated with this region.
Definition rocketRegion.I:45
RocketRegion::get_input_handler
get_input_handler
Returns the RocketInputHandler object previously passed to set_input_handler.
Definition rocketRegion.h:54
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::is_debugger_visible
is_debugger_visible
Returns true if the debugger is visible.
Definition rocketRegion.h:59
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
RocketRegion::init_debugger
bool init_debugger()
Initializes the libRocket debugger.
Definition rocketRegion.cxx:150
RocketRegion::set_debugger_visible
set_debugger_visible
Sets whether the debugger should be visible.
Definition rocketRegion.h:59
RocketRenderInterface
Class that provides the main render interface for libRocket integration.
Definition rocketRenderInterface.h:29
SceneSetup
This object holds the camera position, etc., and other general setup information for rendering a part...
Definition sceneSetup.h:32
Thread
A thread; that is, a lightweight process.
Definition thread.h:46
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
config_rocket.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
displayRegion.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition register_type.I:22
rocketInputHandler.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
rocketRegion.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
rocketRenderInterface.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.