<p>I used <code>MESA_DEBUG=1</code> (<a href="https://www.mesa3d.org/debugging.html" rel="nofollow noreferrer">Debugging Tips | mesa3d.org</a>, <a href="https://www.mesa3d.org/envvars.html" rel="nofollow noreferrer">Environment Variables | mesa3d.org</a>) and found out that <code>glEnable(TEXTURE_2D)</code> was causing the error.</p>

<p>I don't know why it only got triggered on the <code>glDrawArrays</code> (maybe weird bindings) but when I removed that call it no longer failed with <code>GL_INVALID_ENUM</code>.</p>

CC BY-SA 3.0
2017-05-08T05:21:21.710Z
2018-04-24T07:45:34.880Z
2018-04-24T07:45:34.880Z
David Kraeutmann
<p>I'm on OpenGL ES 3.0 using Mesa 17.0.3. When calling 
<code>glDrawArrays(GL_TRIANGLE_FAN, 0, 4)</code>, 
<code>glGetError()</code> returns <code>GL_INVALID_ENUM</code>. </p>

<p>I have no idea what's causing it and <a href="https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glDrawArrays.xhtml" rel="nofollow noreferrer">https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glDrawArrays.xhtml</a> is claiming that GL_TRIANGLE_FAN is an accepted value for <code>mode</code>.</p>

<p>I'm checking for GL errors immediately before the call, and everything's fine then.</p>

<opengl>
glDrawArrays is failing with GL_INVALID_ENUM
David Kraeutmann
# glDrawArrays is failing with GL_INVALID_ENUM

(Asked by: username_0 on 2017-05-07)

I'm on OpenGL ES 3.0 using Mesa 17.0.3. When calling
`glDrawArrays(GL_TRIANGLE_FAN, 0, 4)`,
`glGetError()` returns `GL_INVALID_ENUM`.

I have no idea what's causing it and <https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glDrawArrays.xhtml> is claiming that GL\_TRIANGLE\_FAN is an accepted value for `mode`.

I'm checking for GL errors immediately before the call, and everything's fine then.

**Tags:** opengl


---

## 1 answers

### Answer by username_0 on 2017-05-08. Score: 1 | Accepted answer

I used `MESA_DEBUG=1` ([Debugging Tips | mesa3d.org](https://www.mesa3d.org/debugging.html), [Environment Variables | mesa3d.org](https://www.mesa3d.org/envvars.html)) and found out that `glEnable(TEXTURE_2D)` was causing the error.

I don't know why it only got triggered on the `glDrawArrays` (maybe weird bindings) but when I removed that call it no longer failed with `GL_INVALID_ENUM`.


---

