Changeset 1963 for trunk/tutorial


Ignore:
Timestamp:
Oct 1, 2012, 1:49:53 AM (8 years ago)
Author:
sam
Message:

gpu: add support for triangle strips and fans, and change the DrawElement
calls so that they take a number of vertices or indexes, not elements.

Location:
trunk/tutorial
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tutorial/01_triangle.cpp

    r1647 r1963  
    6060        m_vdecl->SetStream(m_vbo, m_coord);
    6161        m_vdecl->Bind();
    62         m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 1);
     62        m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 3);
    6363        m_vdecl->Unbind();
    6464    }
  • trunk/tutorial/02_cube.cpp

    r1647 r1963  
    113113        m_ibo->Bind();
    114114        m_vdecl->DrawIndexedElements(MeshPrimitive::Triangles, 0, 0,
    115                                      m_mesh.Count(), 0, m_indices.Count());
     115                                     m_mesh.Count(), 0, m_indices.Count() * 3);
    116116        m_ibo->Unbind();
    117117        m_vdecl->Unbind();
  • trunk/tutorial/03_noise.cpp

    r1827 r1963  
    6969        m_vdecl->SetStream(m_vbo, m_coord);
    7070        m_vdecl->Bind();
    71         m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 2);
     71        m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 6);
    7272        m_vdecl->Unbind();
    7373    }
  • trunk/tutorial/08_fbo.cpp

    r1817 r1963  
    100100        m_vdecl->SetStream(m_vbo, m_coord);
    101101        m_vdecl->Bind();
    102         m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 2);
     102        m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 6);
    103103        m_vdecl->Unbind();
    104104#endif
     
    109109        m_vdecl->SetStream(m_vbo, m_coord);
    110110        m_vdecl->Bind();
    111         m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 2);
     111        m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 6);
    112112        m_vdecl->Unbind();
    113113        m_shader->Unbind();
     
    119119        m_vdecl->SetStream(m_vbo, m_coord);
    120120        m_vdecl->Bind();
    121         m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 2);
     121        m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 6);
    122122        m_vdecl->Unbind();
    123123        m_shader->Unbind();
  • trunk/tutorial/11_fractal.cpp

    r1921 r1963  
    579579#else
    580580#endif
    581         m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 2);
     581        m_vdecl->DrawElements(MeshPrimitive::Triangles, 0, 6);
    582582        m_vdecl->Unbind();
    583583    }
Note: See TracChangeset for help on using the changeset viewer.