blob: c6d3bc9bd61ef8f26c5787a2c8c20b725383abcd [file] [log] [blame]
Jason Samsa89371c2009-06-30 14:13:04 -07001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_RS_MESH_H
18#define ANDROID_RS_MESH_H
19
20
21#include "RenderScript.h"
22
23// ---------------------------------------------------------------------------
24namespace android {
25namespace renderscript {
26
27
28// An element is a group of Components that occupies one cell in a structure.
29class Mesh : public ObjectBase
30{
31public:
32 Mesh();
33 ~Mesh();
34
35 struct VertexSource_t
36 {
37 const Element * mVertexElement;
38 void * mVertexData;
39 size_t mVertexDataSize;
40
41 size_t mOffsetCoord;
42 size_t mOffsetTex;
43 size_t mOffsetNorm;
44
45 size_t mSizeCoord;
46 size_t mSizeTex;
47 size_t mSizeNorm;
48
49 uint32_t mBufferObject;
50 };
51
52 struct Primitive_t
53 {
54 RsPrimitive mType;
55 const Element * mIndexElement;
56 void * mVertexData;
57 size_t mIndexDataSize;
58
59 uint32_t mBufferObject;
60 };
61
62 VertexSource_t * mSources;
63 Primitive_t * mPrimitives;
64 uint32_t mPrimitiveCount;
65
66 void analyzeElement();
67protected:
68};
69
70class MeshContext
71{
72public:
73 MeshContext();
74 ~MeshContext();
75
76};
77
78
79}
80}
81#endif //ANDROID_RS_TRIANGLE_MESH_H
82
83