PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 647 - QGLWidget.bindTexture(QPixmap) causes program crash
: QGLWidget.bindTexture(QPixmap) causes program crash
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtOpenGL
: 1.0.0 beta4
: All MS Windows XP/Vista/7
: P2 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-01-27 15:29 EET by Farsmo
Modified: 2011-02-02 15:46 EET (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Farsmo 2011-01-27 15:29:33 EET
On Windows 1.0.0-beta4, examples/opengl/textures/textures.py doesn't work (for
a change :-] ).
Comment 1 Hugo Parente Lima 2011-01-27 16:58:55 EET
Weird... our unit test calls this method and don't crash on Windows.
Comment 2 Matti Airas 2011-01-28 09:48:57 EET
Farsmo, did you compile the bindings yourself or use Roman's packages?

In any case, since this is a crasher issue and a regression (I take?), I'm
prioritizing this P1.
Comment 3 Farsmo 2011-01-28 15:16:24 EET
It's not a regression because that example never worked on Windows.

The reason for the crash is that you apparently can't call bindTexture() inside
a glNewList()...glEndList() block.

Qt should definitely detect this if at all possible.


--- a/examples/opengl/textures/textures.py
+++ b/examples/opengl/textures/textures.py
@@ -89,6 +89,7 @@ class GLWidget(QtOpenGL.QGLWidget):

     def initializeGL(self):
         if not GLWidget.sharedObject:
+            self.textures =
[self.bindTexture(QtGui.QPixmap(":/images/side%d.png" % (i + 1))) for i in
range(6)]
             GLWidget.sharedObject = self.makeObject()
         GLWidget.refCount += 1

@@ -137,7 +138,7 @@ class GLWidget(QtOpenGL.QGLWidget):
         glNewList(dlist, GL_COMPILE)

         for i in range(6):
-            self.bindTexture(QtGui.QPixmap(":/images/side%d.png" % (i + 1)))
+            glBindTexture(GL_TEXTURE_2D, self.textures[i])

             glBegin(GL_QUADS)
             for j in range(4):
Comment 4 Farsmo 2011-01-28 15:31:25 EET
I reported http://bugreports.qt.nokia.com/browse/QTBUG-17011
Comment 5 Hugo Parente Lima 2011-01-28 17:55:08 EET
I don't think Qt should detect this, this is an OpenGL error, if you have a
OpenGL function call in the wrong place is your fault not Qt fault, besides
OpenGL is another library.

The example works on Linux, maybe due to different OpenGL implementations, btw
if you could provide a patch to the example it would be nice :-)
Comment 6 Hugo Parente Lima 2011-01-28 18:08:53 EET
Oops, I did wait too much to replay after read and forgot that there's a patch,
duh! sorry.
Comment 7 Hugo Parente Lima 2011-01-28 20:38:24 EET
Can you check if after the patch bellow the patch still crashing on Windows?

http://qt.gitorious.org/pyside/pyside-examples/commit/c3752cee9ca8648d49e29e5cd519d158abd1d262
Comment 8 Farsmo 2011-01-29 13:49:36 EET
Works fine.
Comment 9 Matti Airas 2011-01-31 04:44:08 EET
OK, since it wasn't a regression, I dropped it back to P2 (although following
the discussion, this should probably be RESOLVED FIXED, right?)...
Comment 10 renato filho 2011-02-02 15:46:12 EET
released on beta 5