Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions include/pangolin/gl/glvbo.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ inline void RenderVboIbo(GlBuffer& vbo, GlBuffer& ibo, bool draw_mesh)

if(draw_mesh) {
ibo.Bind();
glDrawElements(GL_TRIANGLE_STRIP,ibo.num_elements, ibo.datatype, 0);
if(ibo.count_per_element==1) {
glDrawElements(GL_TRIANGLE_STRIP,ibo.num_elements, ibo.datatype, 0);
}
else {
glDrawElements(GL_TRIANGLES,ibo.num_elements*ibo.count_per_element, ibo.datatype, 0);
}
ibo.Unbind();
}else{
glDrawArrays(GL_POINTS, 0, vbo.num_elements);
Expand Down Expand Up @@ -173,7 +178,12 @@ inline void RenderVboIboCboNbo(GlBuffer& vbo, GlBuffer& ibo, GlBuffer& cbo, GlBu

if(draw_mesh) {
ibo.Bind();
glDrawElements(GL_TRIANGLE_STRIP,ibo.num_elements, ibo.datatype, 0);
if(ibo.count_per_element==1) {
glDrawElements(GL_TRIANGLE_STRIP,ibo.num_elements, ibo.datatype, 0);
}
else {
glDrawElements(GL_TRIANGLES,ibo.num_elements*ibo.count_per_element, ibo.datatype, 0);
}
ibo.Unbind();
}else{
glDrawArrays(GL_POINTS, 0, vbo.num_elements);
Expand Down Expand Up @@ -207,7 +217,12 @@ inline void RenderVboIboNbo(GlBuffer& vbo, GlBuffer& ibo, GlBuffer& nbo, bool dr

if(draw_mesh) {
ibo.Bind();
glDrawElements(GL_TRIANGLE_STRIP,ibo.num_elements, ibo.datatype, 0);
if(ibo.count_per_element==1) {
glDrawElements(GL_TRIANGLE_STRIP,ibo.num_elements, ibo.datatype, 0);
}
else {
glDrawElements(GL_TRIANGLES,ibo.num_elements*ibo.count_per_element, ibo.datatype, 0);
}
ibo.Unbind();
}else{
glDrawArrays(GL_POINTS, 0, vbo.num_elements);
Expand Down