summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-11-16 01:58:19 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-11-16 01:58:19 +0000
commit738f501f731d9b03a1ff130381ea087c05a7ad40 (patch)
tree2ed1a5fb6251818d2e48fb824a63048340e4d3ec /src
parent62620d349bd30fda460f32d3c6ccfa2a093eac90 (diff)
Replace GL_POLYGON+1 with PRIM_OUTSIDE_BEGIN_END
Diffstat (limited to 'src')
-rw-r--r--src/mesa/tnl/t_array_api.c4
-rw-r--r--src/mesa/tnl/t_vtx_api.c17
-rw-r--r--src/mesa/tnl/t_vtx_exec.c2
3 files changed, 13 insertions, 10 deletions
diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c
index 1ad77c5a99..8ceca29c25 100644
--- a/src/mesa/tnl/t_array_api.c
+++ b/src/mesa/tnl/t_array_api.c
@@ -51,7 +51,7 @@ static void fallback_drawarrays( GLcontext *ctx, GLenum mode, GLint start,
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++)
@@ -66,7 +66,7 @@ static void fallback_drawelements( GLcontext *ctx, GLenum mode, GLsizei count,
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 */
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index ae2056971e..0ce6b4ad79 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -68,7 +68,7 @@ static void _tnl_wrap_buffers( GLcontext *ctx )
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 -
@@ -91,7 +91,7 @@ static void _tnl_wrap_buffers( GLcontext *ctx )
*/
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;
@@ -735,7 +735,8 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode )
{
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;
@@ -768,16 +769,18 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode )
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;
@@ -785,7 +788,7 @@ static void GLAPIENTRY _tnl_End( void )
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.
diff --git a/src/mesa/tnl/t_vtx_exec.c b/src/mesa/tnl/t_vtx_exec.c
index b296e439d2..3705a5c96a 100644
--- a/src/mesa/tnl/t_vtx_exec.c
+++ b/src/mesa/tnl/t_vtx_exec.c
@@ -248,7 +248,7 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx )
for (i = 0 ; i < ovf ; i++)
_mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
return i;
- case GL_POLYGON+1:
+ case PRIM_OUTSIDE_BEGIN_END:
return 0;
default:
assert(0);