using System;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
///
/// RenderBatch type
///
[StructLayout(LayoutKind.Sequential)]
public struct RenderBatch
{
///
/// Number of vertex buffers (multi-buffering support)
///
int buffersCount;
///
/// Current buffer tracking in case of multi-buffering
///
int currentBuffer;
///
/// Dynamic buffer(s) for vertex data
///
IntPtr vertexBuffer;
///
/// Draw calls array, depends on textureId
///
IntPtr draws;
///
/// Draw calls counter
///
int drawsCounter;
///
/// Current depth value for next draw
///
float currentDepth;
}
///
/// Dynamic vertex buffers (position + texcoords + colors + indices arrays)
///
[StructLayout(LayoutKind.Sequential)]
public unsafe struct VertexBuffer
{
///
/// Number of elements in the buffer (QUADS)
///
public int elementCount;
///
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0, float *)
///
public IntPtr vertices;
///
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1, float *)
///
public IntPtr texcoords;
///
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3, unsigned char *)
///
public IntPtr colors;
///
/// Vertex indices (in case vertex data comes indexed) (6 indices per quad)
/// unsigned int * for GRAPHICS_API_OPENGL_11 or GRAPHICS_API_OPENGL_33
/// unsigned short * for GRAPHICS_API_OPENGL_ES2
///
public IntPtr indices;
///
/// OpenGL Vertex Array Object id
///
public uint vaoId;
///
/// OpenGL Vertex Buffer Objects id (4 types of vertex data)
///
public fixed uint vboId[4];
}
///
/// Dynamic vertex buffers (position + texcoords + colors + indices arrays)
///
[StructLayout(LayoutKind.Sequential)]
public struct DrawCall
{
///
/// Drawing mode: LINES, TRIANGLES, QUADS
///
int mode;
///
/// Number of vertices for the draw call
///
int vertexCount;
///
/// Number of vertices required for index alignment (LINES, TRIANGLES)
///
int vertexAlignment;
///
/// Texture id to be used on the draw -> Use to create new draw call if changes
///
uint textureId;
}
public enum GlVersion
{
OPENGL_11 = 1,
OPENGL_21,
OPENGL_33,
OPENGL_43,
OPENGL_ES_20
}
public enum FramebufferAttachType
{
RL_ATTACHMENT_COLOR_CHANNEL0 = 0,
RL_ATTACHMENT_COLOR_CHANNEL1,
RL_ATTACHMENT_COLOR_CHANNEL2,
RL_ATTACHMENT_COLOR_CHANNEL3,
RL_ATTACHMENT_COLOR_CHANNEL4,
RL_ATTACHMENT_COLOR_CHANNEL5,
RL_ATTACHMENT_COLOR_CHANNEL6,
RL_ATTACHMENT_COLOR_CHANNEL7,
RL_ATTACHMENT_DEPTH = 100,
RL_ATTACHMENT_STENCIL = 200,
}
public enum FramebufferAttachTextureType
{
RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0,
RL_ATTACHMENT_CUBEMAP_NEGATIVE_X,
RL_ATTACHMENT_CUBEMAP_POSITIVE_Y,
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y,
RL_ATTACHMENT_CUBEMAP_POSITIVE_Z,
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z,
RL_ATTACHMENT_TEXTURE2D = 100,
RL_ATTACHMENT_RENDERBUFFER = 200,
}
}