Skip to content

Commit a92dce2

Browse files
committed
Merge branch 'release/1.10.x'
2 parents bf302a0 + f25532d commit a92dce2

File tree

13 files changed

+106
-15
lines changed

13 files changed

+106
-15
lines changed

direct/src/dist/commands.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import struct
1414
import imp
1515
import string
16+
import time
1617

1718
import setuptools
1819
import distutils.log
@@ -30,6 +31,15 @@
3031
# Python 3 defines these subtypes of IOError, but Python 2 doesn't.
3132
FileNotFoundError = IOError
3233

34+
# Warn the user. They might be using Python 2 by accident.
35+
print("=================================================================")
36+
print("WARNING: You are using Python 2, which will soon be discontinued.")
37+
print("WARNING: Please use Python 3 for best results and continued")
38+
print("WARNING: support after the EOL date of December 31st, 2019.")
39+
print("=================================================================")
40+
sys.stdout.flush()
41+
time.sleep(4.0)
42+
3343

3444
def _parse_list(input):
3545
if isinstance(input, basestring):
@@ -229,7 +239,9 @@ def initialize_options(self):
229239
self.requirements_path = os.path.join(os.getcwd(), 'requirements.txt')
230240
self.use_optimized_wheels = True
231241
self.optimized_wheel_index = ''
232-
self.pypi_extra_indexes = []
242+
self.pypi_extra_indexes = [
243+
'https://archive.panda3d.org/thirdparty',
244+
]
233245
self.file_handlers = {}
234246
self.exclude_dependencies = [
235247
# Windows

direct/src/filter/FilterManager.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def getScaledSize(self, mul, div, align):
124124

125125
return winx,winy
126126

127-
def renderSceneInto(self, depthtex=None, colortex=None, auxtex=None, auxbits=0, textures=None):
127+
def renderSceneInto(self, depthtex=None, colortex=None, auxtex=None, auxbits=0, textures=None, fbprops=None):
128128

129129
""" Causes the scene to be rendered into the supplied textures
130130
instead of into the original window. Puts a fullscreen quad
@@ -185,7 +185,10 @@ def renderSceneInto(self, depthtex=None, colortex=None, auxtex=None, auxbits=0,
185185
# Choose the size of the offscreen buffer.
186186

187187
(winx, winy) = self.getScaledSize(1,1,1)
188-
buffer = self.createBuffer("filter-base", winx, winy, texgroup)
188+
if fbprops is not None:
189+
buffer = self.createBuffer("filter-base", winx, winy, texgroup, fbprops=fbprops)
190+
else:
191+
buffer = self.createBuffer("filter-base", winx, winy, texgroup)
189192

190193
if (buffer == None):
191194
return None
@@ -287,7 +290,7 @@ def renderQuadInto(self, name="filter-stage", mul=1, div=1, align=1, depthtex=No
287290

288291
return quad
289292

290-
def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1):
293+
def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1, fbprops=None):
291294
""" Low-level buffer creation. Not intended for public use. """
292295

293296
winprops = WindowProperties()
@@ -297,6 +300,9 @@ def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1):
297300
props.setRgbColor(1)
298301
props.setDepthBits(depthbits)
299302
props.setStereo(self.win.isStereo())
303+
if fbprops is not None:
304+
props.addProperties(fbprops)
305+
300306
depthtex, colortex, auxtex0, auxtex1 = texgroup
301307
if (auxtex0 != None):
302308
props.setAuxRgba(1)

direct/src/showbase/ShowBase.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,13 +1677,17 @@ def getMeta(self):
16771677
return self.mouseWatcherNode.getModifierButtons().isDown(
16781678
KeyboardButton.meta())
16791679

1680-
def attachInputDevice(self, device, prefix=None):
1680+
def attachInputDevice(self, device, prefix=None, gui=False):
16811681
"""
16821682
This function attaches an input device to the data graph, which will
16831683
cause the device to be polled and generate events. If a prefix is
16841684
given and not None, it is used to prefix events generated by this
16851685
device, separated by a hyphen.
16861686
1687+
The gui argument can be set to True (as of Panda3D 1.10.3) to set up
1688+
the default MouseWatcher to receive inputs from this device, allowing
1689+
it to control user interfaces.
1690+
16871691
If you call this, you should consider calling detachInputDevice when
16881692
you are done with the device or when it is disconnected.
16891693
"""
@@ -1694,13 +1698,17 @@ def attachInputDevice(self, device, prefix=None):
16941698
idn = self.dataRoot.attachNewNode(InputDeviceNode(device, device.name))
16951699

16961700
# Setup the button thrower to generate events for the device.
1697-
bt = idn.attachNewNode(ButtonThrower(device.name))
1698-
if prefix is not None:
1699-
bt.node().setPrefix(prefix + '-')
1701+
if prefix is not None or not gui:
1702+
bt = idn.attachNewNode(ButtonThrower(device.name))
1703+
if prefix is not None:
1704+
bt.node().setPrefix(prefix + '-')
1705+
self.deviceButtonThrowers.append(bt)
17001706

17011707
assert self.notify.debug("Attached input device {0} with prefix {1}".format(device, prefix))
17021708
self.__inputDeviceNodes[device] = idn
1703-
self.deviceButtonThrowers.append(bt)
1709+
1710+
if gui:
1711+
idn.node().addChild(self.mouseWatcherNode)
17041712

17051713
def detachInputDevice(self, device):
17061714
"""

panda/src/glstuff/glGraphicsStateGuardian_src.cxx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,31 @@ reset() {
597597
query_glsl_version();
598598

599599
#ifndef OPENGLES
600-
bool core_profile = is_at_least_gl_version(3, 2) &&
601-
!has_extension("GL_ARB_compatibility");
600+
// Determine whether this OpenGL context has compatibility features.
601+
bool core_profile = false;
602+
603+
if (_gl_version_major >= 3) {
604+
if (_gl_version_major > 3 || _gl_version_minor >= 2) {
605+
// OpenGL 3.2 has a built-in way to check this.
606+
GLint profile_mask = 0;
607+
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &profile_mask);
608+
609+
if (profile_mask & GL_CONTEXT_CORE_PROFILE_BIT) {
610+
core_profile = true;
611+
} else if (profile_mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) {
612+
core_profile = false;
613+
} else {
614+
core_profile = !has_extension("GL_ARB_compatibility");
615+
}
616+
} else {
617+
// OpenGL 3.0/3.1.
618+
GLint flags = 0;
619+
glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
620+
if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) {
621+
core_profile = true;
622+
}
623+
}
624+
}
602625

