Added a template function to simplify vertex buffer creation.