blob: 1e5c908a0c505acee01d6f5afe8d4c20230d67d0 [file] [log] [blame]
Jason Samse5ffb872009-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 Samse514b452009-09-25 14:51:22 -070032 SimpleMesh(Context *);
Jason Samse5ffb872009-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
48 void render() const;
49 void renderRange(uint32_t start, uint32_t len) const;
Jason Samsa2b54c42009-09-23 16:38:37 -070050 void uploadAll();
Jason Samse5ffb872009-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