First pass adding properties to many Panda classes

This commit is contained in:
rdb 2015-12-10 16:04:00 +01:00
parent 735bdaf924
commit 6480e82e3b
53 changed files with 357 additions and 27 deletions

View File

@ -140,6 +140,9 @@ PUBLISHED:
INLINE static TypeHandle none();
INLINE operator bool () const;
MAKE_PROPERTY(index, get_index);
MAKE_PROPERTY(name, get_name);
public:
INLINE static TypeHandle from_index(int index);

View File

@ -108,6 +108,7 @@ PUBLISHED:
// Derived classes should override this function to return
// get_class_type().
virtual TypeHandle get_type() const=0;
MAKE_PROPERTY(type, get_type);
INLINE int get_type_index() const;
INLINE bool is_of_type(TypeHandle handle) const;

View File

@ -46,12 +46,15 @@ PUBLISHED:
INLINE void set_pattern(const string &pattern);
INLINE const string &get_pattern() const;
MAKE_PROPERTY(pattern, get_pattern, set_pattern);
INLINE void set_case_sensitive(bool case_sensitive);
INLINE bool get_case_sensitive() const;
MAKE_PROPERTY(case_sensitive, get_case_sensitive, set_case_sensitive);
INLINE void set_nomatch_chars(const string &nomatch_chars);
INLINE const string &get_nomatch_chars() const;
MAKE_PROPERTY(nomatch_chars, get_nomatch_chars, set_nomatch_chars);
INLINE bool matches(const string &candidate) const;

View File

