blob: be207a3adab01210dc5b1d1e4bfe0e1b72582904 [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
Jason Samsa5597fc2009-07-08 18:01:53 -070035 struct Verticies_t
Jason Samsa89371c2009-06-30 14:13:04 -070036 {
Jason Samsa5597fc2009-07-08 18:01:53 -070037 Allocation ** mAllocations;
38 uint32_t mAllocationCount;
39
Jason Samsa89371c2009-06-30 14:13:04 -070040 size_t mVertexDataSize;
41
42 size_t mOffsetCoord;
43 size_t mOffsetTex;
44 size_t mOffsetNorm;
45
46 size_t mSizeCoord;
47 size_t mSizeTex;
48 size_t mSizeNorm;
49
50 uint32_t mBufferObject;
51 };
52
53 struct Primitive_t
54 {
55 RsPrimitive mType;
Jason Samsa5597fc2009-07-08 18:01:53 -070056 Verticies_t *mVerticies;
Jason Samsa89371c2009-06-30 14:13:04 -070057
Jason Samsa5597fc2009-07-08 18:01:53 -070058 uint32_t mIndexCount;
59 uint16_t *mIndicies;
Jason Samsb80dfa72009-07-10 17:32:40 -070060
61 uint32_t mRestartCounts;
62 uint16_t *mRestarts;
Jason Samsa89371c2009-06-30 14:13:04 -070063 };
64
Jason Samsa5597fc2009-07-08 18:01:53 -070065 Verticies_t * mVerticies;
66 uint32_t mVerticiesCount;
67
68 Primitive_t ** mPrimitives;
69 uint32_t mPrimitivesCount;
70
71
Jason Samsa89371c2009-06-30 14:13:04 -070072
73 void analyzeElement();
74protected:
75};
76
77class MeshContext
78{
79public:
80 MeshContext();
81 ~MeshContext();
82
83};
84
85
86}
87}
88#endif //ANDROID_RS_TRIANGLE_MESH_H
89
90