Changeset 1466


Ignore:
Timestamp:
Jun 14, 2012, 2:52:02 AM (7 years ago)
Author:
sam
Message:

gpu: add GL points support to the primitive rendering.

Location:
trunk/src/gpu
Files:
2 edited

Legend:

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

    r1450 r1466  
    139139            Abort();
    140140        break;
     141    case MeshPrimitive::Points:
     142        if (FAILED(g_d3ddevice->DrawPrimitive(D3DPT_POINTLIST, skip, count)))
     143            Abort();
     144        break;
    141145    }
    142146#else
     
    155159        glDrawArrays(GL_TRIANGLES, skip * 3, count * 3);
    156160        break;
     161    case MeshPrimitive::Points:
     162        glDrawArrays(GL_POINTS, skip, count);
     163        break;
    157164    }
    158165#endif
     
    177184            Abort();
    178185        break;
     186    case MeshPrimitive::Points:
     187        if (FAILED(g_d3ddevice->DrawIndexedPrimitive(D3DPT_POINTLIST, vbase, vskip, vcount, skip, count)))
     188            Abort();
     189        break;
    179190    }
    180191#else
     
    191202        /* FIXME: ignores most of the arguments! */
    192203        glDrawElements(GL_TRIANGLES, count * 3, GL_UNSIGNED_SHORT, 0);
     204        break;
     205    case MeshPrimitive::Points:
     206        /* FIXME: ignores most of the arguments! */
     207        glDrawElements(GL_POINTS, count, GL_UNSIGNED_SHORT, 0);
    193208        break;
    194209    }
     
    536551    glBufferData(GL_ARRAY_BUFFER, m_data->m_size, m_data->m_memory,
    537552                 GL_STATIC_DRAW);
     553    glBindBuffer(GL_ARRAY_BUFFER, 0);
    538554#endif
    539555}
  • trunk/src/gpu/vertexbuffer.h

    r1426 r1466  
    6767    {
    6868        Triangles,
     69        Points,
    6970    }
    7071    m_value;
Note: See TracChangeset for help on using the changeset viewer.