[PyQt] Overpainting example does not work
Mads Ipsen
madsipsen at gmail.com
Tue Apr 20 08:50:53 BST 2010
1. The output from glxinfo yields:
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control,
GLX_EXT_swap_control, GLX_EXT_texture_from_pixmap,
GLX_ARB_create_context,
GLX_ARB_create_context_profile, GLX_ARB_multisample,
GLX_NV_float_buffer,
GLX_ARB_fbconfig_float, GLX_EXT_framebuffer_sRGB
2. In fact I can make the example work by adding the lines
glShadeModel(GL_FLAT)
glDisable(GL_CULL_FACE)
glDisable(GL_DEPTH_TEST)
glDisable(GL_LIGHTING)
just after the line
glCallList(self.object)
in the method paintEvent().
3. BTW - Isn't the second call to painter.fillRect() in
drawInstructions() method redundant?
painter.setRenderHint(QtGui.QPainter.TextAntialiasing)
painter.fillRect(QtCore.QRect(0, 0, self.width(), rect.height()
+ 2*border), QtGui.QColor(0, 0, 0, 127))
painter.setPen(QtCore.Qt.white)
painter.fillRect(QtCore.QRect(0, 0, self.width(), rect.height()
+ 2*border), QtGui.QColor(0, 0, 0, 127))
Best regards,
Mads
David Boddie wrote:
> On Mon Apr 19 20:55:32 BST 2010, Mads Ipsen wrote:
>
>
>> The overpainting example does not work on my computer - no bubbles nor
>> text is painted on top of the OpenGL scene. Anybody that can confirm this?
>>
>
> Can you give some details about your system? In particular, it would be
> interesting to know what kind of graphics card you have and what sort of
> driver support it has for OpenGL. It may be that one of the OpenGL extensions
> is required for this example to work - it's a long time since I've looked at
> OpenGL.
>
> Doing a simple test on my old laptop with Qt 4.3.2, PyQt 4.3 and OpenGL 1.3
> shows that it still works for me. According to glxinfo, my system has a
> number of extensions as well:
>
> ...
> OpenGL renderer string: Mesa DRI Intel(R) 845G 20061017 x86/MMX/SSE2
> OpenGL version string: 1.3 Mesa 7.0.1
> OpenGL extensions:
> GL_ARB_imaging, GL_ARB_multisample, GL_ARB_multitexture,
> ...
>
> Maybe multisampling is required for this example. Can you check to see if
> you have problems with any of the other PyQt OpenGL examples, and take a look
> at the PyOpenGL examples to see if any of those fail to work as expected?
>
> David
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
--
+--------------------------------------------------------------+
| Mads Ipsen, Scientific developer |
+-------------------------------+------------------------------+
| QuantumWise A/S | phone: +45-29716388 |
| Nørre Søgade 27A | www: www.quantumwise.com |
| DK-1370 Copenhagen K, Denmark | email: mads.ipsen at gmail.com |
+-------------------------------+------------------------------+
More information about the PyQt
mailing list