c - What is the purpose of surrounding a code block between glBegin and glEnd in brackets? -
what purpose of surrounding code in between call glbegin , glend in brackets? have programmatic or functional purpose or aesthetics , style? code below in c.
glbegin(gl_polygon); glcolor3fv(green); glvertex3fv(block_vertices[0]); glvertex3fv(block_vertices[1]); glvertex3fv(block_vertices[2]); glvertex3fv(block_vertices[3]); glend();
versus
glbegin(gl_polygon); { glcolor3fv(green); glvertex3fv(block_vertices[0]); glvertex3fv(block_vertices[1]); glvertex3fv(block_vertices[2]); glvertex3fv(block_vertices[3]); } glend();
the reason style, because somehow feels right programmer wrote it.
it might have made sense if he/she introducing local variables (i.e. looping create vertices), in c99 , later that's not necessary either.
Comments
Post a Comment