From 5eed1256ef9d959be74666cd4ecc8fba23342d62 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 24 Apr 2011 21:03:14 -0400 Subject: [PATCH] allocate client-side data for VBO --- WFObj.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/WFObj.cc b/WFObj.cc index ca38f5a..8234c42 100644 --- a/WFObj.cc +++ b/WFObj.cc @@ -478,6 +478,12 @@ bool WFObj::buildVBO() } if (texture_ref_count == 0) do_textures = false; + size_t n_floats_per_vref = + 3 + /* vertex coordinates */ + (do_textures ? 2 : 0) + /* texture coordinates */ + 3; /* normal coordinates */ + GLfloat * data = new GLfloat[n_floats_per_vref * flat_vertices.size()]; + delete[] data; return true; }