@ -2634,7 +2634,7 @@ write_module_class(ostream &out, Object *obj) {
++num_getset;
string name1 = methodNameFromCppName(ielem.get_name(), "", false);
string name2 = methodNameFromCppName(ielem.get_name(), "", true);
//string name2 = methodNameFromCppName(ielem.get_name(), "", true);
string getter = "&Dtool_" + ClassName + "_" + ielem.get_name() + "_Getter";
string setter = "NULL";
@ -2655,13 +2655,13 @@ write_module_class(ostream &out, Object *obj) {
// Extra void* argument; we don't make use of it.
out << "NULL},\n";
if (name1 != name2 && name1 != "__dict__") {
/*if (name1 != name2 && name1 != "__dict__") {
// Add alternative spelling.
out << " {(char *)\"" << name2 << "\", " << getter << ", " << setter
<< ", (char *)\n"
<< " \"Alias of " << name1 << ", for consistency with old naming conventions.\",\n"
<< " NULL},\n";
}
}*/
}
out << " {NULL},\n";
@ -3464,7 +3464,7 @@ write_function_for_name(ostream &out, Object *obj,
max_required_args = collapse_default_remaps(map_sets, max_required_args);
}
if (map_sets.size() > 1) {
if (map_sets.size() > 1 && (args_type == AT_varargs || args_type == AT_keyword_args)) {
switch (args_type) {
case AT_keyword_args:
indent(out, 2) << "int parameter_count = (int)PyTuple_Size(args);\n";

View File

@ -1905,7 +1905,14 @@ get_function(CPPInstance *function, string description,
// database.
////////////////////////////////////////////////////////////////////
ElementIndex InterrogateBuilder::
get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) {
get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CPPScope *scope) {
// This is needed so we can get a proper unique name for the property.
if (make_property->_ident->_native_scope != scope) {
make_property = new CPPMakeProperty(*make_property);
make_property->_ident = new CPPIdentifier(*make_property->_ident);
make_property->_ident->_native_scope = scope;
}
string property_name = make_property->get_local_name(&parser);
// First, check to see if it's already there.
@ -1927,7 +1934,7 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) {
CPPInstance *function = (*fi);
CPPFunctionType *ftype =
function->_type->as_function_type();
if (ftype != NULL && ftype->_parameters->_parameters.size() == 0) {
if (ftype != NULL/* && ftype->_parameters->_parameters.size() == 0*/) {
getter = function;
return_type = ftype->_return_type;
@ -1957,6 +1964,9 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) {
if (return_type != NULL) {
iproperty._type = get_type(return_type, false);
//if (iproperty._type == 0) {
// parser.warning("cannot determine property type", make_property->_ident->_loc);
//}
} else {
iproperty._type = 0;
}
@ -2609,7 +2619,7 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype,
}
} else if ((*di)->get_subtype() == CPPDeclaration::ST_make_property) {
ElementIndex element_index = get_make_property((*di)->as_make_property(), cpptype);
ElementIndex element_index = get_make_property((*di)->as_make_property(), cpptype, scope);
itype._elements.push_back(element_index);
} else if ((*di)->get_subtype() == CPPDeclaration::ST_make_seq) {

View File

@ -113,7 +113,7 @@ public:
int flags, const string &expression = string());
ElementIndex
get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type);
get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CPPScope *scope);
MakeSeqIndex
get_make_seq(CPPMakeSeq *make_seq, CPPStructType *struct_type);

View File

@ -45,6 +45,8 @@ public:
PUBLISHED:
INLINE ConfigPage *get_page() const;
INLINE ConfigVariableCore *get_variable() const;
MAKE_PROPERTY(page, get_page);
MAKE_PROPERTY(variable, get_variable);
INLINE const string &get_string_value() const;
INLINE void set_string_value(const string &value);

View File

@ -43,17 +43,22 @@ PUBLISHED:
static ConfigPage *get_local_page();
INLINE const string &get_name() const;
MAKE_PROPERTY(name, get_name);
INLINE bool is_special() const;
INLINE bool is_implicit() const;
void set_sort(int sort);
INLINE int get_sort() const;
MAKE_PROPERTY(sort, get_sort, set_sort);
INLINE int get_page_seq() const;
INLINE int get_trust_level() const;
INLINE void set_trust_level(int trust_level);
INLINE const string &get_signature() const;
MAKE_PROPERTY(page_seq, get_page_seq);
MAKE_PROPERTY(trust_level, get_trust_level, set_trust_level);
MAKE_PROPERTY(signature, get_signature);
void clear();
bool read_prc(istream &in);

View File

@ -42,14 +42,15 @@ PUBLISHED:
INLINE ConfigVariable(const string &name);
INLINE ~ConfigVariable();
INLINE const ConfigDeclaration *get_default_value() const;
INLINE const string &get_string_value() const;
INLINE void set_string_value(const string &value);
INLINE void clear_value();
INLINE size_t get_num_words() const;
protected:
INLINE const ConfigDeclaration *get_default_value() const;
INLINE bool has_string_word(size_t n) const;
INLINE bool has_bool_word(size_t n) const;
INLINE bool has_int_word(size_t n) const;

View File

@ -62,10 +62,17 @@ PUBLISHED:
INLINE int get_trust_level() const;
INLINE bool is_dynamic() const;
MAKE_PROPERTY(name, get_name);
MAKE_PROPERTY(value_type, get_value_type);
MAKE_PROPERTY(description, get_description);
MAKE_PROPERTY(closed, is_closed);
MAKE_PROPERTY(trust_level, get_trust_level);
MAKE_PROPERTY(dynamic, is_dynamic);
INLINE bool clear_local_value();
INLINE bool has_local_value() const;
INLINE bool has_value() const;
INLINE void output(ostream &out) const;
INLINE void write(ostream &out) const;

View File

@ -40,6 +40,8 @@ PUBLISHED:
INLINE void set_value(bool value);
INLINE bool get_value() const;
INLINE bool get_default_value() const;
MAKE_PROPERTY(value, get_value, set_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE bool get_word(size_t n) const;
INLINE void set_word(size_t n, bool value);

View File

@ -42,6 +42,8 @@ PUBLISHED:
INLINE void set_value(double value);
INLINE double get_value() const;
INLINE double get_default_value() const;
MAKE_PROPERTY(value, get_value, set_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE double get_word(size_t n) const;
INLINE void set_word(size_t n, double value);

View File

@ -51,6 +51,8 @@ public:
INLINE void set_value(EnumType value);
INLINE EnumType get_value() const;
INLINE EnumType get_default_value() const;
MAKE_PROPERTY(value, get_value, set_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE EnumType get_word(size_t n) const;
INLINE void set_word(size_t n, EnumType value);

View File

@ -58,6 +58,8 @@ PUBLISHED:
INLINE void set_value(const Filename &value);
INLINE Filename get_value() const;
INLINE Filename get_default_value() const;
MAKE_PROPERTY(value, get_value, set_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE Filename get_word(size_t n) const;
INLINE void set_word(size_t n, const Filename &value);

View File

@ -42,6 +42,8 @@ PUBLISHED:
INLINE void set_value(int value);
INLINE int get_value() const;
INLINE int get_default_value() const;
MAKE_PROPERTY(value, get_value, set_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE int get_word(size_t n) const;
INLINE void set_word(size_t n, int value);

View File

@ -43,6 +43,8 @@ PUBLISHED:
INLINE void set_value(PN_int64 value);
INLINE PN_int64 get_value() const;
INLINE PN_int64 get_default_value() const;
MAKE_PROPERTY(value, get_value, set_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE PN_int64 get_word(size_t n) const;
INLINE void set_word(size_t n, PN_int64 value);

View File

@ -57,6 +57,8 @@ PUBLISHED:
INLINE operator const DSearchPath & () const;
INLINE const DSearchPath &get_value() const;
INLINE const DSearchPath &get_default_value() const;
MAKE_PROPERTY(value, get_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE bool clear_local_value();

View File

@ -47,6 +47,8 @@ PUBLISHED:
INLINE void set_value(const string &value);
INLINE const string &get_value() const;
INLINE string get_default_value() const;
MAKE_PROPERTY(value, get_value, set_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE string get_word(size_t n) const;
INLINE void set_word(size_t n, const string &value);

View File

@ -43,6 +43,9 @@ PUBLISHED:
INLINE string get_basename() const;
INLINE NotifySeverity get_severity() const;
INLINE void set_severity(NotifySeverity severity);
MAKE_PROPERTY(fullname, get_fullname);
MAKE_PROPERTY(basename, get_basename);
MAKE_PROPERTY(severity, get_severity, set_severity);
INLINE bool is_on(NotifySeverity severity) const;

View File

@ -58,6 +58,11 @@ PUBLISHED:
INLINE CollideMask get_from_collide_mask() const;
INLINE CollideMask get_into_collide_mask() const;
MAKE_PROPERTY(from_collide_mask, get_from_collide_mask,
set_from_collide_mask);
MAKE_PROPERTY(into_collide_mask, get_into_collide_mask,
set_into_collide_mask);
INLINE void clear_solids();
INLINE int get_num_solids() const;
INLINE CPT(CollisionSolid) get_solid(int n) const;
@ -69,6 +74,7 @@ PUBLISHED:
INLINE int get_collider_sort() const;
INLINE void set_collider_sort(int sort);
MAKE_PROPERTY(collider_sort, get_collider_sort, set_collider_sort);
INLINE static CollideMask get_default_collide_mask();

View File

@ -52,10 +52,12 @@ PUBLISHED:
INLINE void set_origin(const LPoint3 &origin);
INLINE void set_origin(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
INLINE const LPoint3 &get_origin() const;
MAKE_PROPERTY(origin, get_origin, set_origin);
INLINE void set_direction(const LVector3 &direction);
INLINE void set_direction(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
INLINE const LVector3 &get_direction() const;
MAKE_PROPERTY(direction, get_direction, set_direction);
bool set_from_lens(LensNode *camera, const LPoint2 &point);
INLINE bool set_from_lens(LensNode *camera, PN_stdfloat px, PN_stdfloat py);

View File

@ -59,9 +59,11 @@ protected:
PUBLISHED:
virtual LPoint3 get_collision_origin() const=0;
MAKE_PROPERTY(collision_origin, get_collision_origin);
INLINE void set_tangible(bool tangible);
INLINE bool is_tangible() const;
MAKE_PROPERTY(tangible, is_tangible, set_tangible);
INLINE void set_effective_normal(const LVector3 &effective_normal);
INLINE void clear_effective_normal();
@ -70,10 +72,14 @@ PUBLISHED:
INLINE void set_respect_effective_normal(bool respect_effective_normal);
INLINE bool get_respect_effective_normal() const;
MAKE_PROPERTY(respect_effective_normal,
get_respect_effective_normal,
set_respect_effective_normal);
CPT(BoundingVolume) get_bounds() const;
void set_bounds(const BoundingVolume &bounding_volume);
MAKE_PROPERTY(bounds, get_bounds, set_bounds);
public:
virtual PT(CollisionEntry)
test_intersection(const CollisionEntry &entry) const;

View File

@ -46,6 +46,12 @@ public:
INLINE bool has_dt() const;
INLINE double get_dt() const;
PUBLISHED:
MAKE_PROPERTY(time, get_time, set_time);
MAKE_PROPERTY(pos, get_pos, set_pos);
MAKE_PROPERTY(orient, get_orient, set_orient);
MAKE_PROPERTY(dt, get_dt, set_dt);
private:
enum Flags {
F_has_time = 0x0001,

View File

@ -46,10 +46,11 @@ PUBLISHED:
PUBLISHED:
INLINE CallbackGraphicsWindow *get_window() const;
MAKE_PROPERTY(window, get_window);
protected:
PT(CallbackGraphicsWindow) _window;
public:
static TypeHandle get_class_type() {
return _type_handle;
@ -63,7 +64,7 @@ PUBLISHED:
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
};
@ -74,7 +75,7 @@ PUBLISHED:
PUBLISHED:
virtual void upcall();
public:
static TypeHandle get_class_type() {
return _type_handle;
@ -104,7 +105,7 @@ PUBLISHED:
private:
WindowProperties &_properties;
public:
static TypeHandle get_class_type() {
return _type_handle;
@ -137,9 +138,12 @@ PUBLISHED:
PUBLISHED:
INLINE CallbackGraphicsWindow::RenderCallbackType get_callback_type() const;
INLINE GraphicsOutput::FrameMode get_frame_mode() const;
MAKE_PROPERTY(callback_type, get_callback_type);
MAKE_PROPERTY(frame_mode, get_frame_mode);
INLINE void set_render_flag(bool render_flag);
INLINE bool get_render_flag() const;
MAKE_PROPERTY(render_flag, get_render_flag, set_render_flag);
virtual void upcall();
@ -147,7 +151,7 @@ PUBLISHED:
RenderCallbackType _callback_type;
FrameMode _frame_mode;
bool _render_flag;
public:
static TypeHandle get_class_type() {
return _type_handle;
@ -161,7 +165,7 @@ PUBLISHED:
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
};

View File

@ -93,36 +93,49 @@ PUBLISHED:
virtual void set_camera(const NodePath &camera);
INLINE NodePath get_camera(Thread *current_thread = Thread::get_current_thread()) const;
MAKE_PROPERTY(camear, get_camera, set_camera);
virtual void set_active(bool active);
INLINE bool is_active() const;
MAKE_PROPERTY(active, is_active, set_active);
virtual void set_sort(int sort);
INLINE int get_sort() const;
MAKE_PROPERTY(sort, get_sort, set_sort);
virtual void set_stereo_channel(Lens::StereoChannel stereo_channel);
INLINE Lens::StereoChannel get_stereo_channel() const;
MAKE_PROPERTY(stereo_channel, get_stereo_channel, set_stereo_channel);
virtual void set_tex_view_offset(int tex_view_offset);
INLINE int get_tex_view_offset() const;
MAKE_PROPERTY(tex_view_offset, get_tex_view_offset, set_tex_view_offset);
virtual void set_incomplete_render(bool incomplete_render);
INLINE bool get_incomplete_render() const;
MAKE_PROPERTY(incomplete_render, get_incomplete_render, set_incomplete_render);
virtual void set_texture_reload_priority(int texture_reload_priority);
INLINE int get_texture_reload_priority() const;
MAKE_PROPERTY(texture_reload_priority, get_texture_reload_priority,
set_texture_reload_priority);
void set_lens_index(int index);
INLINE int get_lens_index() const;
MAKE_PROPERTY(lens_index, get_lens_index, set_lens_index);
virtual void set_cull_traverser(CullTraverser *trav);
CullTraverser *get_cull_traverser();
MAKE_PROPERTY(cull_traverser, get_cull_traverser, set_cull_traverser);
INLINE void set_cube_map_index(int cube_map_index);
virtual void set_target_tex_page(int page);
INLINE int get_target_tex_page() const;
MAKE_PROPERTY(target_tex_page, get_target_tex_page, set_target_tex_page);
INLINE void set_scissor_enabled(bool scissor_enabled);
INLINE bool get_scissor_enabled() const;
MAKE_PROPERTY(scissor_enabled, get_scissor_enabled, set_scissor_enabled);
INLINE void set_cull_callback(CallbackObject *object);
INLINE void clear_cull_callback();

View File

@ -74,12 +74,15 @@ PUBLISHED:
INLINE void set_clear_color(const LColor &color);
INLINE const LColor &get_clear_color() const;
MAKE_PROPERTY(clear_color, get_clear_color, set_clear_color);
INLINE void set_clear_depth(PN_stdfloat depth);
INLINE PN_stdfloat get_clear_depth() const;
MAKE_PROPERTY(clear_depth, get_clear_depth, set_clear_depth);
INLINE void set_clear_stencil(unsigned int stencil);
INLINE unsigned int get_clear_stencil() const;
MAKE_PROPERTY(clear_stencil, get_clear_stencil, set_clear_stencil);
virtual void set_clear_active(int n, bool clear_aux_active);
virtual bool get_clear_active(int n) const;
@ -94,6 +97,8 @@ PUBLISHED:
INLINE PN_stdfloat get_pixel_zoom() const;
INLINE PN_stdfloat get_pixel_factor() const;
virtual bool supports_pixel_zoom() const;
MAKE_PROPERTY(pixel_zoom, get_pixel_zoom, set_pixel_zoom);
MAKE_PROPERTY(pixel_factor, get_pixel_factor);
static int get_renderbuffer_type(int plane);

View File

@ -123,6 +123,29 @@ PUBLISHED:
INLINE void set_float_color(bool n);
INLINE void set_float_depth(bool n);
MAKE_PROPERTY(depth_bits, get_depth_bits, set_depth_bits);
MAKE_PROPERTY(color_bits, get_color_bits, set_color_bits);
MAKE_PROPERTY(red_bits, get_red_bits, set_red_bits);
MAKE_PROPERTY(green_bits, get_green_bits, set_green_bits);
MAKE_PROPERTY(blue_bits, get_blue_bits, set_blue_bits);
MAKE_PROPERTY(alpha_bits, get_alpha_bits, set_alpha_bits);
MAKE_PROPERTY(stencil_bits, get_stencil_bits, set_stencil_bits);
MAKE_PROPERTY(accum_bits, get_accum_bits, set_accum_bits);
MAKE_PROPERTY(aux_rgba, get_aux_rgba, set_aux_rgba);
MAKE_PROPERTY(aux_hrgba, get_aux_hrgba, set_aux_hrgba);
MAKE_PROPERTY(aux_float, get_aux_float, set_aux_float);
MAKE_PROPERTY(multisamples, get_multisamples, set_multisamples);
MAKE_PROPERTY(coverage_samples, get_coverage_samples, set_coverage_samples);
MAKE_PROPERTY(back_buffers, get_back_buffers, set_back_buffers);
MAKE_PROPERTY(indexed_color, get_indexed_color, set_indexed_color);
MAKE_PROPERTY(rgb_color, get_rgb_color, set_rgb_color);
MAKE_PROPERTY(stereo, get_stereo, set_stereo);
MAKE_PROPERTY(force_hardware, get_force_hardware, set_force_hardware);
MAKE_PROPERTY(force_software, get_force_software, set_force_software);
MAKE_PROPERTY(srgb_color, get_srgb_color, set_srgb_color);
MAKE_PROPERTY(float_color, get_float_color, set_float_color);
MAKE_PROPERTY(float_depth, get_float_depth, set_float_depth);
// Other.
FrameBufferProperties();

View File

@ -62,17 +62,22 @@ PUBLISHED:
void set_threading_model(const GraphicsThreadingModel &threading_model);
GraphicsThreadingModel get_threading_model() const;
MAKE_PROPERTY(threading_model, get_threading_model, set_threading_model);
INLINE const ReMutex &get_render_lock() const;
MAKE_PROPERTY(render_lock, get_render_lock);
INLINE void set_auto_flip(bool auto_flip);
INLINE bool get_auto_flip() const;
MAKE_PROPERTY(auto_flip, get_auto_flip, set_auto_flip);
INLINE void set_portal_cull(bool value);
INLINE bool get_portal_cull() const;
MAKE_PROPERTY(portal_cull, get_portal_cull, set_portal_cull);
INLINE void set_default_loader(Loader *loader);
INLINE Loader *get_default_loader() const;
MAKE_PROPERTY(default_loader, get_default_loader, set_default_loader);
GraphicsOutput *make_output(GraphicsPipe *pipe,
const string &name, int sort,

View File

@ -121,6 +121,10 @@ PUBLISHED:
INLINE GraphicsPipe *get_pipe() const;
INLINE GraphicsEngine *get_engine() const;
INLINE const string &get_name() const;
MAKE_PROPERTY(gsg, get_gsg);
MAKE_PROPERTY(pipe, get_pipe);
MAKE_PROPERTY(engine, get_engine);
MAKE_PROPERTY(name, get_name);
INLINE int count_textures() const;
INLINE bool has_texture() const;
@ -148,17 +152,26 @@ PUBLISHED:
INLINE bool is_valid() const;
INLINE bool is_nonzero_size() const;
MAKE_PROPERTY(size, get_size);
MAKE_PROPERTY(fb_size, get_fb_size);
MAKE_PROPERTY(sbs_left_size, get_sbs_left_size);
MAKE_PROPERTY(sbs_right_size, get_sbs_right_size);
void set_active(bool active);
virtual bool is_active() const;
MAKE_PROPERTY(active, is_active, set_active);
void set_one_shot(bool one_shot);
bool get_one_shot() const;
MAKE_PROPERTY(one_shot, get_one_shot, set_one_shot);
void set_inverted(bool inverted);
INLINE bool get_inverted() const;
MAKE_PROPERTY(inverted, get_inverted, set_inverted);
INLINE void set_swap_eyes(bool swap_eyes);
INLINE bool get_swap_eyes() const;
MAKE_PROPERTY(swap_eyes, get_swap_eyes, set_swap_eyes);
INLINE void set_red_blue_stereo(bool red_blue_stereo,
unsigned int left_eye_color_mask,
@ -183,6 +196,7 @@ PUBLISHED:
virtual void set_sort(int sort);
INLINE int get_sort() const;
MAKE_PROPERTY(sort, get_sort, set_sort);
INLINE void set_child_sort(int child_sort);
INLINE void clear_child_sort();
@ -236,6 +250,7 @@ PUBLISHED:
virtual void unshare_depth_buffer();
virtual bool get_supports_render_texture() const;
MAKE_PROPERTY(supports_render_texture, get_supports_render_texture);
PUBLISHED:
// These are not intended to be called directly by the user, but

View File

@ -98,11 +98,16 @@ PUBLISHED:
INLINE int get_display_width() const;
INLINE int get_display_height() const;
MAKE_PROPERTY(display_width, get_display_width);
MAKE_PROPERTY(display_height, get_display_height);
DisplayInformation *get_display_information();
MAKE_PROPERTY(display_information, get_display_information);
virtual void lookup_cpu_data();
virtual string get_interface_name() const=0;
MAKE_PROPERTY(interface_name, get_interface_name);
public:
enum PreferredWindowThread {

View File

@ -97,20 +97,27 @@ PUBLISHED:
INLINE bool is_active() const;
INLINE bool is_valid() const;
INLINE bool needs_reset() const;
MAKE_PROPERTY(active, is_active, set_active);
MAKE_PROPERTY(valid, is_valid);
INLINE void set_incomplete_render(bool incomplete_render);
virtual INLINE bool get_incomplete_render() const;
virtual INLINE bool get_effective_incomplete_render() const;
MAKE_PROPERTY(incomplete_render, get_incomplete_render, set_incomplete_render);
MAKE_PROPERTY(effective_incomplete_render, get_effective_incomplete_render);
INLINE void set_loader(Loader *loader);
INLINE Loader *get_loader() const;
MAKE_PROPERTY(loader, get_loader, set_loader);
INLINE void set_shader_generator(ShaderGenerator *shader_generator);
INLINE ShaderGenerator *get_shader_generator() const;
MAKE_PROPERTY(shader_generator, get_shader_generator, set_shader_generator);
INLINE GraphicsPipe *get_pipe() const;
GraphicsEngine *get_engine() const;
INLINE const GraphicsThreadingModel &get_threading_model() const;
MAKE_PROPERTY(pipe, get_pipe);
INLINE bool is_hardware() const;
virtual INLINE bool prefers_triangle_strips() const;
@ -170,8 +177,54 @@ PUBLISHED:
INLINE int get_max_color_targets() const;
INLINE int get_maximum_simultaneous_render_targets() const;
MAKE_PROPERTY(max_vertices_per_array, get_max_vertices_per_array);
MAKE_PROPERTY(max_vertices_per_primitive, get_max_vertices_per_primitive);
MAKE_PROPERTY(max_texture_stages, get_max_texture_stages);
MAKE_PROPERTY(max_texture_dimension, get_max_texture_dimension);
MAKE_PROPERTY(max_3d_texture_dimension, get_max_3d_texture_dimension);
MAKE_PROPERTY(max_2d_texture_array_layers, get_max_2d_texture_array_layers);
MAKE_PROPERTY(max_cube_map_dimension, get_max_cube_map_dimension);
MAKE_PROPERTY(max_buffer_texture_size, get_max_buffer_texture_size);
MAKE_PROPERTY(supports_texture_combine, get_supports_texture_combine);
MAKE_PROPERTY(supports_texture_saved_result, get_supports_texture_saved_result);
MAKE_PROPERTY(supports_texture_dot3, get_supports_texture_dot3);
MAKE_PROPERTY(supports_3d_texture, get_supports_3d_texture);
MAKE_PROPERTY(supports_2d_texture_array, get_supports_2d_texture_array);
MAKE_PROPERTY(supports_cube_map, get_supports_cube_map);
MAKE_PROPERTY(supports_buffer_texture, get_supports_buffer_texture);
MAKE_PROPERTY(supports_cube_map_array, get_supports_cube_map_array);
MAKE_PROPERTY(supports_tex_non_pow2, get_supports_tex_non_pow2);
MAKE_PROPERTY(supports_texture_srgb, get_supports_texture_srgb);
MAKE_PROPERTY(supports_compressed_texture, get_supports_compressed_texture);
MAKE_PROPERTY(max_lights, get_max_lights);
MAKE_PROPERTY(max_clip_planes, get_max_clip_planes);
MAKE_PROPERTY(max_vertex_transforms, get_max_vertex_transforms);
MAKE_PROPERTY(max_vertex_transform_indices, get_max_vertex_transform_indices);
MAKE_PROPERTY(copy_texture_inverted, get_copy_texture_inverted);
MAKE_PROPERTY(supports_multisample, get_supports_multisample);
MAKE_PROPERTY(supports_generate_mipmap, get_supports_generate_mipmap);
MAKE_PROPERTY(supports_depth_texture, get_supports_depth_texture);
MAKE_PROPERTY(supports_depth_stencil, get_supports_depth_stencil);
MAKE_PROPERTY(supports_shadow_filter, get_supports_shadow_filter);
MAKE_PROPERTY(supports_sampler_objects, get_supports_sampler_objects);
MAKE_PROPERTY(supports_basic_shaders, get_supports_basic_shaders);
MAKE_PROPERTY(supports_geometry_shaders, get_supports_geometry_shaders);
MAKE_PROPERTY(supports_tessellation_shaders, get_supports_tessellation_shaders);
MAKE_PROPERTY(supports_compute_shaders, get_supports_compute_shaders);
MAKE_PROPERTY(supports_glsl, get_supports_glsl);
MAKE_PROPERTY(supports_hlsl, get_supports_hlsl);
MAKE_PROPERTY(supports_stencil, get_supports_stencil);
MAKE_PROPERTY(supports_two_sided_stencil, get_supports_two_sided_stencil);
MAKE_PROPERTY(supports_geometry_instancing, get_supports_geometry_instancing);
MAKE_PROPERTY(supports_indirect_draw, get_supports_indirect_draw);
MAKE_PROPERTY(supports_occlusion_query, get_supports_occlusion_query);
MAKE_PROPERTY(supports_timer_query, get_supports_timer_query);
MAKE_PROPERTY(timer_queries_active, get_timer_queries_active);
MAKE_PROPERTY(max_color_targets, get_max_color_targets);
INLINE ShaderModel get_shader_model() const;
INLINE void set_shader_model(ShaderModel shader_model);
MAKE_PROPERTY(shader_model, get_shader_model, set_shader_model);
virtual int get_supported_geom_rendering() const;
virtual bool get_supports_cg_profile(const string &name) const;
@ -186,15 +239,20 @@ PUBLISHED:
void set_coordinate_system(CoordinateSystem cs);
INLINE CoordinateSystem get_coordinate_system() const;
virtual CoordinateSystem get_internal_coordinate_system() const;
MAKE_PROPERTY(coordinate_system, get_coordinate_system, set_coordinate_system);
virtual PreparedGraphicsObjects *get_prepared_objects();
MAKE_PROPERTY(prepared_objects, get_prepared_objects);
virtual bool set_gamma(PN_stdfloat gamma);
PN_stdfloat get_gamma(PN_stdfloat gamma);
virtual void restore_gamma();
MAKE_PROPERTY(get_gamma, set_gamma);
INLINE void set_texture_quality_override(Texture::QualityLevel quality_level);
INLINE Texture::QualityLevel get_texture_quality_override() const;
MAKE_PROPERTY(texture_quality_override, get_texture_quality_override,
set_texture_quality_override);
EXTENSION(PyObject *get_prepared_textures() const);
typedef bool TextureCallback(TextureContext *tc, void *callback_arg);
@ -204,6 +262,7 @@ PUBLISHED:
void set_flash_texture(Texture *tex);
void clear_flash_texture();
Texture *get_flash_texture() const;
MAKE_PROPERTY(flash_texture, get_flash_texture, set_flash_texture);
#endif
PUBLISHED:
@ -217,8 +276,17 @@ PUBLISHED:
virtual int get_driver_shader_version_major();
virtual int get_driver_shader_version_minor();
MAKE_PROPERTY(driver_vendor, get_driver_vendor);
MAKE_PROPERTY(driver_renderer, get_driver_renderer);
MAKE_PROPERTY(driver_version, get_driver_version);
MAKE_PROPERTY(driver_version_major, get_driver_version_major);
MAKE_PROPERTY(driver_version_minor, get_driver_version_minor);
MAKE_PROPERTY(driver_shader_version_major, get_driver_shader_version_major);
MAKE_PROPERTY(driver_shader_version_minor, get_driver_shader_version_minor);
bool set_scene(SceneSetup *scene_setup);
virtual SceneSetup *get_scene() const;
MAKE_PROPERTY(scene, get_scene, set_scene);
public:
virtual TextureContext *prepare_texture(Texture *tex);

View File

@ -63,16 +63,25 @@ PUBLISHED:
virtual bool is_active() const;
INLINE bool is_fullscreen() const;
MAKE_PROPERTY(properties, get_properties);
MAKE_PROPERTY(requested_properties, get_requested_properties);
MAKE_PROPERTY(rejected_properties, get_rejected_properties);
MAKE_PROPERTY(closed, is_closed);
void set_window_event(const string &window_event);
string get_window_event() const;
MAKE_PROPERTY(window_event, get_window_event, set_window_event);
void set_close_request_event(const string &close_request_event);
string get_close_request_event() const;
MAKE_PROPERTY(close_request_event, get_close_request_event, set_close_request_event);
INLINE void set_unexposed_draw(bool unexposed_draw);
INLINE bool get_unexposed_draw() const;
MAKE_PROPERTY(unexposed_draw, get_unexposed_draw, set_unexposed_draw);
INLINE WindowHandle *get_window_handle() const;
MAKE_PROPERTY(window_handle, get_window_handle);
// Mouse and keyboard routines
int get_num_input_devices() const;

View File

@ -47,6 +47,7 @@ PUBLISHED:
INLINE OSHandle *get_os_handle() const;
INLINE void set_os_handle(OSHandle *os_handle);
MAKE_PROPERTY(os_handle, get_os_handle, set_os_handle);
void send_windows_message(unsigned int msg, int wparam, int lparam);

View File

@ -72,9 +72,15 @@ PUBLISHED:
// If the task's status is not S_sleeping, this contains 0.0.
MAKE_PROPERTY(wake_time, get_wake_time);
// Alias of wake_time.
MAKE_PROPERTY(wakeTime, get_wake_time);
// The delay value that has been set on this task, if any, or None.
MAKE_PROPERTY(delay_time, get_delay, set_delay);
// Alias of delay_time.
MAKE_PROPERTY(delayTime, get_delay, set_delay);
// The number of frames that have elapsed since the task was
// started, according to the task manager's clock.
MAKE_PROPERTY(frame, get_elapsed_frames);

View File

@ -40,6 +40,7 @@ PUBLISHED:
INLINE void clear_name();
INLINE bool has_name() const;
INLINE const string &get_name() const;
MAKE_PROPERTY(name, get_name, set_name);
// In the absence of any definition to the contrary, outputting a
// Namable will write out its name.

View File

@ -52,6 +52,9 @@ PUBLISHED:
INLINE void ref() const;
virtual INLINE bool unref() const;
// The current reference count.
MAKE_PROPERTY(ref_count, get_ref_count);
INLINE bool test_ref_count_integrity() const;
INLINE bool test_ref_count_nonzero() const;

View File

@ -42,19 +42,23 @@ PUBLISHED:
// intervals, but it should not drift substantially over the long
// haul.
double get_long_time();
MAKE_PROPERTY(long_time, get_long_time);
// get_short_time() returns the most precise timer we have over a
// short interval. It may tend to drift over the long haul, but it
// should have lots of digits to measure short intervals very
// precisely.
INLINE double get_short_time();
MAKE_PROPERTY(short_time, get_short_time);
// get_short_raw_time() is like get_short_time(), but does not apply
// any corrections (e.g. paranoid-clock) to the result returned by
// the OS.
double get_short_raw_time();
MAKE_PROPERTY(short_raw_time, get_short_raw_time);
INLINE int get_error_count() const;
MAKE_PROPERTY(error_count, get_error_count);
INLINE static TrueClock *get_global_ptr();

View File

@ -70,6 +70,7 @@ PUBLISHED:
INLINE void set_change_event(const string &event);
INLINE const string &get_change_event() const;
MAKE_PROPERTY(change_event, get_change_event, set_change_event);
void set_coordinate_system(CoordinateSystem cs);
INLINE CoordinateSystem get_coordinate_system() const;
@ -80,13 +81,16 @@ PUBLISHED:
INLINE void set_film_size(PN_stdfloat width, PN_stdfloat height);
INLINE void set_film_size(const LVecBase2 &film_size);
INLINE const LVecBase2 &get_film_size() const;
MAKE_PROPERTY(film_size, get_film_size, set_film_size);
INLINE void set_film_offset(PN_stdfloat x, PN_stdfloat y);
INLINE void set_film_offset(const LVecBase2 &film_offset);
INLINE const LVector2 &get_film_offset() const;
MAKE_PROPERTY(film_offset, get_film_offset, set_film_offset);
INLINE void set_focal_length(PN_stdfloat focal_length);
INLINE PN_stdfloat get_focal_length() const;
MAKE_PROPERTY(focal_length, get_focal_length, set_focal_length);
void set_min_fov(PN_stdfloat min_fov);
INLINE void set_fov(PN_stdfloat fov);
@ -96,45 +100,57 @@ PUBLISHED:
INLINE PN_stdfloat get_hfov() const;
INLINE PN_stdfloat get_vfov() const;
PN_stdfloat get_min_fov() const;
MAKE_PROPERTY(fov, get_fov, set_fov);
MAKE_PROPERTY(min_fov, get_min_fov, set_min_fov);
INLINE void set_aspect_ratio(PN_stdfloat aspect_ratio);
INLINE PN_stdfloat get_aspect_ratio() const;
MAKE_PROPERTY(aspect_ratio, get_aspect_ratio, set_aspect_ratio);
INLINE void set_near(PN_stdfloat near_distance);
INLINE PN_stdfloat get_near() const;
INLINE void set_far(PN_stdfloat far_distance);
INLINE PN_stdfloat get_far() const;
INLINE void set_near_far(PN_stdfloat near_distance, PN_stdfloat far_distance);
MAKE_PROPERTY(near, get_near, set_near);
MAKE_PROPERTY(far, get_far, set_far);
static PN_stdfloat get_default_near();
static PN_stdfloat get_default_far();
INLINE void set_view_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
void set_view_hpr(const LVecBase3 &view_hpr);
const LVecBase3 &get_view_hpr() const;
MAKE_PROPERTY(view_hpr, get_view_hpr, set_view_hpr);
INLINE void set_view_vector(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat i, PN_stdfloat j, PN_stdfloat k);
void set_view_vector(const LVector3 &view_vector, const LVector3 &up_vector);
const LVector3 &get_view_vector() const;
const LVector3 &get_up_vector() const;
LPoint3 get_nodal_point() const;
MAKE_PROPERTY(nodal_point, get_nodal_point);
INLINE void set_interocular_distance(PN_stdfloat interocular_distance);
INLINE PN_stdfloat get_interocular_distance() const;
INLINE void set_convergence_distance(PN_stdfloat convergence_distance);
INLINE PN_stdfloat get_convergence_distance() const;
MAKE_PROPERTY(interocular_distance, get_interocular_distance, set_interocular_distance);
MAKE_PROPERTY(convergence_distance, get_convergence_distance, set_convergence_distance);
INLINE void set_view_mat(const LMatrix4 &view_mat);
INLINE const LMatrix4 &get_view_mat() const;
void clear_view_mat();
MAKE_PROPERTY(view_mat, get_view_mat, set_view_mat);
void set_keystone(const LVecBase2 &keystone);
INLINE const LVecBase2 &get_keystone() const;
void clear_keystone();
MAKE_PROPERTY(keystone, get_keystone, set_keystone);
void set_custom_film_mat(const LMatrix4 &custom_film_mat);
INLINE const LMatrix4 &get_custom_film_mat() const;
void clear_custom_film_mat();
// These flags are passed in as the last parameter to control the
// behavior of set_frustum_from_corners(). See the documentation
// for that method for an explanation of each flag.

View File

@ -111,6 +111,20 @@ PUBLISHED:
INLINE PN_stdfloat get_max_lod() const;
INLINE PN_stdfloat get_lod_bias() const;
MAKE_PROPERTY(wrap_u, get_wrap_u, set_wrap_u);
MAKE_PROPERTY(wrap_v, get_wrap_v, set_wrap_v);
MAKE_PROPERTY(wrap_w, get_wrap_w, set_wrap_w);
MAKE_PROPERTY(minfilter, get_minfilter, set_minfilter);
MAKE_PROPERTY(magfilter, get_magfilter, set_magfilter);
MAKE_PROPERTY(effective_minfilter, get_effective_minfilter);
MAKE_PROPERTY(effective_magfilter, get_effective_magfilter);
MAKE_PROPERTY(anisotropic_degree, get_anisotropic_degree, set_anisotropic_degree);
MAKE_PROPERTY(effective_anisotropic_degree, get_effective_anisotropic_degree);
MAKE_PROPERTY(border_color, get_border_color, set_border_color);
MAKE_PROPERTY(min_lod, get_min_lod, set_min_lod);
MAKE_PROPERTY(max_lod, get_max_lod, set_max_lod);
MAKE_PROPERTY(lod_bias, get_lod_bias, set_lod_bias);
INLINE bool uses_mipmaps() const;
INLINE static bool is_mipmap(FilterType type);

View File

@ -49,9 +49,11 @@ public:
PUBLISHED:
INLINE void set_active(bool active);
INLINE bool is_active() const;
MAKE_PROPERTY(active, is_active, set_active);
INLINE void set_scene(const NodePath &scene);
INLINE const NodePath &get_scene() const;
MAKE_PROPERTY(scene, get_scene, set_scene);
INLINE int get_num_display_regions() const;
INLINE DisplayRegionBase *get_display_region(int n) const;
@ -59,24 +61,31 @@ PUBLISHED:
INLINE void set_camera_mask(DrawMask mask);
INLINE DrawMask get_camera_mask() const;
MAKE_PROPERTY(camera_mask, get_camera_mask, set_camera_mask);
INLINE void set_cull_center(const NodePath &cull_center);
INLINE const NodePath &get_cull_center() const;
MAKE_PROPERTY(cull_center, get_cull_center, set_cull_center);
INLINE void set_cull_bounds(BoundingVolume *cull_bounds);
INLINE BoundingVolume *get_cull_bounds() const;
MAKE_PROPERTY(cull_bounds, get_cull_bounds, set_cull_bounds);
INLINE void set_lod_center(const NodePath &lod_center);
INLINE const NodePath &get_lod_center() const;
MAKE_PROPERTY(lod_center, get_lod_center, set_lod_center);
INLINE void set_initial_state(const RenderState *state);
INLINE CPT(RenderState) get_initial_state() const;
MAKE_PROPERTY(initial_state, get_initial_state, set_initial_state);
INLINE void set_tag_state_key(const string &tag_state_key);
INLINE const string &get_tag_state_key() const;
MAKE_PROPERTY(tag_state_key, get_tag_state_key, set_tag_state_key);
INLINE void set_lod_scale(PN_stdfloat value);
INLINE PN_stdfloat get_lod_scale() const;
MAKE_PROPERTY(lod_scale, get_lod_scale, set_lod_scale);
void set_tag_state(const string &tag_state, const RenderState *state);
void clear_tag_state(const string &tag_state);

View File

@ -50,6 +50,7 @@ PUBLISHED:
INLINE const LColor &get_color() const;
INLINE void set_color(const LColor &color);
MAKE_PROPERTY(color, get_color, set_color);
virtual PN_stdfloat get_exponent() const;
virtual const LColor &get_specular_color() const;
@ -58,6 +59,7 @@ PUBLISHED:
INLINE void set_priority(int priority);
INLINE int get_priority() const;
virtual int get_class_priority() const=0;
MAKE_PROPERTY(priority, get_priority, set_priority);
public:
virtual void output(ostream &out) const=0;

View File

@ -34,12 +34,15 @@ PUBLISHED:
INLINE ModelRoot(const Filename &fulllpath, time_t timestamp);
INLINE int get_model_ref_count() const;
MAKE_PROPERTY(model_ref_count, get_model_ref_count);
INLINE const Filename &get_fullpath() const;
INLINE void set_fullpath(const Filename &fullpath);
MAKE_PROPERTY(fullpath, get_fullpath, set_fullpath);
INLINE time_t get_timestamp() const;
INLINE void set_timestamp(time_t timestamp);
MAKE_PROPERTY(timestamp, get_timestamp, set_timestamp);
// This class is used to unify references to the same model.
class ModelReference : public ReferenceCount {
@ -49,6 +52,7 @@ PUBLISHED:
INLINE ModelReference *get_reference() const;
void set_reference(ModelReference *ref);
MAKE_PROPERTY(reference, get_reference, set_reference);
protected:
INLINE ModelRoot(const ModelRoot &copy);

View File

@ -171,20 +171,24 @@ PUBLISHED:
void set_state(const RenderState *state, Thread *current_thread = Thread::get_current_thread());
INLINE CPT(RenderState) get_state(Thread *current_thread = Thread::get_current_thread()) const;
INLINE void clear_state(Thread *current_thread = Thread::get_current_thread());
MAKE_PROPERTY(state, get_state, set_state);
void set_effects(const RenderEffects *effects, Thread *current_thread = Thread::get_current_thread());
INLINE CPT(RenderEffects) get_effects(Thread *current_thread = Thread::get_current_thread()) const;
INLINE void clear_effects(Thread *current_thread = Thread::get_current_thread());
MAKE_PROPERTY(effects, get_effects, set_effects);
void set_transform(const TransformState *transform, Thread *current_thread = Thread::get_current_thread());
INLINE CPT(TransformState) get_transform(Thread *current_thread = Thread::get_current_thread()) const;
INLINE void clear_transform(Thread *current_thread = Thread::get_current_thread());
MAKE_PROPERTY(transform, get_transform, set_transform);
void set_prev_transform(const TransformState *transform, Thread *current_thread = Thread::get_current_thread());
INLINE CPT(TransformState) get_prev_transform(Thread *current_thread = Thread::get_current_thread()) const;
void reset_prev_transform(Thread *current_thread = Thread::get_current_thread());
INLINE bool has_dirty_prev_transform() const;
static void reset_all_prev_transform(Thread *current_thread = Thread::get_current_thread());
MAKE_PROPERTY(prev_transform, get_prev_transform);
void set_tag(const string &key, const string &value,
Thread *current_thread = Thread::get_current_thread());
@ -302,7 +306,6 @@ PUBLISHED:
};
INLINE int get_fancy_bits(Thread *current_thread = Thread::get_current_thread()) const;
PUBLISHED:
static PT(PandaNode) decode_from_bam_stream(const string &data, BamReader *reader = NULL);

View File

@ -156,6 +156,14 @@ PUBLISHED:
INLINE PN_stdfloat get_shear2d() const;
INLINE LMatrix3 get_mat3() const;
MAKE_PROPERTY(pos, get_pos);
MAKE_PROPERTY(hpr, get_hpr);
MAKE_PROPERTY(quat, get_quat);
MAKE_PROPERTY(norm_quat, get_norm_quat);
MAKE_PROPERTY(scale, get_scale);
MAKE_PROPERTY(shear, get_shear);
MAKE_PROPERTY(mat, get_mat);
CPT(TransformState) set_pos(const LVecBase3 &pos) const;
CPT(TransformState) set_hpr(const LVecBase3 &hpr) const;
CPT(TransformState) set_quat(const LQuaternion &quat) const;
@ -209,7 +217,6 @@ PUBLISHED:
EXTENSION(static PyObject *get_states());
EXTENSION(static PyObject *get_unused_states());
public:
static void init_states();

View File

@ -43,12 +43,15 @@ public:
PUBLISHED:
INLINE const LColor &get_specular_color() const FINAL;
INLINE void set_specular_color(const LColor &color);
MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color);
INLINE const LPoint3 &get_point() const;
INLINE void set_point(const LPoint3 &point);
MAKE_PROPERTY(point, get_point, set_point);
INLINE const LVector3 &get_direction() const;
INLINE void set_direction(const LVector3 &direction);
MAKE_PROPERTY(direction, get_direction, set_direction);
virtual int get_class_priority() const;

View File

@ -43,12 +43,15 @@ public:
PUBLISHED:
INLINE const LColor &get_specular_color() const FINAL;
INLINE void set_specular_color(const LColor &color);
MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color);
INLINE const LVecBase3 &get_attenuation() const FINAL;
INLINE void set_attenuation(const LVecBase3 &attenuation);
MAKE_PROPERTY(attenuation, get_attenuation, set_attenuation);
INLINE const LPoint3 &get_point() const;
INLINE void set_point(const LPoint3 &point);
MAKE_PROPERTY(point, get_point, set_point);
virtual int get_class_priority() const;

View File

@ -45,6 +45,9 @@ PUBLISHED:
Thread *get_thread() const;
INLINE int get_index() const;
MAKE_PROPERTY(thread, get_thread);
MAKE_PROPERTY(index, get_index);
private:
PStatClient *_client;
int _index;

View File

@ -33,7 +33,7 @@ ButtonHandle() {
// index number, which may have been returned by an
// earlier call to ButtonHandle::get_index().
////////////////////////////////////////////////////////////////////
INLINE ButtonHandle::
CONSTEXPR ButtonHandle::
ButtonHandle(int index) : _index(index) {
}
@ -180,7 +180,7 @@ matches(const ButtonHandle &other) const {
// for the convenience of non-C++ scripting languages to
// build a hashtable of ButtonHandles.
////////////////////////////////////////////////////////////////////
INLINE int ButtonHandle::
CONSTEXPR int ButtonHandle::
get_index() const {
return _index;
}

View File

@ -28,7 +28,7 @@
class EXPCL_PANDA_PUTIL ButtonHandle FINAL {
PUBLISHED:
INLINE ButtonHandle();
INLINE ButtonHandle(int index);
CONSTEXPR ButtonHandle(int index);
INLINE ButtonHandle(const ButtonHandle &copy);
ButtonHandle(const string &name);
@ -50,12 +50,16 @@ PUBLISHED:
INLINE bool matches(const ButtonHandle &other) const;
INLINE int get_index() const;
CONSTEXPR int get_index() const;
INLINE void output(ostream &out) const;
INLINE static ButtonHandle none();
INLINE operator bool () const;
MAKE_PROPERTY(index, get_index);
MAKE_PROPERTY(name, get_name);
MAKE_PROPERTY(alias, get_alias);
private:
int _index;
static ButtonHandle _none;

View File

@ -82,6 +82,7 @@ PUBLISHED:
void set_mode(Mode mode);
INLINE Mode get_mode() const;
MAKE_PROPERTY(mode, get_mode, set_mode);
INLINE double get_frame_time(Thread *current_thread = Thread::get_current_thread()) const;
INLINE double get_real_time() const;
@ -95,21 +96,35 @@ PUBLISHED:
INLINE int get_frame_count(Thread *current_thread = Thread::get_current_thread()) const;
INLINE double get_net_frame_rate(Thread *current_thread = Thread::get_current_thread()) const;
MAKE_PROPERTY(frame_time, get_frame_time, set_frame_time);
MAKE_PROPERTY(real_time, get_real_time, set_real_time);
MAKE_PROPERTY(long_time, get_long_time);
MAKE_PROPERTY(frame_count, get_frame_count, set_frame_count);
INLINE double get_dt(Thread *current_thread = Thread::get_current_thread()) const;
void set_dt(double dt);
void set_frame_rate(double frame_rate);
MAKE_PROPERTY(dt, get_dt, set_dt);
INLINE double get_max_dt() const;
INLINE void set_max_dt(double max_dt);
MAKE_PROPERTY(max_dt, get_max_dt, set_max_dt);
INLINE double get_degrade_factor() const;
INLINE void set_degrade_factor(double degrade_factor);
MAKE_PROPERTY(degrade_factor, get_degrade_factor, set_degrade_factor);
INLINE void set_average_frame_rate_interval(double time);
INLINE double get_average_frame_rate_interval() const;
MAKE_PROPERTY(average_frame_rate_interval,
get_average_frame_rate_interval,
set_average_frame_rate_interval);
double get_average_frame_rate(Thread *current_thread = Thread::get_current_thread()) const;
double get_max_frame_duration(Thread *current_thread = Thread::get_current_thread()) const;
double calc_frame_rate_deviation(Thread *current_thread = Thread::get_current_thread()) const;
MAKE_PROPERTY(average_frame_rate, get_average_frame_rate);
MAKE_PROPERTY(max_frame_duration, get_max_frame_duration);
void tick(Thread *current_thread = Thread::get_current_thread());
void sync_frame_time(Thread *current_thread = Thread::get_current_thread());

View File

@ -57,14 +57,20 @@ PUBLISHED:
INLINE void set_flags(int flags);
INLINE int get_flags() const;
MAKE_PROPERTY(flags, get_flags, set_flags);
INLINE void set_texture_flags(int flags);
INLINE int get_texture_flags() const;
INLINE void set_texture_num_views(int num_views);
INLINE int get_texture_num_views() const;
MAKE_PROPERTY(texture_flags, get_texture_flags, set_texture_flags);
MAKE_PROPERTY(texture_num_views, get_texture_num_views,
set_texture_num_views);
INLINE void set_auto_texture_scale(AutoTextureScale scale);
INLINE AutoTextureScale get_auto_texture_scale() const;
MAKE_PROPERTY(auto_texture_scale, get_auto_texture_scale,
set_auto_texture_scale);
void output(ostream &out) const;

View File

@ -37,6 +37,10 @@ PUBLISHED:
void output(ostream &out) const;
MAKE_PROPERTY(x, get_x);
MAKE_PROPERTY(y, get_y);
MAKE_PROPERTY(in_window, get_in_window);
public:
bool _in_window;
double _xpos;

View File

@ -72,6 +72,8 @@ PUBLISHED:
INLINE virtual TypeHandle get_value_type() const;
INLINE TypedReferenceCount *get_value() const;
MAKE_PROPERTY(value, get_value);
virtual void output(ostream &out) const;
private:
@ -118,6 +120,8 @@ PUBLISHED:
INLINE void set_value(const Type &value);
INLINE const Type &get_value() const;
MAKE_PROPERTY(value, get_value, set_value);
INLINE virtual void output(ostream &out) const;
private: