mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-09-09 03:01:41 -04:00
Big unsafe update 1
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Raylib_cs
|
||||
/// Wave type, defines audio wave data
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Wave
|
||||
public unsafe struct Wave
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of samples
|
||||
@@ -30,9 +30,9 @@ namespace Raylib_cs
|
||||
public uint channels;
|
||||
|
||||
/// <summary>
|
||||
/// Buffer data pointer (void *)
|
||||
/// Buffer data pointer
|
||||
/// </summary>
|
||||
public IntPtr data;
|
||||
public void* data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -45,7 +45,7 @@ namespace Raylib_cs
|
||||
/// <summary>
|
||||
/// Pointer to internal data(rAudioBuffer *) used by the audio system
|
||||
/// </summary>
|
||||
public IntPtr audioBuffer;
|
||||
public IntPtr buffer;
|
||||
|
||||
/// <summary>
|
||||
/// Frequency (samples per second)
|
||||
@@ -85,7 +85,7 @@ namespace Raylib_cs
|
||||
/// NOTE: Anything longer than ~10 seconds should be streamed
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Music
|
||||
public unsafe struct Music
|
||||
{
|
||||
/// <summary>
|
||||
/// Audio stream
|
||||
@@ -108,8 +108,8 @@ namespace Raylib_cs
|
||||
public int ctxType;
|
||||
|
||||
/// <summary>
|
||||
/// Audio context data, depends on type (void *)
|
||||
/// Audio context data, depends on type
|
||||
/// </summary>
|
||||
public IntPtr ctxData;
|
||||
public void* ctxData;
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ namespace Raylib_cs
|
||||
/// Font, font texture and GlyphInfo array data
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Font
|
||||
public unsafe struct Font
|
||||
{
|
||||
/// <summary>
|
||||
/// Base size (default chars height)
|
||||
@@ -85,11 +85,11 @@ namespace Raylib_cs
|
||||
/// <summary>
|
||||
/// Rectangles in texture for the glyphs
|
||||
/// </summary>
|
||||
public IntPtr recs;
|
||||
public Rectangle* recs;
|
||||
|
||||
/// <summary>
|
||||
/// Glyphs info data
|
||||
/// </summary>
|
||||
public IntPtr glyphs;
|
||||
public GlyphInfo* glyphs;
|
||||
}
|
||||
}
|
||||
|
@@ -119,12 +119,12 @@ namespace Raylib_cs
|
||||
/// Image, pixel data stored in CPU memory (RAM)
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Image
|
||||
public unsafe struct Image
|
||||
{
|
||||
/// <summary>
|
||||
/// Image raw data (void *)
|
||||
/// Image raw data
|
||||
/// </summary>
|
||||
public IntPtr data;
|
||||
public void* data;
|
||||
|
||||
/// <summary>
|
||||
/// Image base width
|
||||
|
@@ -71,7 +71,7 @@ namespace Raylib_cs
|
||||
/// Material type (generic)
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Material
|
||||
public unsafe struct Material
|
||||
{
|
||||
/// <summary>
|
||||
/// Material shader
|
||||
@@ -79,13 +79,13 @@ namespace Raylib_cs
|
||||
public Shader shader;
|
||||
|
||||
/// <summary>
|
||||
/// Material maps (MaterialMap *)
|
||||
/// Material maps
|
||||
/// </summary>
|
||||
public IntPtr maps;
|
||||
public MaterialMap *maps;
|
||||
|
||||
/// <summary>
|
||||
/// Material generic parameters (if required, float *)
|
||||
/// Material generic parameters (if required)
|
||||
/// </summary>
|
||||
public IntPtr param;
|
||||
public float *param;
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ namespace Raylib_cs
|
||||
/// NOTE: Data stored in CPU memory (and GPU)
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Mesh
|
||||
public unsafe struct Mesh
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of vertices stored in arrays
|
||||
@@ -46,63 +46,63 @@ namespace Raylib_cs
|
||||
#region Default vertex data
|
||||
|
||||
/// <summary>
|
||||
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0, float *)
|
||||
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
||||
/// </summary>
|
||||
public IntPtr vertices;
|
||||
public float* vertices;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1, float *)
|
||||
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
||||
/// </summary>
|
||||
public IntPtr texcoords;
|
||||
public float* texcoords;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5, float *)
|
||||
/// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
|
||||
/// </summary>
|
||||
public IntPtr texcoords2;
|
||||
public float* texcoords2;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2, float *)
|
||||
/// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
|
||||
/// </summary>
|
||||
public IntPtr normals;
|
||||
public float* normals;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4, float *)
|
||||
/// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
|
||||
/// </summary>
|
||||
public IntPtr tangents;
|
||||
public float* tangents;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3, unsigned char *)
|
||||
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
||||
/// </summary>
|
||||
public IntPtr colors;
|
||||
public byte* colors;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex indices (in case vertex data comes indexed, unsigned short *)
|
||||
/// Vertex indices (in case vertex data comes indexed)
|
||||
/// </summary>
|
||||
public IntPtr indices;
|
||||
public ushort* indices;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Animation vertex data
|
||||
|
||||
/// <summary>
|
||||
/// Animated vertex positions (after bones transformations, float *)
|
||||
/// Animated vertex positions (after bones transformations)
|
||||
/// </summary>
|
||||
public IntPtr animVertices;
|
||||
public float* animVertices;
|
||||
|
||||
/// <summary>
|
||||
/// Animated normals (after bones transformations, float *)
|
||||
/// Animated normals (after bones transformations)
|
||||
/// </summary>
|
||||
public IntPtr animNormals;
|
||||
public float* animNormals;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex bone ids, up to 4 bones influence by vertex (skinning, int *)
|
||||
/// Vertex bone ids, up to 4 bones influence by vertex (skinning)
|
||||
/// </summary>
|
||||
public IntPtr boneIds;
|
||||
public byte* boneIds;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex bone weight, up to 4 bones influence by vertex (skinning, float *)
|
||||
/// Vertex bone weight, up to 4 bones influence by vertex (skinning)
|
||||
/// </summary>
|
||||
public IntPtr boneWeights;
|
||||
public float* boneWeights;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Raylib_cs
|
||||
/// <summary>
|
||||
/// OpenGL Vertex Buffer Objects id (default vertex data, uint[])
|
||||
/// </summary>
|
||||
public IntPtr vboId;
|
||||
public uint* vboId;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
@@ -8,12 +8,12 @@ namespace Raylib_cs
|
||||
/// Bone information
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct BoneInfo
|
||||
public unsafe struct BoneInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Bone name (char[32])
|
||||
/// </summary>
|
||||
public IntPtr name;
|
||||
public fixed sbyte name[32];
|
||||
|
||||
/// <summary>
|
||||
/// Bone parent
|
||||
@@ -25,7 +25,7 @@ namespace Raylib_cs
|
||||
/// Model type
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Model
|
||||
public unsafe struct Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Local transform matrix
|
||||
@@ -45,17 +45,17 @@ namespace Raylib_cs
|
||||
/// <summary>
|
||||
/// Meshes array (Mesh *)
|
||||
/// </summary>
|
||||
public IntPtr meshes;
|
||||
public Mesh *meshes;
|
||||
|
||||
/// <summary>
|
||||
/// Materials array (Material *)
|
||||
/// </summary>
|
||||
public IntPtr materials;
|
||||
public Material *materials;
|
||||
|
||||
/// <summary>
|
||||
/// Mesh material number (int *)
|
||||
/// </summary>
|
||||
public IntPtr meshMaterial;
|
||||
public int *meshMaterial;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bones
|
||||
@@ -65,19 +65,19 @@ namespace Raylib_cs
|
||||
/// <summary>
|
||||
/// Bones information (skeleton, BoneInfo *)
|
||||
/// </summary>
|
||||
public IntPtr bones;
|
||||
public BoneInfo *bones;
|
||||
|
||||
/// <summary>
|
||||
/// Bones base transformation (pose, Transform *)
|
||||
/// </summary>
|
||||
public IntPtr bindPose;
|
||||
public Transform *bindPose;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Model animation
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ModelAnimation
|
||||
public unsafe struct ModelAnimation
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of bones
|
||||
@@ -92,11 +92,11 @@ namespace Raylib_cs
|
||||
/// <summary>
|
||||
/// Bones information (skeleton, BoneInfo *)
|
||||
/// </summary>
|
||||
public IntPtr bones;
|
||||
public BoneInfo *bones;
|
||||
|
||||
/// <summary>
|
||||
/// Poses array by frame (Transform **)
|
||||
/// </summary>
|
||||
public IntPtr framePoses;
|
||||
public Transform *framePoses;
|
||||
}
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ namespace Raylib_cs
|
||||
/// RenderBatch type
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RenderBatch
|
||||
public unsafe struct RenderBatch
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of vertex buffers (multi-buffering support)
|
||||
@@ -22,12 +22,12 @@ namespace Raylib_cs
|
||||
/// <summary>
|
||||
/// Dynamic buffer(s) for vertex data
|
||||
/// </summary>
|
||||
IntPtr vertexBuffer;
|
||||
VertexBuffer* vertexBuffer;
|
||||
|
||||
/// <summary>
|
||||
/// Draw calls array, depends on textureId
|
||||
/// </summary>
|
||||
IntPtr draws;
|
||||
DrawCall* draws;
|
||||
|
||||
/// <summary>
|
||||
/// Draw calls counter
|
||||
@@ -52,26 +52,26 @@ namespace Raylib_cs
|
||||
public int elementCount;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0, float *)
|
||||
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
||||
/// </summary>
|
||||
public IntPtr vertices;
|
||||
public float* vertices;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1, float *)
|
||||
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
||||
/// </summary>
|
||||
public IntPtr texcoords;
|
||||
public float* texcoords;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3, unsigned char *)
|
||||
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
||||
/// </summary>
|
||||
public IntPtr colors;
|
||||
public byte* colors;
|
||||
|
||||
/// <summary>
|
||||
/// Vertex indices (in case vertex data comes indexed) (6 indices per quad)<br/>
|
||||
/// unsigned int * for GRAPHICS_API_OPENGL_11 or GRAPHICS_API_OPENGL_33<br/>
|
||||
/// unsigned short * for GRAPHICS_API_OPENGL_ES2
|
||||
/// unsigned int* for GRAPHICS_API_OPENGL_11 or GRAPHICS_API_OPENGL_33<br/>
|
||||
/// unsigned short* for GRAPHICS_API_OPENGL_ES2
|
||||
/// </summary>
|
||||
public IntPtr indices;
|
||||
public void* indices;
|
||||
|
||||
/// <summary>
|
||||
/// OpenGL Vertex Array Object id
|
||||
|
@@ -70,7 +70,7 @@ namespace Raylib_cs
|
||||
/// Shader type (generic)
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Shader
|
||||
public unsafe struct Shader
|
||||
{
|
||||
/// <summary>
|
||||
/// Shader program id
|
||||
@@ -80,6 +80,6 @@ namespace Raylib_cs
|
||||
/// <summary>
|
||||
/// Shader locations array (MAX_SHADER_LOCATIONS, int *)
|
||||
/// </summary>
|
||||
public IntPtr locs;
|
||||
public int* locs;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user