Fix some types

This commit is contained in:
Braedon Lewis 2023-04-13 10:45:59 -04:00
parent b34ba3114d
commit 524a8179c9
25 changed files with 393 additions and 392 deletions

View file

@ -297,6 +297,7 @@ namespace RaylibBeefGenerator
input = ReplaceWholeWord(input, "long", "int32");
input = ReplaceWholeWord(input, "va_list", "void*");
input = ReplaceWholeWord(input, "short", "uint16");
input = ReplaceWholeWord(input, "int", "int32");
input = ReplaceWholeWord(input, "INT", "int");
input = ReplaceWholeWord(input, "STRING", "char8*");
input = ReplaceWholeWord(input, "FLOAT", "float");
@ -306,13 +307,13 @@ namespace RaylibBeefGenerator
if (input.StartsWith("const"))
input = input.Remove(0, 6);
if (input.StartsWith("unsigned"))
if (input.StartsWith("unsigned") && !input.EndsWith("int"))
input = input.Remove(0, 9);
switch (input)
{
case "unsigned int":
return "c_uint";
return "uint32";
default:
return input;
}

View file

@ -7,15 +7,15 @@ namespace RaylibBeef;
public struct AudioStream
{
/// Frequency (samples per second)
public int sampleRate;
public int32 sampleRate;
/// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
public int sampleSize;
public int32 sampleSize;
/// Number of channels (1-mono, 2-stereo, ...)
public int channels;
public int32 channels;
public this(int sampleRate, int sampleSize, int channels)
public this(int32 sampleRate, int32 sampleSize, int32 channels)
{
this.sampleRate = sampleRate;
this.sampleSize = sampleSize;

View file

@ -10,9 +10,9 @@ public struct BoneInfo
public char8[32] name;
/// Bone parent
public int parent;
public int32 parent;
public this(char8[32] name, int parent)
public this(char8[32] name, int32 parent)
{
this.name = name;
this.parent = parent;

View file

@ -21,9 +21,9 @@ public struct Camera3D
public float fovy;
/// Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
public int projection;
public int32 projection;
public this(Vector3 position, Vector3 target, Vector3 up, float fovy, int projection)
public this(Vector3 position, Vector3 target, Vector3 up, float fovy, int32 projection)
{
this.position = position;
this.target = target;

View file

@ -7,15 +7,15 @@ namespace RaylibBeef;
public struct FilePathList
{
/// Filepaths max entries
public int capacity;
public int32 capacity;
/// Filepaths entries count
public int count;
public int32 count;
/// Filepaths entries
public char8 ** paths;
public this(int capacity, int count, char8 ** paths)
public this(int32 capacity, int32 count, char8 ** paths)
{
this.capacity = capacity;
this.count = count;

View file

@ -7,13 +7,13 @@ namespace RaylibBeef;
public struct Font
{
/// Base size (default chars height)
public int baseSize;
public int32 baseSize;
/// Number of glyph characters
public int glyphCount;
public int32 glyphCount;
/// Padding around the glyph characters
public int glyphPadding;
public int32 glyphPadding;
/// Texture atlas containing the glyphs
public Texture2D texture;
@ -24,7 +24,7 @@ public struct Font
/// Glyphs info data
public GlyphInfo * glyphs;
public this(int baseSize, int glyphCount, int glyphPadding, Texture2D texture, Rectangle * recs, GlyphInfo * glyphs)
public this(int32 baseSize, int32 glyphCount, int32 glyphPadding, Texture2D texture, Rectangle * recs, GlyphInfo * glyphs)
{
this.baseSize = baseSize;
this.glyphCount = glyphCount;

View file

@ -7,21 +7,21 @@ namespace RaylibBeef;
public struct GlyphInfo
{
/// Character value (Unicode)
public int value;
public int32 value;
/// Character offset X when drawing
public int offsetX;
public int32 offsetX;
/// Character offset Y when drawing
public int offsetY;
public int32 offsetY;
/// Character advance position X
public int advanceX;
public int32 advanceX;
/// Character image data
public Image image;
public this(int value, int offsetX, int offsetY, int advanceX, Image image)
public this(int32 value, int32 offsetX, int32 offsetY, int32 advanceX, Image image)
{
this.value = value;
this.offsetX = offsetX;

View file

@ -10,18 +10,18 @@ public struct Image
public void * data;
/// Image base width
public int width;
public int32 width;
/// Image base height
public int height;
public int32 height;
/// Mipmap levels, 1 by default
public int mipmaps;
public int32 mipmaps;
/// Data format (PixelFormat type)
public int format;
public int32 format;
public this(void * data, int width, int height, int mipmaps, int format)
public this(void * data, int32 width, int32 height, int32 mipmaps, int32 format)
{
this.data = data;
this.width = width;

View file

@ -7,10 +7,10 @@ namespace RaylibBeef;
public struct Mesh
{
/// Number of vertices stored in arrays
public int vertexCount;
public int32 vertexCount;
/// Number of triangles stored (indexed or not)
public int triangleCount;
public int32 triangleCount;
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
public float * vertices;
@ -46,12 +46,12 @@ public struct Mesh
public float * boneWeights;
/// OpenGL Vertex Array Object id
public int vaoId;
public int32 vaoId;
/// OpenGL Vertex Buffer Objects id (default vertex data)
public int * vboId;
public int32 * vboId;
public this(int vertexCount, int triangleCount, float * vertices, float * texcoords, float * texcoords2, float * normals, float * tangents, char8 * colors, uint16 * indices, float * animVertices, float * animNormals, char8 * boneIds, float * boneWeights, int vaoId, int * vboId)
public this(int32 vertexCount, int32 triangleCount, float * vertices, float * texcoords, float * texcoords2, float * normals, float * tangents, char8 * colors, uint16 * indices, float * animVertices, float * animNormals, char8 * boneIds, float * boneWeights, int32 vaoId, int32 * vboId)
{
this.vertexCount = vertexCount;
this.triangleCount = triangleCount;

View file

@ -10,10 +10,10 @@ public struct Model
public Matrix transform;
/// Number of meshes
public int meshCount;
public int32 meshCount;
/// Number of materials
public int materialCount;
public int32 materialCount;
/// Meshes array
public Mesh * meshes;
@ -22,10 +22,10 @@ public struct Model
public Material * materials;
/// Mesh material number
public int * meshMaterial;
public int32 * meshMaterial;
/// Number of bones
public int boneCount;
public int32 boneCount;
/// Bones information (skeleton)
public BoneInfo * bones;
@ -33,7 +33,7 @@ public struct Model
/// Bones base transformation (pose)
public Transform * bindPose;
public this(Matrix transform, int meshCount, int materialCount, Mesh * meshes, Material * materials, int * meshMaterial, int boneCount, BoneInfo * bones, Transform * bindPose)
public this(Matrix transform, int32 meshCount, int32 materialCount, Mesh * meshes, Material * materials, int32 * meshMaterial, int32 boneCount, BoneInfo * bones, Transform * bindPose)
{
this.transform = transform;
this.meshCount = meshCount;

View file

@ -7,10 +7,10 @@ namespace RaylibBeef;
public struct ModelAnimation
{
/// Number of bones
public int boneCount;
public int32 boneCount;
/// Number of animation frames
public int frameCount;
public int32 frameCount;
/// Bones information (skeleton)
public BoneInfo * bones;
@ -18,7 +18,7 @@ public struct ModelAnimation
/// Poses array by frame
public Transform ** framePoses;
public this(int boneCount, int frameCount, BoneInfo * bones, Transform ** framePoses)
public this(int32 boneCount, int32 frameCount, BoneInfo * bones, Transform ** framePoses)
{
this.boneCount = boneCount;
this.frameCount = frameCount;

View file

@ -10,18 +10,18 @@ public struct Music
public AudioStream stream;
/// Total number of frames (considering channels)
public int frameCount;
public int32 frameCount;
/// Music looping enable
public bool looping;
/// Type of music context (audio filetype)
public int ctxType;
public int32 ctxType;
/// Audio context data, depends on type
public void * ctxData;
public this(AudioStream stream, int frameCount, bool looping, int ctxType, void * ctxData)
public this(AudioStream stream, int32 frameCount, bool looping, int32 ctxType, void * ctxData)
{
this.stream = stream;
this.frameCount = frameCount;

View file

@ -10,21 +10,21 @@ public struct NPatchInfo
public Rectangle source;
/// Left border offset
public int left;
public int32 left;
/// Top border offset
public int top;
public int32 top;
/// Right border offset
public int right;
public int32 right;
/// Bottom border offset
public int bottom;
public int32 bottom;
/// Layout of the n-patch: 3x3, 1x3 or 3x1
public int layout;
public int32 layout;
public this(Rectangle source, int left, int top, int right, int bottom, int layout)
public this(Rectangle source, int32 left, int32 top, int32 right, int32 bottom, int32 layout)
{
this.source = source;
this.left = left;

File diff suppressed because it is too large Load diff

View file

@ -35,7 +35,7 @@ public static class Raymath
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("FloatEquals")]
public static extern int FloatEquals(float x, float y);
public static extern int32 FloatEquals(float x, float y);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Zero")]
@ -143,7 +143,7 @@ public static class Raymath
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Equals")]
public static extern int Vector2Equals(Vector2 p, Vector2 q);
public static extern int32 Vector2Equals(Vector2 p, Vector2 q);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Zero")]
@ -279,7 +279,7 @@ public static class Raymath
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Equals")]
public static extern int Vector3Equals(Vector3 p, Vector3 q);
public static extern int32 Vector3Equals(Vector3 p, Vector3 q);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Refract")]
@ -459,7 +459,7 @@ public static class Raymath
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionEquals")]
public static extern int QuaternionEquals(Quaternion p, Quaternion q);
public static extern int32 QuaternionEquals(Quaternion p, Quaternion q);
}

View file

@ -9,7 +9,7 @@ typealias RenderTexture2D = RenderTexture;
public struct RenderTexture
{
/// OpenGL framebuffer object id
public int id;
public int32 id;
/// Color buffer attachment texture
public Texture texture;
@ -17,7 +17,7 @@ public struct RenderTexture
/// Depth buffer attachment texture
public Texture depth;
public this(int id, Texture texture, Texture depth)
public this(int32 id, Texture texture, Texture depth)
{
this.id = id;
this.texture = texture;

View file

@ -224,7 +224,7 @@ public static class Rlgl
/// Choose the current matrix to be transformed
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlMatrixMode")]
public static extern void rlMatrixMode(int mode);
public static extern void rlMatrixMode(int32 mode);
/// Push the current matrix to stack
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlPushMatrix")]
@ -264,11 +264,11 @@ public static class Rlgl
/// Set the viewport area
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlViewport")]
public static extern void rlViewport(int x, int y, int width, int height);
public static extern void rlViewport(int32 x, int32 y, int32 width, int32 height);
/// Initialize drawing mode (how to organize vertex)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlBegin")]
public static extern void rlBegin(int mode);
public static extern void rlBegin(int32 mode);
/// Finish vertex providing
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnd")]
@ -276,7 +276,7 @@ public static class Rlgl
/// Define one vertex (position) - 2 int
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlVertex2i")]
public static extern void rlVertex2i(int x, int y);
public static extern void rlVertex2i(int32 x, int32 y);
/// Define one vertex (position) - 2 float
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlVertex2f")]
@ -308,7 +308,7 @@ public static class Rlgl
/// Enable vertex array (VAO, if supported)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableVertexArray")]
public static extern bool rlEnableVertexArray(int vaoId);
public static extern bool rlEnableVertexArray(int32 vaoId);
/// Disable vertex array (VAO, if supported)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableVertexArray")]
@ -316,7 +316,7 @@ public static class Rlgl
/// Enable vertex buffer (VBO)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableVertexBuffer")]
public static extern void rlEnableVertexBuffer(int id);
public static extern void rlEnableVertexBuffer(int32 id);
/// Disable vertex buffer (VBO)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableVertexBuffer")]
@ -324,7 +324,7 @@ public static class Rlgl
/// Enable vertex buffer element (VBO element)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableVertexBufferElement")]
public static extern void rlEnableVertexBufferElement(int id);
public static extern void rlEnableVertexBufferElement(int32 id);
/// Disable vertex buffer element (VBO element)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableVertexBufferElement")]
@ -332,27 +332,27 @@ public static class Rlgl
/// Enable vertex attribute index
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableVertexAttribute")]
public static extern void rlEnableVertexAttribute(int index);
public static extern void rlEnableVertexAttribute(int32 index);
/// Disable vertex attribute index
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableVertexAttribute")]
public static extern void rlDisableVertexAttribute(int index);
public static extern void rlDisableVertexAttribute(int32 index);
/// Enable attribute state pointer
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableStatePointer")]
public static extern void rlEnableStatePointer(int vertexAttribType, void * buffer);
public static extern void rlEnableStatePointer(int32 vertexAttribType, void * buffer);
/// Disable attribute state pointer
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableStatePointer")]
public static extern void rlDisableStatePointer(int vertexAttribType);
public static extern void rlDisableStatePointer(int32 vertexAttribType);
/// Select and active a texture slot
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlActiveTextureSlot")]
public static extern void rlActiveTextureSlot(int slot);
public static extern void rlActiveTextureSlot(int32 slot);
/// Enable texture
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableTexture")]
public static extern void rlEnableTexture(int id);
public static extern void rlEnableTexture(int32 id);
/// Disable texture
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableTexture")]
@ -360,7 +360,7 @@ public static class Rlgl
/// Enable texture cubemap
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableTextureCubemap")]
public static extern void rlEnableTextureCubemap(int id);
public static extern void rlEnableTextureCubemap(int32 id);
/// Disable texture cubemap
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableTextureCubemap")]
@ -368,15 +368,15 @@ public static class Rlgl
/// Set texture parameters (filter, wrap)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlTextureParameters")]
public static extern void rlTextureParameters(int id, int param, int value);
public static extern void rlTextureParameters(int32 id, int32 param, int32 value);
/// Set cubemap parameters (filter, wrap)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCubemapParameters")]
public static extern void rlCubemapParameters(int id, int param, int value);
public static extern void rlCubemapParameters(int32 id, int32 param, int32 value);
/// Enable shader program
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableShader")]
public static extern void rlEnableShader(int id);
public static extern void rlEnableShader(int32 id);
/// Disable shader program
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableShader")]
@ -384,7 +384,7 @@ public static class Rlgl
/// Enable render texture (fbo)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableFramebuffer")]
public static extern void rlEnableFramebuffer(int id);
public static extern void rlEnableFramebuffer(int32 id);
/// Disable render texture (fbo), return to default framebuffer
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableFramebuffer")]
@ -392,7 +392,7 @@ public static class Rlgl
/// Activate multiple draw color buffers
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlActiveDrawBuffers")]
public static extern void rlActiveDrawBuffers(int count);
public static extern void rlActiveDrawBuffers(int32 count);
/// Enable color blending
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableColorBlend")]
@ -428,7 +428,7 @@ public static class Rlgl
/// Set face culling mode
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetCullFace")]
public static extern void rlSetCullFace(int mode);
public static extern void rlSetCullFace(int32 mode);
/// Enable scissor test
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableScissorTest")]
@ -440,7 +440,7 @@ public static class Rlgl
/// Scissor test
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlScissor")]
public static extern void rlScissor(int x, int y, int width, int height);
public static extern void rlScissor(int32 x, int32 y, int32 width, int32 height);
/// Enable wire mode
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableWireMode")]
@ -492,19 +492,19 @@ public static class Rlgl
/// Set blending mode
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetBlendMode")]
public static extern void rlSetBlendMode(int mode);
public static extern void rlSetBlendMode(int32 mode);
/// Set blending mode factor and equation (using OpenGL factors)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetBlendFactors")]
public static extern void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation);
public static extern void rlSetBlendFactors(int32 glSrcFactor, int32 glDstFactor, int32 glEquation);
/// Set blending mode factors and equations separately (using OpenGL factors)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetBlendFactorsSeparate")]
public static extern void rlSetBlendFactorsSeparate(int glSrcRGB, int glDstRGB, int glSrcAlpha, int glDstAlpha, int glEqRGB, int glEqAlpha);
public static extern void rlSetBlendFactorsSeparate(int32 glSrcRGB, int32 glDstRGB, int32 glSrcAlpha, int32 glDstAlpha, int32 glEqRGB, int32 glEqAlpha);
/// Initialize rlgl (buffers, shaders, textures, states)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlglInit")]
public static extern void rlglInit(int width, int height);
public static extern void rlglInit(int32 width, int32 height);
/// De-initialize rlgl (buffers, shaders, textures)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlglClose")]
@ -516,39 +516,39 @@ public static class Rlgl
/// Get current OpenGL version
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetVersion")]
public static extern int rlGetVersion();
public static extern int32 rlGetVersion();
/// Set current framebuffer width
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetFramebufferWidth")]
public static extern void rlSetFramebufferWidth(int width);
public static extern void rlSetFramebufferWidth(int32 width);
/// Get default framebuffer width
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetFramebufferWidth")]
public static extern int rlGetFramebufferWidth();
public static extern int32 rlGetFramebufferWidth();
/// Set current framebuffer height
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetFramebufferHeight")]
public static extern void rlSetFramebufferHeight(int height);
public static extern void rlSetFramebufferHeight(int32 height);
/// Get default framebuffer height
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetFramebufferHeight")]
public static extern int rlGetFramebufferHeight();
public static extern int32 rlGetFramebufferHeight();
/// Get default texture id
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetTextureIdDefault")]
public static extern int rlGetTextureIdDefault();
public static extern int32 rlGetTextureIdDefault();
/// Get default shader id
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetShaderIdDefault")]
public static extern int rlGetShaderIdDefault();
public static extern int32 rlGetShaderIdDefault();
/// Get default shader locations
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetShaderLocsDefault")]
public static extern int * rlGetShaderLocsDefault();
public static extern int32 * rlGetShaderLocsDefault();
/// Load a render batch system
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadRenderBatch")]
public static extern rlRenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements);
public static extern rlRenderBatch rlLoadRenderBatch(int32 numBuffers, int32 bufferElements);
/// Unload render batch system
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadRenderBatch")]
@ -568,203 +568,203 @@ public static class Rlgl
/// Check internal buffer overflow for a given number of vertex
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCheckRenderBatchLimit")]
public static extern bool rlCheckRenderBatchLimit(int vCount);
public static extern bool rlCheckRenderBatchLimit(int32 vCount);
/// Set current texture for render batch and check buffers limits
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetTexture")]
public static extern void rlSetTexture(int id);
public static extern void rlSetTexture(int32 id);
/// Load vertex array (vao) if supported
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadVertexArray")]
public static extern int rlLoadVertexArray();
public static extern int32 rlLoadVertexArray();
/// Load a vertex buffer attribute
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadVertexBuffer")]
public static extern int rlLoadVertexBuffer(void * buffer, int size, bool dynamic);
public static extern int32 rlLoadVertexBuffer(void * buffer, int32 size, bool dynamic);
/// Load a new attributes element buffer
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadVertexBufferElement")]
public static extern int rlLoadVertexBufferElement(void * buffer, int size, bool dynamic);
public static extern int32 rlLoadVertexBufferElement(void * buffer, int32 size, bool dynamic);
/// Update GPU buffer with new data
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUpdateVertexBuffer")]
public static extern void rlUpdateVertexBuffer(int bufferId, void * data, int dataSize, int offset);
public static extern void rlUpdateVertexBuffer(int32 bufferId, void * data, int32 dataSize, int32 offset);
/// Update vertex buffer elements with new data
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUpdateVertexBufferElements")]
public static extern void rlUpdateVertexBufferElements(int id, void * data, int dataSize, int offset);
public static extern void rlUpdateVertexBufferElements(int32 id, void * data, int32 dataSize, int32 offset);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadVertexArray")]
public static extern void rlUnloadVertexArray(int vaoId);
public static extern void rlUnloadVertexArray(int32 vaoId);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadVertexBuffer")]
public static extern void rlUnloadVertexBuffer(int vboId);
public static extern void rlUnloadVertexBuffer(int32 vboId);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetVertexAttribute")]
public static extern void rlSetVertexAttribute(int index, int compSize, int type, bool normalized, int stride, void * pointer);
public static extern void rlSetVertexAttribute(int32 index, int32 compSize, int32 type, bool normalized, int32 stride, void * pointer);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetVertexAttributeDivisor")]
public static extern void rlSetVertexAttributeDivisor(int index, int divisor);
public static extern void rlSetVertexAttributeDivisor(int32 index, int32 divisor);
/// Set vertex attribute default value
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetVertexAttributeDefault")]
public static extern void rlSetVertexAttributeDefault(int locIndex, void * value, int attribType, int count);
public static extern void rlSetVertexAttributeDefault(int32 locIndex, void * value, int32 attribType, int32 count);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawVertexArray")]
public static extern void rlDrawVertexArray(int offset, int count);
public static extern void rlDrawVertexArray(int32 offset, int32 count);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawVertexArrayElements")]
public static extern void rlDrawVertexArrayElements(int offset, int count, void * buffer);
public static extern void rlDrawVertexArrayElements(int32 offset, int32 count, void * buffer);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawVertexArrayInstanced")]
public static extern void rlDrawVertexArrayInstanced(int offset, int count, int instances);
public static extern void rlDrawVertexArrayInstanced(int32 offset, int32 count, int32 instances);
///
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawVertexArrayElementsInstanced")]
public static extern void rlDrawVertexArrayElementsInstanced(int offset, int count, void * buffer, int instances);
public static extern void rlDrawVertexArrayElementsInstanced(int32 offset, int32 count, void * buffer, int32 instances);
/// Load texture in GPU
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadTexture")]
public static extern int rlLoadTexture(void * data, int width, int height, int format, int mipmapCount);
public static extern int32 rlLoadTexture(void * data, int32 width, int32 height, int32 format, int32 mipmapCount);
/// Load depth texture/renderbuffer (to be attached to fbo)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadTextureDepth")]
public static extern int rlLoadTextureDepth(int width, int height, bool useRenderBuffer);
public static extern int32 rlLoadTextureDepth(int32 width, int32 height, bool useRenderBuffer);
/// Load texture cubemap
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadTextureCubemap")]
public static extern int rlLoadTextureCubemap(void * data, int size, int format);
public static extern int32 rlLoadTextureCubemap(void * data, int32 size, int32 format);
/// Update GPU texture with new data
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUpdateTexture")]
public static extern void rlUpdateTexture(int id, int offsetX, int offsetY, int width, int height, int format, void * data);
public static extern void rlUpdateTexture(int32 id, int32 offsetX, int32 offsetY, int32 width, int32 height, int32 format, void * data);
/// Get OpenGL internal formats
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetGlTextureFormats")]
public static extern void rlGetGlTextureFormats(int format, int * glInternalFormat, int * glFormat, int * glType);
public static extern void rlGetGlTextureFormats(int32 format, int32 * glInternalFormat, int32 * glFormat, int32 * glType);
/// Get name string for pixel format
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetPixelFormatName")]
public static extern char8 * rlGetPixelFormatName(int format);
public static extern char8 * rlGetPixelFormatName(int32 format);
/// Unload texture from GPU memory
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadTexture")]
public static extern void rlUnloadTexture(int id);
public static extern void rlUnloadTexture(int32 id);
/// Generate mipmap data for selected texture
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGenTextureMipmaps")]
public static extern void rlGenTextureMipmaps(int id, int width, int height, int format, int * mipmaps);
public static extern void rlGenTextureMipmaps(int32 id, int32 width, int32 height, int32 format, int32 * mipmaps);
/// Read texture pixel data
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlReadTexturePixels")]
public static extern void * rlReadTexturePixels(int id, int width, int height, int format);
public static extern void * rlReadTexturePixels(int32 id, int32 width, int32 height, int32 format);
/// Read screen pixel data (color buffer)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlReadScreenPixels")]
public static extern char8 * rlReadScreenPixels(int width, int height);
public static extern char8 * rlReadScreenPixels(int32 width, int32 height);
/// Load an empty framebuffer
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadFramebuffer")]
public static extern int rlLoadFramebuffer(int width, int height);
public static extern int32 rlLoadFramebuffer(int32 width, int32 height);
/// Attach texture/renderbuffer to a framebuffer
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlFramebufferAttach")]
public static extern void rlFramebufferAttach(int fboId, int texId, int attachType, int texType, int mipLevel);
public static extern void rlFramebufferAttach(int32 fboId, int32 texId, int32 attachType, int32 texType, int32 mipLevel);
/// Verify framebuffer is complete
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlFramebufferComplete")]
public static extern bool rlFramebufferComplete(int id);
public static extern bool rlFramebufferComplete(int32 id);
/// Delete framebuffer from GPU
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadFramebuffer")]
public static extern void rlUnloadFramebuffer(int id);
public static extern void rlUnloadFramebuffer(int32 id);
/// Load shader from code strings
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadShaderCode")]
public static extern int rlLoadShaderCode(char8 * vsCode, char8 * fsCode);
public static extern int32 rlLoadShaderCode(char8 * vsCode, char8 * fsCode);
/// Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCompileShader")]
public static extern int rlCompileShader(char8 * shaderCode, int type);
public static extern int32 rlCompileShader(char8 * shaderCode, int32 type);
/// Load custom shader program
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadShaderProgram")]
public static extern int rlLoadShaderProgram(int vShaderId, int fShaderId);
public static extern int32 rlLoadShaderProgram(int32 vShaderId, int32 fShaderId);
/// Unload shader program
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadShaderProgram")]
public static extern void rlUnloadShaderProgram(int id);
public static extern void rlUnloadShaderProgram(int32 id);
/// Get shader location uniform
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetLocationUniform")]
public static extern int rlGetLocationUniform(int shaderId, char8 * uniformName);
public static extern int32 rlGetLocationUniform(int32 shaderId, char8 * uniformName);
/// Get shader location attribute
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetLocationAttrib")]
public static extern int rlGetLocationAttrib(int shaderId, char8 * attribName);
public static extern int32 rlGetLocationAttrib(int32 shaderId, char8 * attribName);
/// Set shader value uniform
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetUniform")]
public static extern void rlSetUniform(int locIndex, void * value, int uniformType, int count);
public static extern void rlSetUniform(int32 locIndex, void * value, int32 uniformType, int32 count);
/// Set shader value matrix
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetUniformMatrix")]
public static extern void rlSetUniformMatrix(int locIndex, Matrix mat);
public static extern void rlSetUniformMatrix(int32 locIndex, Matrix mat);
/// Set shader value sampler
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetUniformSampler")]
public static extern void rlSetUniformSampler(int locIndex, int textureId);
public static extern void rlSetUniformSampler(int32 locIndex, int32 textureId);
/// Set shader currently active (id and locations)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetShader")]
public static extern void rlSetShader(int id, int * locs);
public static extern void rlSetShader(int32 id, int32 * locs);
/// Load compute shader program
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadComputeShaderProgram")]
public static extern int rlLoadComputeShaderProgram(int shaderId);
public static extern int32 rlLoadComputeShaderProgram(int32 shaderId);
/// Dispatch compute shader (equivalent to *draw* for graphics pipeline)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlComputeShaderDispatch")]
public static extern void rlComputeShaderDispatch(int groupX, int groupY, int groupZ);
public static extern void rlComputeShaderDispatch(int32 groupX, int32 groupY, int32 groupZ);
/// Load shader storage buffer object (SSBO)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadShaderBuffer")]
public static extern int rlLoadShaderBuffer(int size, void * data, int usageHint);
public static extern int32 rlLoadShaderBuffer(int32 size, void * data, int32 usageHint);
/// Unload shader storage buffer object (SSBO)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadShaderBuffer")]
public static extern void rlUnloadShaderBuffer(int ssboId);
public static extern void rlUnloadShaderBuffer(int32 ssboId);
/// Update SSBO buffer data
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUpdateShaderBuffer")]
public static extern void rlUpdateShaderBuffer(int id, void * data, int dataSize, int offset);
public static extern void rlUpdateShaderBuffer(int32 id, void * data, int32 dataSize, int32 offset);
/// Bind SSBO buffer
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlBindShaderBuffer")]
public static extern void rlBindShaderBuffer(int id, int index);
public static extern void rlBindShaderBuffer(int32 id, int32 index);
/// Read SSBO buffer data (GPU->CPU)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlReadShaderBuffer")]
public static extern void rlReadShaderBuffer(int id, void * dest, int count, int offset);
public static extern void rlReadShaderBuffer(int32 id, void * dest, int32 count, int32 offset);
/// Copy SSBO data between buffers
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCopyShaderBuffer")]
public static extern void rlCopyShaderBuffer(int destId, int srcId, int destOffset, int srcOffset, int count);
public static extern void rlCopyShaderBuffer(int32 destId, int32 srcId, int32 destOffset, int32 srcOffset, int32 count);
/// Get SSBO buffer size
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetShaderBufferSize")]
public static extern int rlGetShaderBufferSize(int id);
public static extern int32 rlGetShaderBufferSize(int32 id);
/// Bind image texture
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlBindImageTexture")]
public static extern void rlBindImageTexture(int id, int index, int format, bool @readonly);
public static extern void rlBindImageTexture(int32 id, int32 index, int32 format, bool @readonly);
/// Get internal modelview matrix
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetMatrixModelview")]
@ -780,11 +780,11 @@ public static class Rlgl
/// Get internal projection matrix for stereo render (selected eye)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetMatrixProjectionStereo")]
public static extern Matrix rlGetMatrixProjectionStereo(int eye);
public static extern Matrix rlGetMatrixProjectionStereo(int32 eye);
/// Get internal view offset matrix for stereo render (selected eye)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetMatrixViewOffsetStereo")]
public static extern Matrix rlGetMatrixViewOffsetStereo(int eye);
public static extern Matrix rlGetMatrixViewOffsetStereo(int32 eye);
/// Set a custom projection matrix (replaces internal projection matrix)
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetMatrixProjection")]

View file

@ -7,12 +7,12 @@ namespace RaylibBeef;
public struct Shader
{
/// Shader program id
public int id;
public int32 id;
/// Shader locations array (RL_MAX_SHADER_LOCATIONS)
public int * locs;
public int32 * locs;
public this(int id, int * locs)
public this(int32 id, int32 * locs)
{
this.id = id;
this.locs = locs;

View file

@ -10,9 +10,9 @@ public struct Sound
public AudioStream stream;
/// Total number of frames (considering channels)
public int frameCount;
public int32 frameCount;
public this(AudioStream stream, int frameCount)
public this(AudioStream stream, int32 frameCount)
{
this.stream = stream;
this.frameCount = frameCount;

View file

@ -10,21 +10,21 @@ typealias TextureCubemap = Texture;
public struct Texture
{
/// OpenGL texture id
public int id;
public int32 id;
/// Texture base width
public int width;
public int32 width;
/// Texture base height
public int height;
public int32 height;
/// Mipmap levels, 1 by default
public int mipmaps;
public int32 mipmaps;
/// Data format (PixelFormat type)
public int format;
public int32 format;
public this(int id, int width, int height, int mipmaps, int format)
public this(int32 id, int32 width, int32 height, int32 mipmaps, int32 format)
{
this.id = id;
this.width = width;

View file

@ -7,10 +7,10 @@ namespace RaylibBeef;
public struct VrDeviceInfo
{
/// Horizontal resolution in pixels
public int hResolution;
public int32 hResolution;
/// Vertical resolution in pixels
public int vResolution;
public int32 vResolution;
/// Horizontal size in meters
public float hScreenSize;
@ -36,7 +36,7 @@ public struct VrDeviceInfo
/// Chromatic aberration correction parameters
public float[4] chromaAbCorrection;
public this(int hResolution, int vResolution, float hScreenSize, float vScreenSize, float vScreenCenter, float eyeToScreenDistance, float lensSeparationDistance, float interpupillaryDistance, float[4] lensDistortionValues, float[4] chromaAbCorrection)
public this(int32 hResolution, int32 vResolution, float hScreenSize, float vScreenSize, float vScreenCenter, float eyeToScreenDistance, float lensSeparationDistance, float interpupillaryDistance, float[4] lensDistortionValues, float[4] chromaAbCorrection)
{
this.hResolution = hResolution;
this.vResolution = vResolution;

View file

@ -7,21 +7,21 @@ namespace RaylibBeef;
public struct Wave
{
/// Total number of frames (considering channels)
public int frameCount;
public int32 frameCount;
/// Frequency (samples per second)
public int sampleRate;
public int32 sampleRate;
/// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
public int sampleSize;
public int32 sampleSize;
/// Number of channels (1-mono, 2-stereo, ...)
public int channels;
public int32 channels;
/// Buffer data pointer
public void * data;
public this(int frameCount, int sampleRate, int sampleSize, int channels, void * data)
public this(int32 frameCount, int32 sampleRate, int32 sampleSize, int32 channels, void * data)
{
this.frameCount = frameCount;
this.sampleRate = sampleRate;

View file

@ -7,18 +7,18 @@ namespace RaylibBeef;
public struct rlDrawCall
{
/// Drawing mode: LINES, TRIANGLES, QUADS
public int mode;
public int32 mode;
/// Number of vertex of the draw
public int vertexCount;
public int32 vertexCount;
/// Number of vertex required for index alignment (LINES, TRIANGLES)
public int vertexAlignment;
public int32 vertexAlignment;
/// Texture id to be used on the draw -> Use to create new draw call if changes
public int textureId;
public int32 textureId;
public this(int mode, int vertexCount, int vertexAlignment, int textureId)
public this(int32 mode, int32 vertexCount, int32 vertexAlignment, int32 textureId)
{
this.mode = mode;
this.vertexCount = vertexCount;

View file

@ -7,10 +7,10 @@ namespace RaylibBeef;
public struct rlRenderBatch
{
/// Number of vertex buffers (multi-buffering support)
public int bufferCount;
public int32 bufferCount;
/// Current buffer tracking in case of multi-buffering
public int currentBuffer;
public int32 currentBuffer;
/// Dynamic buffer(s) for vertex data
public rlVertexBuffer * vertexBuffer;
@ -19,12 +19,12 @@ public struct rlRenderBatch
public rlDrawCall * draws;
/// Draw calls counter
public int drawCounter;
public int32 drawCounter;
/// Current depth value for next draw
public float currentDepth;
public this(int bufferCount, int currentBuffer, rlVertexBuffer * vertexBuffer, rlDrawCall * draws, int drawCounter, float currentDepth)
public this(int32 bufferCount, int32 currentBuffer, rlVertexBuffer * vertexBuffer, rlDrawCall * draws, int32 drawCounter, float currentDepth)
{
this.bufferCount = bufferCount;
this.currentBuffer = currentBuffer;

View file

@ -7,7 +7,7 @@ namespace RaylibBeef;
public struct rlVertexBuffer
{
/// Number of elements in the buffer (QUADS)
public int elementCount;
public int32 elementCount;
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
public float * vertices;
@ -19,15 +19,15 @@ public struct rlVertexBuffer
public char8 * colors;
/// Vertex indices (in case vertex data comes indexed) (6 indices per quad)
public int * indices;
public int32 * indices;
/// OpenGL Vertex Array Object id
public int vaoId;
public int32 vaoId;
/// OpenGL Vertex Buffer Objects id (4 types of vertex data)
public int[4] vboId;
public int32[4] vboId;
public this(int elementCount, float * vertices, float * texcoords, char8 * colors, int * indices, int vaoId, int[4] vboId)
public this(int32 elementCount, float * vertices, float * texcoords, char8 * colors, int32 * indices, int32 vaoId, int32[4] vboId)
{
this.elementCount = elementCount;
this.vertices = vertices;