mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
Added raw_mice flag to WindowProperties
This commit is contained in:
parent
7986a1b15a
commit
be067c60dd
@ -200,7 +200,10 @@ class ShowBase(DirectObject.DirectObject):
|
||||
|
||||
# Open the default rendering window.
|
||||
if self.windowType != 'none':
|
||||
self.openDefaultWindow(startDirect = False)
|
||||
props = WindowProperties.getDefault()
|
||||
if (self.config.GetBool('read-raw-mice', 1)):
|
||||
props.setRawMice(1)
|
||||
self.openDefaultWindow(startDirect = False, props=props)
|
||||
|
||||
self.loader = Loader.Loader(self)
|
||||
self.eventMgr = eventMgr
|
||||
@ -433,7 +436,7 @@ class ShowBase(DirectObject.DirectObject):
|
||||
|
||||
def openWindow(self, props = None, pipe = None, gsg = None,
|
||||
type = None, name = None, size = None, aspectRatio = None,
|
||||
makeCamera = 1, scene = None, stereo = None):
|
||||
makeCamera = 1, scene = None, stereo = None, rawmice = 0):
|
||||
"""
|
||||
Creates a window and adds it to the list of windows that are
|
||||
to be updated every frame.
|
||||
|
@ -90,18 +90,12 @@ ConfigVariableString screenshot_filename
|
||||
PRC_DESC("This specifies the filename pattern to be used to generate "
|
||||
"screenshots captured via save_screenshot_default(). See "
|
||||
"DisplayRegion::save_screenshot()."));
|
||||
|
||||
ConfigVariableString screenshot_extension
|
||||
("screenshot-extension", "jpg",
|
||||
PRC_DESC("This specifies the default filename extension (and therefore the "
|
||||
"default image type) to be used for saving screenshots."));
|
||||
|
||||
// I'll remove this permanently in a few days. - Josh
|
||||
//ConfigVariableBool show_buffers
|
||||
//("show-buffers", false,
|
||||
// PRC_DESC("Set this true to cause offscreen GraphicsBuffers to be created as "
|
||||
// "GraphicsWindows, if possible, so that their contents may be viewed "
|
||||
// "interactively. Handy during development of multipass algorithms."));
|
||||
|
||||
ConfigVariableBool prefer_texture_buffer
|
||||
("prefer-texture-buffer", true,
|
||||
PRC_DESC("Set this true to make GraphicsOutput::make_texture_buffer() always "
|
||||
|
@ -467,6 +467,53 @@ clear_minimized() {
|
||||
_flags &= ~F_minimized;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: WindowProperties::set_raw_mice
|
||||
// Access: Published
|
||||
// Description: Specifies whether the window should read the raw
|
||||
// mouse devices.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void WindowProperties::
|
||||
set_raw_mice(bool raw_mice) {
|
||||
if (raw_mice) {
|
||||
_flags |= F_raw_mice;
|
||||
} else {
|
||||
_flags &= ~F_raw_mice;
|
||||
}
|
||||
_specified |= S_raw_mice;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: WindowProperties::get_raw_mice
|
||||
// Access: Published
|
||||
// Description: Returns true if the window reads the raw mice.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool WindowProperties::
|
||||
get_raw_mice() const {
|
||||
return (_flags & F_raw_mice) != 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: WindowProperties::has_raw_mice
|
||||
// Access: Published
|
||||
// Description: Returns true if set_raw_mice() has been specified.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool WindowProperties::
|
||||
has_raw_mice() const {
|
||||
return ((_specified & S_raw_mice) != 0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: WindowProperties::clear_raw_mice
|
||||
// Access: Published
|
||||
// Description: Removes the raw_mice specification from the properties.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void WindowProperties::
|
||||
clear_raw_mice() {
|
||||
_specified &= ~S_raw_mice;
|
||||
_flags &= ~F_raw_mice;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: WindowProperties::set_open
|
||||
// Access: Published
|
||||
|
@ -106,6 +106,11 @@ PUBLISHED:
|
||||
INLINE bool has_minimized() const;
|
||||
INLINE void clear_minimized();
|
||||
|
||||
INLINE void set_raw_mice(bool raw_mice);
|
||||
INLINE bool get_raw_mice() const;
|
||||
INLINE bool has_raw_mice() const;
|
||||
INLINE void clear_raw_mice();
|
||||
|
||||
INLINE void set_open(bool open);
|
||||
INLINE bool get_open() const;
|
||||
INLINE bool has_open() const;
|
||||
@ -161,6 +166,7 @@ private:
|
||||
S_cursor_filename = 0x1000,
|
||||
S_mouse_mode = 0x2000,
|
||||
S_parent_window = 0x4000,
|
||||
S_raw_mice = 0x8000,
|
||||
};
|
||||
|
||||
// This bitmask represents the true/false settings for various
|
||||
@ -174,6 +180,7 @@ private:
|
||||
F_open = S_open,
|
||||
F_cursor_hidden = S_cursor_hidden,
|
||||
F_fixed_size = S_fixed_size,
|
||||
F_raw_mice = S_raw_mice,
|
||||
};
|
||||
|
||||
int _specified;
|
||||
|
Loading…
x
Reference in New Issue
Block a user