GLint i;
assert(!ctx->CompileFlag);
- assert(ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1);
+ assert(ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END);
CALL_Begin(GET_DISPATCH(), (mode));
for (i = 0; i < count; i++)
GLint i;
assert(!ctx->CompileFlag);
- assert(ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1);
+ assert(ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END);
/* Here, indices will already reflect the buffer object if active */
GLuint last_prim = tnl->vtx.prim[tnl->vtx.prim_count-1].mode;
GLuint last_count;
- if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) {
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
GLint i = tnl->vtx.prim_count - 1;
assert(i >= 0);
tnl->vtx.prim[i].count = ((tnl->vtx.initial_counter -
*/
assert(tnl->vtx.prim_count == 0);
- if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) {
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
tnl->vtx.prim[0].mode = ctx->Driver.CurrentExecPrimitive;
tnl->vtx.prim[0].start = 0;
tnl->vtx.prim[0].count = 0;
{
GET_CURRENT_CONTEXT( ctx );
- if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) {
+ if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
+ /* we're not inside a glBegin/End pair */
TNLcontext *tnl = TNL_CONTEXT(ctx);
int i;
ctx->Driver.CurrentExecPrimitive = mode;
}
- else
+ else {
+ /* already inside glBegin/End */
_mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
-
+ }
}
+
static void GLAPIENTRY _tnl_End( void )
{
GET_CURRENT_CONTEXT( ctx );
- if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) {
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
TNLcontext *tnl = TNL_CONTEXT(ctx);
int idx = tnl->vtx.initial_counter - tnl->vtx.counter;
int i = tnl->vtx.prim_count - 1;
tnl->vtx.prim[i].mode |= PRIM_END;
tnl->vtx.prim[i].count = idx - tnl->vtx.prim[i].start;
- ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
+ ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
/* Two choices which effect the way vertex attributes are
* carried over (or not) between adjacent primitives.