使用Intel HD 4000时出现OpenGL错误

时间:2013-12-02 09:09:46

标签: opengl gpu intel pyopengl

我正在处理的代码(Python + PyOpenGL)运行时没有问题:

  1. GL版本:4.2.12217兼容性配置文件上下文12.104.0.0,GL渲染器:AMD Radeon HD 6300M系列,GL供应商:ATI Technologies Inc.
  2. GL版本:4.4.0,GL渲染器:NVS 5400M / PCIe / SSE2,GL供应商:NVIDIA Corporation
  3. 但是当我尝试在集成GPU上运行代码时它会返回错误:

    1. GL版本:4.0.0 - Build 9.17.10.2843,GL Renderer:Intel(R)HD Graphics 4000,GL供应商:Intel
    2. OpenGL版本不同......任何人都可以知道具体是什么导致错误并且可以(以及如何)修复它?

      错误:

      File "C:\...\visualization_engine_V6.py", line 120, in initializeGL
      self.geometry()
      File "C:\...\visualization_engine_V6.py", line 167, in geometry
      glEnable(GL_VERTEX_ARRAY)
      File "errorchecker.pyx", line 50, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError (src\errorchecker.c:854)
      OpenGL.error.GLError: GLError(
      err = 1280,
      description = 'invalid enumerant',
      baseOperation = glEnable,
      cArguments = (GL_VERTEX_ARRAY,)
      )
      Traceback (most recent call last):
      File "C:\...\visualization_engine_V6.py", line 156, in paintGL
      glBindBuffer(GL_ARRAY_BUFFER, self.vbo_id)
      AttributeError: 'OpenGLWidget' object has no attribute 'vbo_id'
      

      代码:

      glEnableClientState(GL_VERTEX_ARRAY)
      glEnable(GL_VERTEX_ARRAY)
      #    generate a new VBO and get the associated vbo_id
      _id = 1
      self.vbo_id = glGenBuffers (_id)
      #    bind VBO in order to use
      glBindBuffer(GL_ARRAY_BUFFER, self.vbo_id)
      #    upload data to VBO
      vertices = model_loader.Model_loader(filename = "udarni_vzvod.stl").vertices
      self.N_vertices = len(vertices)
      #    data size in bytes
      self.dataSize = arrays.ArrayDatatype.arrayByteCount(vertices)
      glBufferData(GL_ARRAY_BUFFER, self.dataSize, vertices, GL_STATIC_DRAW)
      glBindBuffer(GL_ARRAY_BUFFER, self.vbo_id)
      glDisableClientState(GL_VERTEX_ARRAY)
      

1 个答案:

答案 0 :(得分:1)

glEnable(GL_VERTEX_ARRAY)

GL_INVALID_ENUM

这会回答你的问题吗?