forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMeshData.bindings.cs
More file actions
65 lines (52 loc) · 4.43 KB
/
Copy pathMeshData.bindings.cs
File metadata and controls
65 lines (52 loc) · 4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using UnityEngine.Bindings;
using UnityEngine.Rendering;
namespace UnityEngine
{
public sealed partial class Mesh
{
[StaticAccessor("MeshDataBindings", StaticAccessorType.DoubleColon)]
[NativeHeader("Runtime/Graphics/Mesh/MeshScriptBindings.h")]
public partial struct MeshData
{
[NativeMethod(IsThreadSafe = true)] static extern bool HasVertexAttribute(IntPtr self, VertexAttribute attr);
[NativeMethod(IsThreadSafe = true)] static extern int GetVertexAttributeDimension(IntPtr self, VertexAttribute attr);
[NativeMethod(IsThreadSafe = true)] static extern VertexAttributeFormat GetVertexAttributeFormat(IntPtr self, VertexAttribute attr);
[NativeMethod(IsThreadSafe = true)] static extern int GetVertexAttributeStream(IntPtr self, VertexAttribute attr);
[NativeMethod(IsThreadSafe = true)] static extern int GetVertexAttributeOffset(IntPtr self, VertexAttribute attr);
[NativeMethod(IsThreadSafe = true)] static extern int GetVertexCount(IntPtr self);
[NativeMethod(IsThreadSafe = true)] static extern int GetVertexBufferCount(IntPtr self);
[NativeMethod(IsThreadSafe = true)] static extern IntPtr GetVertexDataPtr(IntPtr self, int stream);
[NativeMethod(IsThreadSafe = true)] static extern ulong GetVertexDataSize(IntPtr self, int stream);
[NativeMethod(IsThreadSafe = true)] static extern int GetVertexBufferStride(IntPtr self, int stream);
[NativeMethod(IsThreadSafe = true)] static extern void CopyAttributeIntoPtr(IntPtr self, VertexAttribute attr, VertexAttributeFormat format, int dim, IntPtr dst);
[NativeMethod(IsThreadSafe = true)] static extern void CopyIndicesIntoPtr(IntPtr self, int submesh, bool applyBaseVertex, int dstStride, IntPtr dst);
[NativeMethod(IsThreadSafe = true)] static extern IndexFormat GetIndexFormat(IntPtr self);
[NativeMethod(IsThreadSafe = true)] static extern int GetIndexCount(IntPtr self, int submesh);
[NativeMethod(IsThreadSafe = true)] static extern IntPtr GetIndexDataPtr(IntPtr self);
[NativeMethod(IsThreadSafe = true)] static extern ulong GetIndexDataSize(IntPtr self);
[NativeMethod(IsThreadSafe = true)] static extern int GetSubMeshCount(IntPtr self);
[NativeMethod(IsThreadSafe = true, ThrowsException = true)] static extern SubMeshDescriptor GetSubMesh(IntPtr self, int index);
[NativeMethod(IsThreadSafe = true, ThrowsException = true)] static extern void SetVertexBufferParamsFromPtr(IntPtr self, int vertexCount, IntPtr attributesPtr, int attributesCount);
[NativeMethod(IsThreadSafe = true, ThrowsException = true)] static extern void SetVertexBufferParamsFromArray(IntPtr self, int vertexCount, params VertexAttributeDescriptor[] attributes);
[NativeMethod(IsThreadSafe = true, ThrowsException = true)] static extern void SetIndexBufferParamsImpl(IntPtr self, int indexCount, IndexFormat indexFormat);
[NativeMethod(IsThreadSafe = true)] static extern void SetSubMeshCount(IntPtr self, int count);
[NativeMethod(IsThreadSafe = true, ThrowsException = true)] static extern void SetSubMeshImpl(IntPtr self, int index, SubMeshDescriptor desc, MeshUpdateFlags flags);
}
[StaticAccessor("MeshDataArrayBindings", StaticAccessorType.DoubleColon)]
public partial struct MeshDataArray
{
static extern unsafe void AcquireReadOnlyMeshData([NotNull] Mesh mesh, IntPtr* datas);
static extern unsafe void AcquireReadOnlyMeshDatas([NotNull] Mesh[] meshes, IntPtr* datas, int count);
static extern unsafe void AcquireMeshDataCopy([NotNull] Mesh mesh, IntPtr* datas);
static extern unsafe void AcquireMeshDatasCopy([NotNull] Mesh[] meshes, IntPtr* datas, int count);
static extern unsafe void ReleaseMeshDatas(IntPtr* datas, int count);
static extern unsafe void CreateNewMeshDatas(IntPtr* datas, int count);
[NativeThrows] static extern unsafe void ApplyToMeshesImpl([NotNull] Mesh[] meshes, IntPtr* datas, int count, MeshUpdateFlags flags);
[NativeThrows] static extern void ApplyToMeshImpl([NotNull] Mesh mesh, IntPtr data, MeshUpdateFlags flags);
}
}
}