Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't use glReadPixels
Forum Updated to NodeBB v4.3 + New Features

Can't use glReadPixels

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GlowingApple
    wrote on last edited by
    #1

    I'm trying to use glReadPixels in my python3 application.

    Here's a segment of my code:

    self.vp = QOpenGLVersionProfile()
    self.vp.setVersion(2,1)
    self.glFunc = QOpenGLContext.currentContext().versionFunctions(self.vp)
    self.glFunc.glReadPixels(...)
    

    Regardless of what I pass to the function, I get an error:

    AttributeError: 'QOpenGLFunctions_2_1' object has no attribute 'glReadPixels'
    

    Any ideas what I'm doing wrong?

    jsulmJ 1 Reply Last reply
    0
    • G GlowingApple

      I'm trying to use glReadPixels in my python3 application.

      Here's a segment of my code:

      self.vp = QOpenGLVersionProfile()
      self.vp.setVersion(2,1)
      self.glFunc = QOpenGLContext.currentContext().versionFunctions(self.vp)
      self.glFunc.glReadPixels(...)
      

      Regardless of what I pass to the function, I get an error:

      AttributeError: 'QOpenGLFunctions_2_1' object has no attribute 'glReadPixels'
      

      Any ideas what I'm doing wrong?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @GlowingApple said in Can't use glReadPixels:

      self.glFunc

      Did you check what self.glFunc contains?

      print(self.glFunc)
      print(dir(self.glFunc))
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GlowingApple
        wrote on last edited by
        #3

        print(self.glFunc) returns

        <PyQt5._QOpenGLFunctions_2_1.QOpenGLFunctions_2_1 object at 0x12217e5e8>
        

        and print(dir(self.glFunc) returns a huge list: https://pastebin.com/QB4fjCBR

        Searching through the list there is no glReadPixels method. There is a GL_READ_PIXELS, but it's not a method, just an int. I searched for other similar functions containing read and/or pixels, but couldn't find anything else that seemed suitable.

        Is glReadPixels not available in OpenGL 2.1?

        I'm using Qt 5.8.0 and PyQt 5.8.0 on macOS 10.12.4 by the way.

        jsulmJ 1 Reply Last reply
        0
        • G GlowingApple

          print(self.glFunc) returns

          <PyQt5._QOpenGLFunctions_2_1.QOpenGLFunctions_2_1 object at 0x12217e5e8>
          

          and print(dir(self.glFunc) returns a huge list: https://pastebin.com/QB4fjCBR

          Searching through the list there is no glReadPixels method. There is a GL_READ_PIXELS, but it's not a method, just an int. I searched for other similar functions containing read and/or pixels, but couldn't find anything else that seemed suitable.

          Is glReadPixels not available in OpenGL 2.1?

          I'm using Qt 5.8.0 and PyQt 5.8.0 on macOS 10.12.4 by the way.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @GlowingApple As far as I know glReadPixels is part of OpenGL 2.1
          But I'm not an OpenGL expert, maybe somebody else can help.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved