i'm trying learn modern opengl this site , i'm on vertex arrays. know can minimise opengl function calls using gldrawarrays instead of glvertex**() each vertex. from point both functions should result in same output, i'm getting additional drawing didn't make through gldrawarrays() . here code (vertices , display() ) float triangles[]={ 0.0f, 5.0f, 0.0f, -5.0f, -5.0f, -4.0f, 5.0f, -5.0f, -4.0f, 0.0f, 5.0f, 0.0f, -5.0f, -5.0f, 4.0f, 5.0f, -5.0f, 4.0f, 0.0f, 5.0f, 0.0f, -5.0f, -5.0f, -4.0f, -5.0f, -5.0f, 4.0f, 0.0f, 5.0f, 0.0f, 5.0f, -5.0f, -4.0f, 5.0f, -5.0f, 4.0f,}; void display(void) { glclear (gl_color_buffer_bit | gl_depth_buffer_bit); glcolor3f(0.1f, 1.0f, 0.0f); glenableclientstate(gl_vertex_array); glvertexpointer(3, gl_float, 0, triangles); gldrawarrays(gl_triangles, 0, sizeof(triangles)); gldisableclientstate(gl_vertex_array); glflush (); // try commneting glflush() } and when run program, creates 3d triangle programmed, 2d square shape...