blob: 6defbdaadea2218583ce2fa688722a7429493f8f [file] [log] [blame]
Jason Sams1bada8c2009-08-09 17:01:55 -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_SIMPLE_MESH_H
18#define ANDROID_RS_SIMPLE_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 SimpleMesh : public ObjectBase
30{
31public:
Jason Samsa9e7a052009-09-25 14:51:22 -070032 SimpleMesh(Context *);
Jason Sams1bada8c2009-08-09 17:01:55 -070033 ~SimpleMesh();
34
35 ObjectBaseRef<const Type> mIndexType;
36 ObjectBaseRef<const Type> mPrimitiveType;
37 ObjectBaseRef<const Type> *mVertexTypes;
38 uint32_t mVertexTypeCount;
39
40 ObjectBaseRef<Allocation> mIndexBuffer;
41 ObjectBaseRef<Allocation> mPrimitiveBuffer;
42 ObjectBaseRef<Allocation> *mVertexBuffers;
43
44 RsPrimitive mPrimitive;
45 uint32_t mGLPrimitive;
46
47
Jason Samsbb51c402009-11-25 13:22:07 -080048 void render(Context *) const;
49 void renderRange(Context *, uint32_t start, uint32_t len) const;
50 void uploadAll(Context *);
Jason Sams1bada8c2009-08-09 17:01:55 -070051
52
53protected:
54};
55
56class SimpleMeshContext
57{
58public:
59 SimpleMeshContext();
60 ~SimpleMeshContext();
61
62
63};
64
65
66}
67}
68#endif //ANDROID_RS_SIMPLE_MESH_H
69