Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1511

QtGui.QOpenGLFunctions is missing binding to glShaderSource()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.4
    • 5.12.3, 5.15.2
    • PySide
    • None
    • PySide2
    • All
    • adf0babe9b006034ae10ac2df0fc45df6acb8478 (pyside/pyside-setup/dev) 22e51cb9b490edc113b0564c493ece0d6730de64 (pyside/tqtc-pyside-setup/tqtc/lts-5.15) f96e2fc175f073c823d208fbf068ebd621dfb593 (pyside/pyside-setup/6.0)

    Description

      AttributeError: 'PySide2.QtGui.QOpenGLFunctions' object has no attribute 'glShaderSource'
      

      Furthermore, glShaderSource is also missing in the https://doc.qt.io/qtforpython-5/PySide2/QtGui/QOpenGLFunctions.html

       

      Does anyone use QOpenGLFunctions with PySide2? Because how then you can use it without shaders? It seems that the binding is missing for a long time. 

       

      Is there any quick workaround for a missing binding? Ex. add the binding by yourself to the QOpenGLFunctions object. I'm using PySide2.

       


      from OpenGL import GL
      from PySide2 import QtGui
      
      
      if __name__ == "__main__":
          app = QtGui.QGuiApplication()
          off_screen = QtGui.QOffscreenSurface()
          off_screen.create()
          if off_screen.isValid():
              context = QtGui.QOpenGLContext()
              if context.create():
                  context.makeCurrent(off_screen)
      
                  ###
                  f = QtGui.QOpenGLFunctions(context)
                  shader = f.glCreateShader(GL.GL_VERTEX_SHADER)
                  f.glShaderSource(shader, "") # <-AttributeError
                  f.glCompileShader(shader)
                  ####
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            oortjacek Jacek Drewniak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes