enum DrawCommandSequenceNV(enum mode, enum indexType, void *address, sizei size)
{
enum modeStrip;
if (mode == TRIANGLES) modeStrip = TRIANGLE_STRIP;
else if (mode == LINES) modeStrip = LINE_STRIP;
else if (mode == LINES_ADJACENCY) modeStrip = LINE_STRIP_ADJACENCY;
else if (mode == TRIANGLES_ADJACENCY) modeStrip = TRIANGLE_STRIP_ADJACENCY;
else if (mode == QUADS) modeStrip = QUAD_STRIP;
else modeStrip = mode;
enum modeSpecial;
if (mode == LINES) modeSpecial = LINE_LOOP;
else if (mode == TRIANGLES) modeSpecial = TRIANGLE_FAN;
else modeSpecial = mode;
void *current = address;
while (current != (ubyte *)address + size) {
uint header = *(uint*)current;
switch( GetTokenType(header)){
case TERMINATE_SEQUENCE_NV:
{
return indexType;
}
break;
case NOP_COMMAND_NV:
break;
case DRAW_ELEMENTS_COMMAND_NV:
{
DrawElementsCommandNV* cmd = (DrawElementsCommandNV*)current;
DrawElementsBaseVertex(mode, cmd->count, indexType, (void*)(cmd->firstIndex * sizeofindextype), cmd->baseVertex);
}
break;
case DRAW_ARRAYS_COMMAND_NV:
{
DrawArraysCommandNV* cmd = (DrawArraysCommandNV*)current;
DrawArrays(mode, cmd->first, cmd->count);
}
break;
case DRAW_ELEMENTS_STRIP_COMMAND_NV:
{
DrawElementsCommandNV* cmd = (DrawElementsCommandNV*)current;
DrawElementsBaseVertex(modeStrip, cmd->count, indexType, (void*)(cmd->firstIndex * sizeofindextype), cmd->baseVertex);
}
break;
...
enum DrawCommandSequenceNV(enum mode, enum indexType, void *address, sizei size)
{
enum modeStrip;
if (mode == TRIANGLES) modeStrip = TRIANGLE_STRIP;
else if (mode == LINES) modeStrip = LINE_STRIP;
else if (mode == LINES_ADJACENCY) modeStrip = LINE_STRIP_ADJACENCY;
else if (mode == TRIANGLES_ADJACENCY) modeStrip = TRIANGLE_STRIP_ADJACENCY;
else if (mode == QUADS) modeStrip = QUAD_STRIP;
else modeStrip = mode;
enum modeSpecial;
if (mode == LINES) modeSpecial = LINE_LOOP;
else if (mode == TRIANGLES) modeSpecial = TRIANGLE_FAN;
else modeSpecial = mode;
void *current = address;
while (current != (ubyte *)address + size) {
uint header = *(uint*)current;
switch( GetTokenType(header)){
case TERMINATE_SEQUENCE_NV:
{
return indexType;
}
break;
case NOP_COMMAND_NV:
break;
case DRAW_ELEMENTS_COMMAND_NV:
{
DrawElementsCommandNV* cmd = (DrawElementsCommandNV*)current;
DrawElementsBaseVertex(mode, cmd->count, indexType, (void*)(cmd->firstIndex * sizeofindextype), cmd->baseVertex);
}
break;
case DRAW_ARRAYS_COMMAND_NV:
{
DrawArraysCommandNV* cmd = (DrawArraysCommandNV*)current;
DrawArrays(mode, cmd->first, cmd->count);
}
break;
case DRAW_ELEMENTS_STRIP_COMMAND_NV:
{
DrawElementsCommandNV* cmd = (DrawElementsCommandNV*)current;
DrawElementsBaseVertex(modeStrip, cmd->count, indexType, (void*)(cmd->firstIndex * sizeofindextype), cmd->baseVertex);
}
break;
...