603626
if (GLCAT.is_debug()) {
604627
if (core_profile) {

panda/src/glstuff/glShaderContext_src.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3206,6 +3206,10 @@ glsl_compile_and_link() {
32063206
valid &= glsl_compile_shader(Shader::ST_compute);
32073207
}
32083208

3209+
if (!valid) {
3210+
return false;
3211+
}
3212+
32093213
// There might be warnings, so report those. GLSLShaders::const_iterator
32103214
// it; for (it = _glsl_shaders.begin(); it != _glsl_shaders.end(); ++it) {
32113215
// glsl_report_shader_errors(*it); }

panda/src/glstuff/glmisc_src.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ ConfigVariableInt gl_version
1717
("gl-version", "",
1818
PRC_DESC("Set this to get an OpenGL context with a specific version."));
1919

20+
ConfigVariableBool gl_forward_compatible
21+
("gl-forward-compatible", false,
22+
PRC_DESC("Setting this to true will request a forward-compatible OpenGL "
23+
"context, which will not support the fixed-function pipeline."));
24+
2025
ConfigVariableBool gl_support_fbo
2126
("gl-support-fbo", true,
2227
PRC_DESC("Configure this false if your GL's implementation of "

panda/src/glstuff/glmisc_src.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
// #define GSG_VERBOSE 1
4242

4343
extern EXPCL_GL ConfigVariableInt gl_version;
44+
extern EXPCL_GL ConfigVariableBool gl_forward_compatible;
4445
extern EXPCL_GL ConfigVariableBool gl_support_fbo;
4546
extern ConfigVariableBool gl_cheap_textures;
4647
extern ConfigVariableBool gl_ignore_clamp;

panda/src/glxdisplay/glxGraphicsStateGuardian.cxx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,20 @@ choose_pixel_format(const FrameBufferProperties &properties,
352352
attrib_list[n++] = gl_version[1];
353353
}
354354
}
355+
int flags = 0;
355356
if (gl_debug) {
357+
flags |= GLX_CONTEXT_DEBUG_BIT_ARB;
358+
}
359+
if (gl_forward_compatible) {
360+
flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
361+
if (gl_version.get_num_words() == 0 || gl_version[0] < 2) {
362+
glxdisplay_cat.error()
363+
<< "gl-forward-compatible requires gl-version >= 3 0\n";
364+
}
365+
}
366+
if (flags != 0) {
356367
attrib_list[n++] = GLX_CONTEXT_FLAGS_ARB;
357-
attrib_list[n++] = GLX_CONTEXT_DEBUG_BIT_ARB;
368+
attrib_list[n++] = flags;
358369
}
359370
attrib_list[n] = None;
360371
_context = _glXCreateContextAttribs(_display, _fbconfig, _share_context,

panda/src/pgui/pgButton.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ release(const MouseWatcherParameter &param, bool background) {
115115
if (has_click_button(param.get_button())) {
116116
_button_down = false;
117117
if (get_active()) {
118-
if (param.is_outside()) {
118+
// Note that a "click" may come from a keyboard button press. In that
119+
// case, instead of checking that the mouse cursor is still over the
120+
// button, we check whether the item has keyboard focus.
121+
if (param.is_outside() &&
122+
(MouseButton::is_mouse_button(param.get_button()) || !get_focus())) {
119123
set_state(S_ready);
120124
} else {
121125
set_state(S_rollover);

panda/src/wgldisplay/wglGraphicsStateGuardian.cxx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,20 @@ make_context(HDC hdc) {
609609
attrib_list[n++] = gl_version[1];
610610
}
611611
}
612+
int flags = 0;
612613
if (gl_debug) {
614+
flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
615+
}
616+
if (gl_forward_compatible) {
617+
flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
618+
if (gl_version.get_num_words() == 0 || gl_version[0] < 2) {
619+
wgldisplay_cat.error()
620+
<< "gl-forward-compatible requires gl-version >= 3 0\n";
621+
}
622+
}
623+
if (flags != 0) {
613624
attrib_list[n++] = WGL_CONTEXT_FLAGS_ARB;
614-
attrib_list[n++] = WGL_CONTEXT_DEBUG_BIT_ARB;
625+
attrib_list[n++] = flags;
615626
}
616627
#ifndef SUPPORT_FIXED_FUNCTION
617628
attrib_list[n++] = WGL_CONTEXT_PROFILE_MASK_ARB;

0 commit comments

Comments
 (0)