summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsMesh.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs/rsMesh.h')
-rw-r--r--libs/rs/rsMesh.h49
1 files changed, 20 insertions, 29 deletions
diff --git a/libs/rs/rsMesh.h b/libs/rs/rsMesh.h
index 5201abd..765a971 100644
--- a/libs/rs/rsMesh.h
+++ b/libs/rs/rsMesh.h
@@ -32,45 +32,35 @@ public:
Mesh(Context *);
~Mesh();
- struct Verticies_t
- {
- Allocation ** mAllocations;
- uint32_t mAllocationCount;
-
- size_t mVertexDataSize;
-
- size_t mOffsetCoord;
- size_t mOffsetTex;
- size_t mOffsetNorm;
-
- size_t mSizeCoord;
- size_t mSizeTex;
- size_t mSizeNorm;
-
- uint32_t mBufferObject;
- };
-
+ // Contains vertex data
+ // Position, normal, texcoord, etc could either be strided in one allocation
+ // of provided separetely in multiple ones
+ ObjectBaseRef<Allocation> *mVertexBuffers;
+ uint32_t mVertexBufferCount;
+
+ // Either mIndexBuffer, mPrimitiveBuffer or both could have a NULL reference
+ // If both are null, mPrimitive only would be used to render the mesh
struct Primitive_t
{
- RsPrimitive mType;
- Verticies_t *mVerticies;
-
- uint32_t mIndexCount;
- uint16_t *mIndicies;
+ ObjectBaseRef<Allocation> mIndexBuffer;
- uint32_t mRestartCounts;
- uint16_t *mRestarts;
+ RsPrimitive mPrimitive;
+ uint32_t mGLPrimitive;
};
- Verticies_t * mVerticies;
- uint32_t mVerticiesCount;
-
Primitive_t ** mPrimitives;
uint32_t mPrimitivesCount;
+ void render(Context *) const;
+ void renderPrimitive(Context *, uint32_t primIndex) const;
+ void renderPrimitiveRange(Context *, uint32_t primIndex, uint32_t start, uint32_t len) const;
+ void uploadAll(Context *);
+ void updateGLPrimitives();
+ virtual void serialize(OStream *stream) const;
+ virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_MESH; }
+ static Mesh *createFromStream(Context *rsc, IStream *stream);
- void analyzeElement();
protected:
};
@@ -88,3 +78,4 @@ public:
#endif //ANDROID_RS_TRIANGLE_MESH_H
+