forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrocketRegion.h
More file actions
87 lines (73 loc) · 2.5 KB
/
rocketRegion.h
File metadata and controls
87 lines (73 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file rocketRegion.h
* @author rdb
* @date 2011-11-30
*/
#ifndef ROCKETREGION_H
#define ROCKETREGION_H
#include "config_rocket.h"
#include "displayRegion.h"
#include "rocketRenderInterface.h"
#include "rocketInputHandler.h"
class OrthographicLens;
/**
* Represents a region in a window or buffer where the libRocket UI will be
* rendered to.
*/
class EXPCL_ROCKET RocketRegion : public DisplayRegion {
protected:
RocketRegion(GraphicsOutput *window, const LVecBase4 &dimensions,
const std::string &context_name);
virtual void do_cull(CullHandler *cull_handler, SceneSetup *scene_setup,
GraphicsStateGuardian *gsg, Thread *current_thread);
PUBLISHED:
virtual ~RocketRegion();
INLINE static RocketRegion* make(const std::string &context_name,
GraphicsOutput *window);
INLINE static RocketRegion* make(const std::string &context_name,
GraphicsOutput *window,
const LVecBase4 &dimensions);
#ifndef CPPPARSER
INLINE Rocket::Core::Context* get_context() const;
#endif
#ifdef HAVE_ROCKET_PYTHON
EXTENSION(PyObject *get_context() const);
MAKE_PROPERTY(context, get_context);
#endif
INLINE void set_input_handler(RocketInputHandler *handler);
INLINE RocketInputHandler *get_input_handler() const;
MAKE_PROPERTY(input_handler, get_input_handler, set_input_handler);
bool init_debugger();
void set_debugger_visible(bool visible);
bool is_debugger_visible() const;
MAKE_PROPERTY(debugger_visible, is_debugger_visible, set_debugger_visible);
private:
RocketRenderInterface _interface;
Rocket::Core::Context* _context;
PT(OrthographicLens) _lens;
PT(RocketInputHandler) _input_handler;
public:
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
DisplayRegion::init_type();
register_type(_type_handle, "RocketRegion",
DisplayRegion::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
};
#include "rocketRegion.I"
#endif /* ROCKETREGION_H */