• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 // ---------------------------------------------------------------------------
24 namespace android {
25 namespace renderscript {
26 
27 
28 // An element is a group of Components that occupies one cell in a structure.
29 class Mesh : public ObjectBase
30 {
31 public:
32     Mesh(Context *);
33     ~Mesh();
34 
35     struct Verticies_t
36     {
37         Allocation ** mAllocations;
38         uint32_t mAllocationCount;
39 
40         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;
56         Verticies_t *mVerticies;
57 
58         uint32_t mIndexCount;
59         uint16_t *mIndicies;
60 
61         uint32_t mRestartCounts;
62         uint16_t *mRestarts;
63     };
64 
65     Verticies_t * mVerticies;
66     uint32_t mVerticiesCount;
67 
68     Primitive_t ** mPrimitives;
69     uint32_t mPrimitivesCount;
70 
71 
72 
73     void analyzeElement();
74 protected:
75 };
76 
77 class MeshContext
78 {
79 public:
80     MeshContext();
81     ~MeshContext();
82 
83 };
84 
85 
86 }
87 }
88 #endif //ANDROID_RS_TRIANGLE_MESH_H
89 
90 
91