diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-03-30 10:36:27 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-03-30 10:36:27 -0400 |
commit | 865efe9af6cb353fd3b57741ba36239a21794e80 (patch) | |
tree | ce4b83db3ed9af39f9364e41d04283a161b7c64a /indra/llrender | |
parent | e711e8af3d5f560fd93334d44eb7be1e01f02bec (diff) | |
parent | ac4e4607b8bde0fa05af75da5f873ef42e3c5918 (diff) |
merge
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 16 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 0d3f5b81bc..73efbfc999 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -236,6 +236,22 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) } } +//static +void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm) +{ + U32 count = pos.size(); + llassert(norm.size() >= pos.size()); + + unbind(); + + setupClientArrays(MAP_VERTEX | MAP_NORMAL); + + glVertexPointer(3, GL_FLOAT, 0, pos[0].mV); + glNormalPointer(GL_FLOAT, 0, norm[0].mV); + + glDrawArrays(sGLMode[mode], 0, count); +} + void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_offset) const { if (start >= (U32) mRequestedNumVerts || diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 2bbc17fb12..6c0895512e 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -97,6 +97,8 @@ public: static void initClass(bool use_vbo, bool no_vbo_mapping); static void cleanupClass(); static void setupClientArrays(U32 data_mask); + static void drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm); + static void clientCopy(F64 max_time = 0.005); //copy data from client to GL static void unbind(); //unbind any bound vertex buffer |