-1

The code I am working on (Python+PyOpenGL) runs w/o problems on:

  1. GL Version: 4.2.12217 Compatibility Profile Context 12.104.0.0, GL Renderer: AMD Radeon HD 6300M Series, GL Vendor: ATI Technologies Inc.
  2. GL Version: 4.4.0, GL Renderer: NVS 5400M/PCIe/SSE2, GL Vendor: NVIDIA Corporation

but it returns an error when I try to run the code on integrated GPU:

  1. GL Version: 4.0.0 - Build 9.17.10.2843, GL Renderer: Intel(R) HD Graphics 4000, GL Vendor: Intel

The OpenGL versions are different... Can anyone know what in particular is causing error and can (and how) it be fixed?

Error:

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'

Code:

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)
lskrinjar
  • 5,483
  • 7
  • 29
  • 54
  • Check which versions of Python and any relevant libraries you are using on the respective computer. As you may know, things may differ between Python 2 and 3, including syntax used by libraries to follow the convention of Python 2 and 3 respectively. – nitro2k01 Dec 02 '13 at 09:27
  • @nitro2k01 The laptop has two GPUs; standalone NVIDIA (see no. 2 on the list) and the integrated one that returns the error, therefore it runs on same os and Python versions. I think I can exclude this out. – lskrinjar Dec 02 '13 at 09:39

1 Answers1

1
glEnable(GL_VERTEX_ARRAY)

GL_INVALID_ENUM

Does that answers your question?

keltar
  • 17,711
  • 2
  • 37
  • 42
  • If I understand you answer correctly, I would say that the OpenGL on integrated GPU intel HD 4000 does not support this function? What can be done to fix it, as this function is the base of my code? – lskrinjar Dec 02 '13 at 09:43
  • 1
    No, i'm saying that passing `GL_VERTEX_ARRAY` to `glEnable` is incorrect - that's exactly what your error message saying (and GL specification confirms). Just remove this line, it does nothing aside from generating GL_INVALID_ENUM. – keltar Dec 02 '13 at 09:45