blob: 7f592f78e242f47e20c4a2a15559b0c31ad3526f [file] [log] [blame]
Jason Sams326e0dd2009-05-22 14:03:28 -07001/*
2 * Copyright (C) 2007 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 RENDER_SCRIPT_H
18#define RENDER_SCRIPT_H
19
20#include <stdint.h>
21#include <sys/types.h>
22
Jason Sams3715b002012-02-16 16:07:49 -080023#include "rsDefines.h"
Jason Sams6b8552a2010-10-13 15:31:10 -070024
Jason Samsbad80742011-03-16 16:29:28 -070025//
Alex Sakhartchoukdc763f32010-10-27 14:10:07 -070026// A3D loading and object update code.
27// Should only be called at object creation, not thread safe
28RsObjectBase rsaFileA3DGetEntryByIndex(RsContext, uint32_t idx, RsFile);
Alex Sakhartchouk5224a272011-01-07 11:12:08 -080029RsFile rsaFileA3DCreateFromMemory(RsContext, const void *data, uint32_t len);
30RsFile rsaFileA3DCreateFromAsset(RsContext, void *asset);
31RsFile rsaFileA3DCreateFromFile(RsContext, const char *path);
Alex Sakhartchoukdc763f32010-10-27 14:10:07 -070032void rsaFileA3DGetNumIndexEntries(RsContext, int32_t *numEntries, RsFile);
Alex Sakhartchouk31aca7d2011-10-18 11:08:31 -070033void rsaFileA3DGetIndexEntries(RsContext, RsFileIndexEntry *fileEntries,
34 uint32_t numEntries, RsFile);
Alex Sakhartchoukdc763f32010-10-27 14:10:07 -070035void rsaGetName(RsContext, void * obj, const char **name);
36// Mesh update functions
37void rsaMeshGetVertexBufferCount(RsContext, RsMesh, int32_t *vtxCount);
38void rsaMeshGetIndexCount(RsContext, RsMesh, int32_t *idxCount);
39void rsaMeshGetVertices(RsContext, RsMesh, RsAllocation *vtxData, uint32_t vtxDataCount);
Alex Sakhartchouk31aca7d2011-10-18 11:08:31 -070040void rsaMeshGetIndices(RsContext, RsMesh, RsAllocation *va,
41 uint32_t *primType, uint32_t idxDataCount);
Alex Sakhartchoukdc763f32010-10-27 14:10:07 -070042// Allocation update
43const void* rsaAllocationGetType(RsContext con, RsAllocation va);
44// Type update
45void rsaTypeGetNativeData(RsContext, RsType, uint32_t *typeData, uint32_t typeDataSize);
46// Element update
47void rsaElementGetNativeData(RsContext, RsElement, uint32_t *elemData, uint32_t elemDataSize);
Alex Sakhartchouk31aca7d2011-10-18 11:08:31 -070048void rsaElementGetSubElements(RsContext, RsElement, uint32_t *ids, const char **names,
49 uint32_t *arraySizes, uint32_t dataSize);
Jason Sams6b8552a2010-10-13 15:31:10 -070050
Jason Sams789ca832011-05-18 17:36:02 -070051RsDevice rsDeviceCreate();
52void rsDeviceDestroy(RsDevice dev);
53void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value);
Jason Sams14982c82013-02-22 18:17:05 -080054RsContext rsContextCreate(RsDevice dev, uint32_t version, uint32_t sdkVersion,
55 RsContextType ct, bool forceCpu, bool synchronous);
Alex Sakhartchouk31aca7d2011-10-18 11:08:31 -070056RsContext rsContextCreateGL(RsDevice dev, uint32_t version, uint32_t sdkVersion,
57 RsSurfaceConfig sc, uint32_t dpi);
Jason Sams789ca832011-05-18 17:36:02 -070058
Jason Sams326e0dd2009-05-22 14:03:28 -070059#include "rsgApiFuncDecl.h"
Jason Sams326e0dd2009-05-22 14:03:28 -070060
Jason Sams326e0dd2009-05-22 14:03:28 -070061#endif // RENDER_SCRIPT_H
62
63
64