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_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: 32 SimpleMesh(Context *); 33 ~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(Context *) const; 49 void renderRange(Context *, uint32_t start, uint32_t len) const; 50 void uploadAll(Context *); 51 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 70