diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2013-01-15 13:35:11 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:48:52 +0300 |
commit | b26e2d91eafcf5f45145ddd54e1717f7930cbae4 (patch) | |
tree | e9ca9aa589dc166b941009a06fe6f188fc3b1876 | |
parent | 178f6fa4fa3c8718c2f978ee7f8833c1470d402b (diff) |
added helper function GeometryBatcher::addTexturedStripStrided for array of m2::PointD points.
-rw-r--r-- | graphics/geometry_batcher.cpp | 31 | ||||
-rw-r--r-- | graphics/geometry_batcher.hpp | 10 |
2 files changed, 41 insertions, 0 deletions
diff --git a/graphics/geometry_batcher.cpp b/graphics/geometry_batcher.cpp index 574abdd010..d0290024d5 100644 --- a/graphics/geometry_batcher.cpp +++ b/graphics/geometry_batcher.cpp @@ -510,6 +510,37 @@ namespace graphics addTriangleStrip(&vs, size, pipelineID); } + void GeometryBatcher::addTexturedStripStrided( + m2::PointD const * coords, + size_t coordsStride, + m2::PointF const * normals, + size_t normalsStride, + m2::PointF const * texCoords, + size_t texCoordsStride, + unsigned size, + double depth, + int pipelineID) + { + VertexStream vs; + + vs.m_dPos.m_x = (double*)(coords); + vs.m_dPos.m_xStride = coordsStride; + vs.m_dPos.m_y = (double*)(coords) + 1; + vs.m_dPos.m_yStride = coordsStride; + vs.m_dPos.m_z = (double*)(&depth); + vs.m_dPos.m_zStride = 0; + vs.m_fNormal.m_x = (float*)(normals); + vs.m_fNormal.m_xStride = normalsStride; + vs.m_fNormal.m_y = (float*)(normals) + 1; + vs.m_fNormal.m_yStride = normalsStride; + vs.m_fTex.m_u = (float*)(texCoords); + vs.m_fTex.m_uStride = texCoordsStride; + vs.m_fTex.m_v = (float*)(texCoords) + 1; + vs.m_fTex.m_vStride = texCoordsStride; + + addTriangleStrip(&vs, size, pipelineID); + } + void GeometryBatcher::addTexturedListStrided( m2::PointD const * coords, size_t coordsStride, diff --git a/graphics/geometry_batcher.hpp b/graphics/geometry_batcher.hpp index d05e77e3bd..d90d033f63 100644 --- a/graphics/geometry_batcher.hpp +++ b/graphics/geometry_batcher.hpp @@ -141,6 +141,16 @@ namespace graphics double depth, int pipelineID); + void addTexturedStripStrided(m2::PointD const * coords, + size_t coordsStride, + m2::PointF const * normals, + size_t normalsStride, + m2::PointF const * texCoords, + size_t texCoordsStride, + unsigned size, + double depth, + int pipelineID); + void addTexturedList(m2::PointF const * coords, m2::PointF const * texCoords, m2::PointF const * normalCoords, |