blob: 0ecd78603ad64d458952dd45002f1375778113ea [file] [log] [blame]
Alex Sakhartchouk14607a62012-03-21 09:58:15 -07001/*
2 * Copyright (C) 2012 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
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070017/** @file rs_mesh.rsh
18 * \brief Mesh routines
19 *
20 *
21 */
22
23#ifndef __RS_MESH_RSH__
24#define __RS_MESH_RSH__
25
Alex Sakhartchouk340d15a2012-04-16 13:50:40 -070026// New API's
Alex Sakhartchouk3c0c6062012-03-22 16:59:38 -070027#if (defined(RS_VERSION) && (RS_VERSION >= 16))
28
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070029/**
Alex Sakhartchouk340d15a2012-04-16 13:50:40 -070030 * Returns the number of allocations in the mesh that contain
31 * vertex data
32 *
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070033 * @param m mesh to get data from
34 * @return number of allocations in the mesh that contain vertex
35 * data
36 */
37extern uint32_t __attribute__((overloadable))
Alex Sakhartchoukf8e195e2012-03-22 10:50:55 -070038 rsgMeshGetVertexAllocationCount(rs_mesh m);
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070039
40/**
Alex Sakhartchouk340d15a2012-04-16 13:50:40 -070041 * Meshes could have multiple index sets, this function returns
42 * the number.
43 *
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070044 * @param m mesh to get data from
45 * @return number of primitive groups in the mesh. This would
46 * include simple primitives as well as allocations
47 * containing index data
48 */
49extern uint32_t __attribute__((overloadable))
Alex Sakhartchoukf8e195e2012-03-22 10:50:55 -070050 rsgMeshGetPrimitiveCount(rs_mesh m);
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070051
52/**
Alex Sakhartchouk340d15a2012-04-16 13:50:40 -070053 * Returns an allocation that is part of the mesh and contains
54 * vertex data, e.g. positions, normals, texcoords
55 *
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070056 * @param m mesh to get data from
57 * @param index index of the vertex allocation
58 * @return allocation containing vertex data
59 */
60extern rs_allocation __attribute__((overloadable))
Alex Sakhartchoukf8e195e2012-03-22 10:50:55 -070061 rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index);
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070062
63/**
Alex Sakhartchouk340d15a2012-04-16 13:50:40 -070064 * Returns an allocation containing index data or a null
65 * allocation if only the primitive is specified
66 *
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070067 * @param m mesh to get data from
68 * @param index index of the index allocation
69 * @return allocation containing index data
70 */
71extern rs_allocation __attribute__((overloadable))
Alex Sakhartchoukf8e195e2012-03-22 10:50:55 -070072 rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index);
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070073
74/**
Alex Sakhartchouk340d15a2012-04-16 13:50:40 -070075 * Returns the primitive describing how a part of the mesh is
76 * rendered
77 *
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070078 * @param m mesh to get data from
79 * @param index index of the primitive
80 * @return primitive describing how the mesh is rendered
81 */
82extern rs_primitive __attribute__((overloadable))
Alex Sakhartchoukf8e195e2012-03-22 10:50:55 -070083 rsgMeshGetPrimitive(rs_mesh m, uint32_t index);
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070084
Alex Sakhartchouk3c0c6062012-03-22 16:59:38 -070085#endif // (defined(RS_VERSION) && (RS_VERSION >= 16))
86
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070087#endif // __RS_MESH_RSH__
88