summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-03-29 16:33:47 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-03-29 16:33:47 -0700
commitac4e4607b8bde0fa05af75da5f873ef42e3c5918 (patch)
treed7c4e24a69d2b4e3a8d5bbe333795db98c4cb156 /indra/llrender
parente69aa18c0dfbef2fa3bbefeba08fa1c258c69fb3 (diff)
parent1aecac62eb88125546057be2a2a70a6b2eba1a57 (diff)
Merge
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llvertexbuffer.cpp16
-rw-r--r--indra/llrender/llvertexbuffer.h2
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