glDrawElements reporting invalid enum

I’ve looked at the docs, I’ve check the call and it’s values multiple times, I cannot find a reason for glDrawElements to report an invalid enum:

Debug Message: 'GL_INVALID_ENUM', GL_INVALID_ENUM in glDrawElements
~
void DrawSymbol( SYMBOL *S, uint used, uint draw )
	{ TYPE *T = Types + S->type; glDrawElements( draw, used, T->type, NULL ); }
~
		glVertexArrayElementBuffer( Layout.id, bCache.id );

		BindSymbol( &Layout, &sPoint, &bPoint );
		DrawSymbol( &sPoint, 3, GL_TRIANGLES );

		BindSymbol( &Layout, &sColor, &bColor );
		DrawSymbol( &sColor, 3, GL_TRIANGLES );

Btw this is in the separate project I spoke of before that’s meant for me to get a line by line understanding of what should be called so I can see why I’m still not getting triangles with data not given directly in the shaders.

Any ideas what is causing the message?

What is the value of T->type? Don’t just check your code, verify your assumptions by also checking it in a debugger and ensuring that the value actually being used is what you expect it to be.

Ah that was it, forgot that I needed to ignore symbol type and use TYPE_UINT, was telling it that it was a TYPE_VEC3 which used GL_FLOAT, still no triangle on screen though, no more dbeug messages either, I’ll zip it up and upload so you can take a look, the project is small enough that you’d be done looking in at most 5mim.

Edit:
https://drive.google.com/file/d/11zZZOuZHS2K7iMeabcaRg6tE3EbMuPeo/view?usp=sharing

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.