blob: 1db36e1aa6353f0f5aaa462e675eb69991c5c658 [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 Samsa89371c2009-06-30 14:13:04 -070060 };
61
Jason Samsa5597fc2009-07-08 18:01:53 -070062 Verticies_t * mVerticies;
63 uint32_t mVerticiesCount;
64
65 Primitive_t ** mPrimitives;
66 uint32_t mPrimitivesCount;
67
68
Jason Samsa89371c2009-06-30 14:13:04 -070069
70 void analyzeElement();
71protected:
72};
73
74class MeshContext
75{
76public:
77 MeshContext();
78 ~MeshContext();
79
80};
81
82
83}
84}
85#endif //ANDROID_RS_TRIANGLE_MESH_H
86
87