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. GlTexImage2D GL_INVALID_OPERATION on RGBA data

GlTexImage2D GL_INVALID_OPERATION on RGBA data

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.4k 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.
  • M Offline
    M Offline
    Michael.R.LegakoL-3com.com
    wrote on last edited by
    #1

    Hello everybody,
    In the process or creating a texture of RGBA data, I execute the command:

    glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,(GLsizei)m_bsize[0],(GLsizei)m_bsize[1],0,GL_RGBA,GL_UNSIGNED_INT_8_8_8_8_REV,m_ptr);
    

    This call causes glGetError() to return GL_OPERATION_INVALID. As there are many different reasons why that particular error can be generated for this function, I'm hoping somebody has in the past worked with RGBA data and can give me something to check for. Thus far whatever the problem is, I haven't found it.

    m_ptr is of type unsigned char*, but actually stores the RGB data in 4 byte blocks of RED,BLUE,GREEN,ALPHA values at offsets of 0,1,2,3 respectively. bsize[0] is the width, and bsize[1] is the height of the image.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Michael.R.LegakoL-3com.com
      wrote on last edited by
      #2

      I see that nobody posted a reply for this post I made a month ago (almost). Actually, this is an OpenGL issue, not a QT issue for starters. Qt does support OpenGL, and does have various functions to support it, but this particular problem turned out to be solely an OpenGL issue. In short, the problem I had was that I was creating my texture using one set of m_bsize[2] (width,height), but then creating the texture using this command with a different bsize[2]. Everything else in the command is correct. I've discovered that OpenGL has functions that can retrieve the size of a previously created texture, so if anybody else should have this issue, I highly reccomend retrieving this state information from the object instead of trying to maintain the object state yourself (which was the mistake I made).

      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