};
/* sanity checks */
- STATIC_ASSERT(Elements(vertAttribs) == VERT_ATTRIB_MAX);
- STATIC_ASSERT(Elements(fragAttribs) == VARYING_SLOT_MAX);
+ STATIC_ASSERT(ARRAY_SIZE(vertAttribs) == VERT_ATTRIB_MAX);
+ STATIC_ASSERT(ARRAY_SIZE(fragAttribs) == VARYING_SLOT_MAX);
assert(strcmp(vertAttribs[VERT_ATTRIB_TEX0], "vertex.texcoord[0]") == 0);
assert(strcmp(vertAttribs[VERT_ATTRIB_GENERIC15], "vertex.attrib[15]") == 0);
assert(strcmp(fragAttribs[VARYING_SLOT_TEX0], "fragment.texcoord[0]") == 0);
assert(strcmp(fragAttribs[VARYING_SLOT_VAR0+15], "fragment.varying[15]") == 0);
if (progType == GL_VERTEX_PROGRAM_ARB) {
- assert(index < Elements(vertAttribs));
+ assert(index < ARRAY_SIZE(vertAttribs));
return vertAttribs[index];
}
else {
assert(progType == GL_FRAGMENT_PROGRAM_ARB);
- assert(index < Elements(fragAttribs));
+ assert(index < ARRAY_SIZE(fragAttribs));
return fragAttribs[index];
}
}
};
/* sanity checks */
- STATIC_ASSERT(Elements(vertResults) == VARYING_SLOT_MAX);
- STATIC_ASSERT(Elements(fragResults) == FRAG_RESULT_MAX);
+ STATIC_ASSERT(ARRAY_SIZE(vertResults) == VARYING_SLOT_MAX);
+ STATIC_ASSERT(ARRAY_SIZE(fragResults) == FRAG_RESULT_MAX);
assert(strcmp(vertResults[VARYING_SLOT_POS], "result.position") == 0);
assert(strcmp(vertResults[VARYING_SLOT_VAR0], "result.varying[0]") == 0);
assert(strcmp(fragResults[FRAG_RESULT_DATA0], "result.color[0]") == 0);
if (progType == GL_VERTEX_PROGRAM_ARB) {
- assert(index < Elements(vertResults));
+ assert(index < ARRAY_SIZE(vertResults));
return vertResults[index];
}
else {
assert(progType == GL_FRAGMENT_PROGRAM_ARB);
- assert(index < Elements(fragResults));
+ assert(index < ARRAY_SIZE(fragResults));
return fragResults[index];
}
}
matrix = &ctx->_ModelProjectMatrix;
}
else if (mat == STATE_TEXTURE_MATRIX) {
- assert(index < Elements(ctx->TextureMatrixStack));
+ assert(index < ARRAY_SIZE(ctx->TextureMatrixStack));
matrix = ctx->TextureMatrixStack[index].Top;
}
else if (mat == STATE_PROGRAM_MATRIX) {
- assert(index < Elements(ctx->ProgramMatrixStack));
+ assert(index < ARRAY_SIZE(ctx->ProgramMatrixStack));
matrix = ctx->ProgramMatrixStack[index].Top;
}
else {