Panda3D
 All Classes Functions Variables Enumerations
rocketRegion.h
1 // Filename: rocketRegion.h
2 // Created by: rdb (30Nov11)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef ROCKETREGION_H
16 #define ROCKETREGION_H
17 
18 #include "config_rocket.h"
19 #include "displayRegion.h"
20 #include "rocketRenderInterface.h"
21 #include "rocketInputHandler.h"
22 
23 class OrthographicLens;
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : RocketRegion
27 // Description : Represents a region in a window or buffer where
28 // the libRocket UI will be rendered to.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_ROCKET RocketRegion : public DisplayRegion {
31 protected:
32  RocketRegion(GraphicsOutput *window, const LVecBase4 &dimensions,
33  const string &context_name);
34 
35  virtual void do_cull(CullHandler *cull_handler, SceneSetup *scene_setup,
36  GraphicsStateGuardian *gsg, Thread *current_thread);
37 
38 PUBLISHED:
39  virtual ~RocketRegion();
40 
41  INLINE static RocketRegion* make(const string &context_name,
42  GraphicsOutput *window);
43  INLINE static RocketRegion* make(const string &context_name,
44  GraphicsOutput *window,
45  const LVecBase4 &dimensions);
46 #ifndef CPPPARSER
47  INLINE Rocket::Core::Context* get_context() const;
48 #endif
49 #ifdef HAVE_ROCKET_PYTHON
50  EXTENSION(PyObject *get_context() const);
51 #endif
52 
53  INLINE void set_input_handler(RocketInputHandler *handler);
54  INLINE RocketInputHandler *get_input_handler() const;
55 
56  bool init_debugger();
57  void set_debugger_visible(bool visible);
58  bool is_debugger_visible() const;
59 
60 private:
61  RocketRenderInterface _interface;
62  Rocket::Core::Context* _context;
63  PT(OrthographicLens) _lens;
64  PT(RocketInputHandler) _input_handler;
65 
66 public:
67  static TypeHandle get_class_type() {
68  return _type_handle;
69  }
70  static void init_type() {
71  DisplayRegion::init_type();
72  register_type(_type_handle, "RocketRegion",
73  DisplayRegion::get_class_type());
74  }
75  virtual TypeHandle get_type() const {
76  return get_class_type();
77  }
78  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
79 
80 private:
81  static TypeHandle _type_handle;
82 };
83 
84 #include "rocketRegion.I"
85 
86 #endif /* ROCKETREGION_H */
Represents a region in a window or buffer where the libRocket UI will be rendered to...
Definition: rocketRegion.h:30
This defines the abstract interface for an object that receives Geoms identified by the CullTraverser...
Definition: cullHandler.h:31
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. ...
An orthographic lens.
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
A thread; that is, a lightweight process.
Definition: thread.h:51
Encapsulates all the communication with a particular instance of a given rendering backend...
A rectangular subregion within a window for rendering into.
Definition: displayRegion.h:61
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
Class that provides the main render interface for libRocket integration.
This object holds the camera position, etc., and other general setup information for rendering a part...
Definition: sceneSetup.h:35