Ignore:
Timestamp:
Feb 25, 2013, 8:43:51 PM (7 years ago)
Author:
sam
Message:

gpu: add MeshPrimitive::Lines enum and modify the cube tutorial
to show how it can be used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/vertexbuffer.cpp

    r2426 r2497  
    155155            Abort();
    156156        break;
     157    case MeshPrimitive::Lines:
     158        if (FAILED(g_d3ddevice->DrawPrimitive(D3DPT_LINELIST,
     159                                              skip, count)))
     160            Abort();
     161        break;
    157162    }
    158163#else
     
    175180    case MeshPrimitive::Points:
    176181        glDrawArrays(GL_POINTS, skip, count);
     182        break;
     183    case MeshPrimitive::Lines:
     184        glDrawArrays(GL_LINES, skip, count);
    177185        break;
    178186    }
     
    218226            Abort();
    219227        break;
     228    case MeshPrimitive::Lines:
     229        if (FAILED(g_d3ddevice->DrawIndexedPrimitive(D3DPT_LINELIST,
     230                                           vbase, vskip, vcount, skip, count)))
     231            Abort();
     232        break;
    220233    }
    221234#else
     
    246259        (void)vbase; (void)vskip; (void)vcount; (void)skip;
    247260        glDrawElements(GL_POINTS, count, GL_UNSIGNED_SHORT, 0);
     261        break;
     262    case MeshPrimitive::Lines:
     263        /* FIXME: ignores most of the arguments! */
     264        (void)vbase; (void)vskip; (void)vcount; (void)skip;
     265        glDrawElements(GL_LINES, count, GL_UNSIGNED_SHORT, 0);
    248266        break;
    249267    }
Note: See TracChangeset for help on using the changeset viewer.