// // This file was autogenerated. // RLGL_VERSION :: "5.0"; RL_DEFAULT_BATCH_BUFFER_ELEMENTS :: 8192; RL_DEFAULT_BATCH_BUFFERS :: 1; RL_DEFAULT_BATCH_DRAWCALLS :: 256; RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS :: 4; RL_MAX_MATRIX_STACK_SIZE :: 32; RL_MAX_SHADER_LOCATIONS :: 32; RL_CULL_DISTANCE_NEAR :: 0.01; RL_CULL_DISTANCE_FAR :: 1000.0; RL_TEXTURE_WRAP_S :: 0x2802; RL_TEXTURE_WRAP_T :: 0x2803; RL_TEXTURE_MAG_FILTER :: 0x2800; RL_TEXTURE_MIN_FILTER :: 0x2801; RL_TEXTURE_FILTER_NEAREST :: 0x2600; RL_TEXTURE_FILTER_LINEAR :: 0x2601; RL_TEXTURE_FILTER_MIP_NEAREST :: 0x2700; RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR :: 0x2702; RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST :: 0x2701; RL_TEXTURE_FILTER_MIP_LINEAR :: 0x2703; RL_TEXTURE_FILTER_ANISOTROPIC :: 0x3000; RL_TEXTURE_MIPMAP_BIAS_RATIO :: 0x4000; RL_TEXTURE_WRAP_REPEAT :: 0x2901; RL_TEXTURE_WRAP_CLAMP :: 0x812F; RL_TEXTURE_WRAP_MIRROR_REPEAT :: 0x8370; RL_TEXTURE_WRAP_MIRROR_CLAMP :: 0x8742; RL_MODELVIEW :: 0x1700; RL_PROJECTION :: 0x1701; RL_TEXTURE :: 0x1702; RL_LINES :: 0x0001; RL_TRIANGLES :: 0x0004; RL_QUADS :: 0x0007; RL_UNSIGNED_BYTE :: 0x1401; RL_FLOAT :: 0x1406; RL_STREAM_DRAW :: 0x88E0; RL_STREAM_READ :: 0x88E1; RL_STREAM_COPY :: 0x88E2; RL_STATIC_DRAW :: 0x88E4; RL_STATIC_READ :: 0x88E5; RL_STATIC_COPY :: 0x88E6; RL_DYNAMIC_DRAW :: 0x88E8; RL_DYNAMIC_READ :: 0x88E9; RL_DYNAMIC_COPY :: 0x88EA; RL_FRAGMENT_SHADER :: 0x8B30; RL_VERTEX_SHADER :: 0x8B31; RL_COMPUTE_SHADER :: 0x91B9; RL_ZERO :: 0; RL_ONE :: 1; RL_SRC_COLOR :: 0x0300; RL_ONE_MINUS_SRC_COLOR :: 0x0301; RL_SRC_ALPHA :: 0x0302; RL_ONE_MINUS_SRC_ALPHA :: 0x0303; RL_DST_ALPHA :: 0x0304; RL_ONE_MINUS_DST_ALPHA :: 0x0305; RL_DST_COLOR :: 0x0306; RL_ONE_MINUS_DST_COLOR :: 0x0307; RL_SRC_ALPHA_SATURATE :: 0x0308; RL_CONSTANT_COLOR :: 0x8001; RL_ONE_MINUS_CONSTANT_COLOR :: 0x8002; RL_CONSTANT_ALPHA :: 0x8003; RL_ONE_MINUS_CONSTANT_ALPHA :: 0x8004; RL_FUNC_ADD :: 0x8006; RL_MIN :: 0x8007; RL_MAX :: 0x8008; RL_FUNC_SUBTRACT :: 0x800A; RL_FUNC_REVERSE_SUBTRACT :: 0x800B; RL_BLEND_EQUATION :: 0x8009; RL_BLEND_EQUATION_RGB :: 0x8009; RL_BLEND_EQUATION_ALPHA :: 0x883D; RL_BLEND_DST_RGB :: 0x80C8; RL_BLEND_SRC_RGB :: 0x80C9; RL_BLEND_DST_ALPHA :: 0x80CA; RL_BLEND_SRC_ALPHA :: 0x80CB; RL_BLEND_COLOR :: 0x8005; RL_READ_FRAMEBUFFER :: 0x8CA8; RL_DRAW_FRAMEBUFFER :: 0x8CA9; RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION :: 0; RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD :: 1; RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL :: 2; RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR :: 3; RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT :: 4; RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 :: 5; RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES :: 6; // Matrix, 4x4 components, column major, OpenGL style, right handed Matrix :: struct { m0: float; // Matrix first row (4 components) m4: float; // Matrix first row (4 components) m8: float; // Matrix first row (4 components) m12: float; // Matrix first row (4 components) m1: float; // Matrix second row (4 components) m5: float; // Matrix second row (4 components) m9: float; // Matrix second row (4 components) m13: float; // Matrix second row (4 components) m2: float; // Matrix third row (4 components) m6: float; // Matrix third row (4 components) m10: float; // Matrix third row (4 components) m14: float; // Matrix third row (4 components) m3: float; // Matrix fourth row (4 components) m7: float; // Matrix fourth row (4 components) m11: float; // Matrix fourth row (4 components) m15: float; // Matrix fourth row (4 components) } // Dynamic vertex buffers (position + texcoords + colors + indices arrays) VertexBuffer :: struct { elementCount: s32; // Number of elements in the buffer (QUADS) vertices: *float; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) texcoords: *float; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) normals: *float; // Vertex normal (XYZ - 3 components per vertex) (shader-location = 2) colors: *u8; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) indices: *u32; // Vertex indices (in case vertex data comes indexed) (6 indices per quad) vaoId: u32; // OpenGL Vertex Array Object id vboId: [5] u32; // OpenGL Vertex Buffer Objects id (5 types of vertex data) } // Draw call type // NOTE: Only texture changes register a new draw, other state-change-related elements are not // used at this moment (vaoId, shaderId, matrices), raylib just forces a batch draw call if any // of those state-change happens (this is done in core module) DrawCall :: struct { mode: s32; // Drawing mode: LINES, TRIANGLES, QUADS vertexCount: s32; // Number of vertex of the draw vertexAlignment: s32; // Number of vertex required for index alignment (LINES, TRIANGLES) textureId: u32; // Texture id to be used on the draw -> Use to create new draw call if changes } // rlRenderBatch type RenderBatch :: struct { bufferCount: s32; // Number of vertex buffers (multi-buffering support) currentBuffer: s32; // Current buffer tracking in case of multi-buffering vertexBuffer: *VertexBuffer; // Dynamic buffer(s) for vertex data draws: *DrawCall; // Draw calls array, depends on textureId drawCounter: s32; // Draw calls counter currentDepth: float; // Current depth value for next draw } // OpenGL version GlVersion :: enum u32 { _11 :: 1; _21 :: 2; _33 :: 3; _43 :: 4; ES_20 :: 5; ES_30 :: 6; RL_OPENGL_11 :: _11; RL_OPENGL_21 :: _21; RL_OPENGL_33 :: _33; RL_OPENGL_43 :: _43; RL_OPENGL_ES_20 :: ES_20; RL_OPENGL_ES_30 :: ES_30; } // Trace log level // NOTE: Organized by priority level TraceLogLevel :: enum u32 { ALL :: 0; TRACE :: 1; DEBUG :: 2; INFO :: 3; WARNING :: 4; ERROR :: 5; FATAL :: 6; NONE :: 7; RL_LOG_ALL :: ALL; RL_LOG_TRACE :: TRACE; RL_LOG_DEBUG :: DEBUG; RL_LOG_INFO :: INFO; RL_LOG_WARNING :: WARNING; RL_LOG_ERROR :: ERROR; RL_LOG_FATAL :: FATAL; RL_LOG_NONE :: NONE; } // Texture pixel formats // NOTE: Support depends on OpenGL version PixelFormat :: enum u32 { UNCOMPRESSED_GRAYSCALE :: 1; UNCOMPRESSED_GRAY_ALPHA :: 2; UNCOMPRESSED_R5G6B5 :: 3; UNCOMPRESSED_R8G8B8 :: 4; UNCOMPRESSED_R5G5B5A1 :: 5; UNCOMPRESSED_R4G4B4A4 :: 6; UNCOMPRESSED_R8G8B8A8 :: 7; UNCOMPRESSED_R32 :: 8; UNCOMPRESSED_R32G32B32 :: 9; UNCOMPRESSED_R32G32B32A32 :: 10; UNCOMPRESSED_R16 :: 11; UNCOMPRESSED_R16G16B16 :: 12; UNCOMPRESSED_R16G16B16A16 :: 13; COMPRESSED_DXT1_RGB :: 14; COMPRESSED_DXT1_RGBA :: 15; COMPRESSED_DXT3_RGBA :: 16; COMPRESSED_DXT5_RGBA :: 17; COMPRESSED_ETC1_RGB :: 18; COMPRESSED_ETC2_RGB :: 19; COMPRESSED_ETC2_EAC_RGBA :: 20; COMPRESSED_PVRT_RGB :: 21; COMPRESSED_PVRT_RGBA :: 22; COMPRESSED_ASTC_4x4_RGBA :: 23; COMPRESSED_ASTC_8x8_RGBA :: 24; RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE :: UNCOMPRESSED_GRAYSCALE; RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA :: UNCOMPRESSED_GRAY_ALPHA; RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 :: UNCOMPRESSED_R5G6B5; RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 :: UNCOMPRESSED_R8G8B8; RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 :: UNCOMPRESSED_R5G5B5A1; RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 :: UNCOMPRESSED_R4G4B4A4; RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 :: UNCOMPRESSED_R8G8B8A8; RL_PIXELFORMAT_UNCOMPRESSED_R32 :: UNCOMPRESSED_R32; RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 :: UNCOMPRESSED_R32G32B32; RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 :: UNCOMPRESSED_R32G32B32A32; RL_PIXELFORMAT_UNCOMPRESSED_R16 :: UNCOMPRESSED_R16; RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16 :: UNCOMPRESSED_R16G16B16; RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 :: UNCOMPRESSED_R16G16B16A16; RL_PIXELFORMAT_COMPRESSED_DXT1_RGB :: COMPRESSED_DXT1_RGB; RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA :: COMPRESSED_DXT1_RGBA; RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA :: COMPRESSED_DXT3_RGBA; RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA :: COMPRESSED_DXT5_RGBA; RL_PIXELFORMAT_COMPRESSED_ETC1_RGB :: COMPRESSED_ETC1_RGB; RL_PIXELFORMAT_COMPRESSED_ETC2_RGB :: COMPRESSED_ETC2_RGB; RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA :: COMPRESSED_ETC2_EAC_RGBA; RL_PIXELFORMAT_COMPRESSED_PVRT_RGB :: COMPRESSED_PVRT_RGB; RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA :: COMPRESSED_PVRT_RGBA; RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA :: COMPRESSED_ASTC_4x4_RGBA; RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA :: COMPRESSED_ASTC_8x8_RGBA; } // Texture parameters: filter mode // NOTE 1: Filtering considers mipmaps if available in the texture // NOTE 2: Filter is accordingly set for minification and magnification TextureFilter :: enum u32 { POINT :: 0; BILINEAR :: 1; TRILINEAR :: 2; ANISOTROPIC_4X :: 3; ANISOTROPIC_8X :: 4; ANISOTROPIC_16X :: 5; RL_TEXTURE_FILTER_POINT :: POINT; RL_TEXTURE_FILTER_BILINEAR :: BILINEAR; RL_TEXTURE_FILTER_TRILINEAR :: TRILINEAR; RL_TEXTURE_FILTER_ANISOTROPIC_4X :: ANISOTROPIC_4X; RL_TEXTURE_FILTER_ANISOTROPIC_8X :: ANISOTROPIC_8X; RL_TEXTURE_FILTER_ANISOTROPIC_16X :: ANISOTROPIC_16X; } // Color blending modes (pre-defined) BlendMode :: enum u32 { ALPHA :: 0; ADDITIVE :: 1; MULTIPLIED :: 2; ADD_COLORS :: 3; SUBTRACT_COLORS :: 4; ALPHA_PREMULTIPLY :: 5; CUSTOM :: 6; CUSTOM_SEPARATE :: 7; RL_BLEND_ALPHA :: ALPHA; RL_BLEND_ADDITIVE :: ADDITIVE; RL_BLEND_MULTIPLIED :: MULTIPLIED; RL_BLEND_ADD_COLORS :: ADD_COLORS; RL_BLEND_SUBTRACT_COLORS :: SUBTRACT_COLORS; RL_BLEND_ALPHA_PREMULTIPLY :: ALPHA_PREMULTIPLY; RL_BLEND_CUSTOM :: CUSTOM; RL_BLEND_CUSTOM_SEPARATE :: CUSTOM_SEPARATE; } // Shader location point type ShaderLocationIndex :: enum u32 { VERTEX_POSITION :: 0; VERTEX_TEXCOORD01 :: 1; VERTEX_TEXCOORD02 :: 2; VERTEX_NORMAL :: 3; VERTEX_TANGENT :: 4; VERTEX_COLOR :: 5; MATRIX_MVP :: 6; MATRIX_VIEW :: 7; MATRIX_PROJECTION :: 8; MATRIX_MODEL :: 9; MATRIX_NORMAL :: 10; VECTOR_VIEW :: 11; COLOR_DIFFUSE :: 12; COLOR_SPECULAR :: 13; COLOR_AMBIENT :: 14; MAP_ALBEDO :: 15; MAP_METALNESS :: 16; MAP_NORMAL :: 17; MAP_ROUGHNESS :: 18; MAP_OCCLUSION :: 19; MAP_EMISSION :: 20; MAP_HEIGHT :: 21; MAP_CUBEMAP :: 22; MAP_IRRADIANCE :: 23; MAP_PREFILTER :: 24; MAP_BRDF :: 25; RL_SHADER_LOC_VERTEX_POSITION :: VERTEX_POSITION; RL_SHADER_LOC_VERTEX_TEXCOORD01 :: VERTEX_TEXCOORD01; RL_SHADER_LOC_VERTEX_TEXCOORD02 :: VERTEX_TEXCOORD02; RL_SHADER_LOC_VERTEX_NORMAL :: VERTEX_NORMAL; RL_SHADER_LOC_VERTEX_TANGENT :: VERTEX_TANGENT; RL_SHADER_LOC_VERTEX_COLOR :: VERTEX_COLOR; RL_SHADER_LOC_MATRIX_MVP :: MATRIX_MVP; RL_SHADER_LOC_MATRIX_VIEW :: MATRIX_VIEW; RL_SHADER_LOC_MATRIX_PROJECTION :: MATRIX_PROJECTION; RL_SHADER_LOC_MATRIX_MODEL :: MATRIX_MODEL; RL_SHADER_LOC_MATRIX_NORMAL :: MATRIX_NORMAL; RL_SHADER_LOC_VECTOR_VIEW :: VECTOR_VIEW; RL_SHADER_LOC_COLOR_DIFFUSE :: COLOR_DIFFUSE; RL_SHADER_LOC_COLOR_SPECULAR :: COLOR_SPECULAR; RL_SHADER_LOC_COLOR_AMBIENT :: COLOR_AMBIENT; RL_SHADER_LOC_MAP_ALBEDO :: MAP_ALBEDO; RL_SHADER_LOC_MAP_METALNESS :: MAP_METALNESS; RL_SHADER_LOC_MAP_NORMAL :: MAP_NORMAL; RL_SHADER_LOC_MAP_ROUGHNESS :: MAP_ROUGHNESS; RL_SHADER_LOC_MAP_OCCLUSION :: MAP_OCCLUSION; RL_SHADER_LOC_MAP_EMISSION :: MAP_EMISSION; RL_SHADER_LOC_MAP_HEIGHT :: MAP_HEIGHT; RL_SHADER_LOC_MAP_CUBEMAP :: MAP_CUBEMAP; RL_SHADER_LOC_MAP_IRRADIANCE :: MAP_IRRADIANCE; RL_SHADER_LOC_MAP_PREFILTER :: MAP_PREFILTER; RL_SHADER_LOC_MAP_BRDF :: MAP_BRDF; } // Shader uniform data type ShaderUniformDataType :: enum u32 { FLOAT :: 0; VEC2 :: 1; VEC3 :: 2; VEC4 :: 3; INT :: 4; IVEC2 :: 5; IVEC3 :: 6; IVEC4 :: 7; UINT :: 8; UIVEC2 :: 9; UIVEC3 :: 10; UIVEC4 :: 11; SAMPLER2D :: 12; RL_SHADER_UNIFORM_FLOAT :: FLOAT; RL_SHADER_UNIFORM_VEC2 :: VEC2; RL_SHADER_UNIFORM_VEC3 :: VEC3; RL_SHADER_UNIFORM_VEC4 :: VEC4; RL_SHADER_UNIFORM_INT :: INT; RL_SHADER_UNIFORM_IVEC2 :: IVEC2; RL_SHADER_UNIFORM_IVEC3 :: IVEC3; RL_SHADER_UNIFORM_IVEC4 :: IVEC4; RL_SHADER_UNIFORM_UINT :: UINT; RL_SHADER_UNIFORM_UIVEC2 :: UIVEC2; RL_SHADER_UNIFORM_UIVEC3 :: UIVEC3; RL_SHADER_UNIFORM_UIVEC4 :: UIVEC4; RL_SHADER_UNIFORM_SAMPLER2D :: SAMPLER2D; } // Shader attribute data types ShaderAttributeDataType :: enum u32 { FLOAT :: 0; VEC2 :: 1; VEC3 :: 2; VEC4 :: 3; RL_SHADER_ATTRIB_FLOAT :: FLOAT; RL_SHADER_ATTRIB_VEC2 :: VEC2; RL_SHADER_ATTRIB_VEC3 :: VEC3; RL_SHADER_ATTRIB_VEC4 :: VEC4; } // Framebuffer attachment type // NOTE: By default up to 8 color channels defined, but it can be more FramebufferAttachType :: enum u32 { COLOR_CHANNEL0 :: 0; COLOR_CHANNEL1 :: 1; COLOR_CHANNEL2 :: 2; COLOR_CHANNEL3 :: 3; COLOR_CHANNEL4 :: 4; COLOR_CHANNEL5 :: 5; COLOR_CHANNEL6 :: 6; COLOR_CHANNEL7 :: 7; DEPTH :: 100; STENCIL :: 200; RL_ATTACHMENT_COLOR_CHANNEL0 :: COLOR_CHANNEL0; RL_ATTACHMENT_COLOR_CHANNEL1 :: COLOR_CHANNEL1; RL_ATTACHMENT_COLOR_CHANNEL2 :: COLOR_CHANNEL2; RL_ATTACHMENT_COLOR_CHANNEL3 :: COLOR_CHANNEL3; RL_ATTACHMENT_COLOR_CHANNEL4 :: COLOR_CHANNEL4; RL_ATTACHMENT_COLOR_CHANNEL5 :: COLOR_CHANNEL5; RL_ATTACHMENT_COLOR_CHANNEL6 :: COLOR_CHANNEL6; RL_ATTACHMENT_COLOR_CHANNEL7 :: COLOR_CHANNEL7; RL_ATTACHMENT_DEPTH :: DEPTH; RL_ATTACHMENT_STENCIL :: STENCIL; } // Framebuffer texture attachment type FramebufferAttachTextureType :: enum u32 { CUBEMAP_POSITIVE_X :: 0; CUBEMAP_NEGATIVE_X :: 1; CUBEMAP_POSITIVE_Y :: 2; CUBEMAP_NEGATIVE_Y :: 3; CUBEMAP_POSITIVE_Z :: 4; CUBEMAP_NEGATIVE_Z :: 5; TEXTURE2D :: 100; RENDERBUFFER :: 200; RL_ATTACHMENT_CUBEMAP_POSITIVE_X :: CUBEMAP_POSITIVE_X; RL_ATTACHMENT_CUBEMAP_NEGATIVE_X :: CUBEMAP_NEGATIVE_X; RL_ATTACHMENT_CUBEMAP_POSITIVE_Y :: CUBEMAP_POSITIVE_Y; RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y :: CUBEMAP_NEGATIVE_Y; RL_ATTACHMENT_CUBEMAP_POSITIVE_Z :: CUBEMAP_POSITIVE_Z; RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z :: CUBEMAP_NEGATIVE_Z; RL_ATTACHMENT_TEXTURE2D :: TEXTURE2D; RL_ATTACHMENT_RENDERBUFFER :: RENDERBUFFER; } // Face culling mode CullMode :: enum u32 { FRONT :: 0; BACK :: 1; RL_CULL_FACE_FRONT :: FRONT; RL_CULL_FACE_BACK :: BACK; } MatrixMode :: (mode: s32) -> void #foreign libraylib "rlMatrixMode"; PushMatrix :: () -> void #foreign libraylib "rlPushMatrix"; PopMatrix :: () -> void #foreign libraylib "rlPopMatrix"; LoadIdentity :: () -> void #foreign libraylib "rlLoadIdentity"; Translatef :: (x: float, y: float, z: float) -> void #foreign libraylib "rlTranslatef"; Rotatef :: (angle: float, x: float, y: float, z: float) -> void #foreign libraylib "rlRotatef"; Scalef :: (x: float, y: float, z: float) -> void #foreign libraylib "rlScalef"; MultMatrixf :: (matf: *float) -> void #foreign libraylib "rlMultMatrixf"; Frustum :: (left: float64, right: float64, bottom: float64, top: float64, znear: float64, zfar: float64) -> void #foreign libraylib "rlFrustum"; Ortho :: (left: float64, right: float64, bottom: float64, top: float64, znear: float64, zfar: float64) -> void #foreign libraylib "rlOrtho"; Viewport :: (x: s32, y: s32, width: s32, height: s32) -> void #foreign libraylib "rlViewport"; SetClipPlanes :: (nearPlane: float64, farPlane: float64) -> void #foreign libraylib "rlSetClipPlanes"; GetCullDistanceNear :: () -> float64 #foreign libraylib "rlGetCullDistanceNear"; GetCullDistanceFar :: () -> float64 #foreign libraylib "rlGetCullDistanceFar"; //------------------------------------------------------------------------------------ // Functions Declaration - Vertex level operations //------------------------------------------------------------------------------------ Begin :: (mode: s32) -> void #foreign libraylib "rlBegin"; End :: () -> void #foreign libraylib "rlEnd"; Vertex2i :: (x: s32, y: s32) -> void #foreign libraylib "rlVertex2i"; Vertex2f :: (x: float, y: float) -> void #foreign libraylib "rlVertex2f"; Vertex3f :: (x: float, y: float, z: float) -> void #foreign libraylib "rlVertex3f"; TexCoord2f :: (x: float, y: float) -> void #foreign libraylib "rlTexCoord2f"; Normal3f :: (x: float, y: float, z: float) -> void #foreign libraylib "rlNormal3f"; Color4ub :: (r: u8, g: u8, b: u8, a: u8) -> void #foreign libraylib "rlColor4ub"; Color3f :: (x: float, y: float, z: float) -> void #foreign libraylib "rlColor3f"; Color4f :: (x: float, y: float, z: float, w: float) -> void #foreign libraylib "rlColor4f"; // Vertex buffers state EnableVertexArray :: (vaoId: u32) -> bool #foreign libraylib "rlEnableVertexArray"; DisableVertexArray :: () -> void #foreign libraylib "rlDisableVertexArray"; EnableVertexBuffer :: (id: u32) -> void #foreign libraylib "rlEnableVertexBuffer"; DisableVertexBuffer :: () -> void #foreign libraylib "rlDisableVertexBuffer"; EnableVertexBufferElement :: (id: u32) -> void #foreign libraylib "rlEnableVertexBufferElement"; DisableVertexBufferElement :: () -> void #foreign libraylib "rlDisableVertexBufferElement"; EnableVertexAttribute :: (index: u32) -> void #foreign libraylib "rlEnableVertexAttribute"; DisableVertexAttribute :: (index: u32) -> void #foreign libraylib "rlDisableVertexAttribute"; // Textures state ActiveTextureSlot :: (slot: s32) -> void #foreign libraylib "rlActiveTextureSlot"; EnableTexture :: (id: u32) -> void #foreign libraylib "rlEnableTexture"; DisableTexture :: () -> void #foreign libraylib "rlDisableTexture"; EnableTextureCubemap :: (id: u32) -> void #foreign libraylib "rlEnableTextureCubemap"; DisableTextureCubemap :: () -> void #foreign libraylib "rlDisableTextureCubemap"; TextureParameters :: (id: u32, param: s32, value: s32) -> void #foreign libraylib "rlTextureParameters"; CubemapParameters :: (id: u32, param: s32, value: s32) -> void #foreign libraylib "rlCubemapParameters"; // Shader state EnableShader :: (id: u32) -> void #foreign libraylib "rlEnableShader"; DisableShader :: () -> void #foreign libraylib "rlDisableShader"; // Framebuffer state EnableFramebuffer :: (id: u32) -> void #foreign libraylib "rlEnableFramebuffer"; DisableFramebuffer :: () -> void #foreign libraylib "rlDisableFramebuffer"; GetActiveFramebuffer :: () -> u32 #foreign libraylib "rlGetActiveFramebuffer"; ActiveDrawBuffers :: (count: s32) -> void #foreign libraylib "rlActiveDrawBuffers"; BlitFramebuffer :: (srcX: s32, srcY: s32, srcWidth: s32, srcHeight: s32, dstX: s32, dstY: s32, dstWidth: s32, dstHeight: s32, bufferMask: s32) -> void #foreign libraylib "rlBlitFramebuffer"; BindFramebuffer :: (target: u32, framebuffer: u32) -> void #foreign libraylib "rlBindFramebuffer"; // General render state EnableColorBlend :: () -> void #foreign libraylib "rlEnableColorBlend"; DisableColorBlend :: () -> void #foreign libraylib "rlDisableColorBlend"; EnableDepthTest :: () -> void #foreign libraylib "rlEnableDepthTest"; DisableDepthTest :: () -> void #foreign libraylib "rlDisableDepthTest"; EnableDepthMask :: () -> void #foreign libraylib "rlEnableDepthMask"; DisableDepthMask :: () -> void #foreign libraylib "rlDisableDepthMask"; EnableBackfaceCulling :: () -> void #foreign libraylib "rlEnableBackfaceCulling"; DisableBackfaceCulling :: () -> void #foreign libraylib "rlDisableBackfaceCulling"; ColorMask :: (r: bool, g: bool, b: bool, a: bool) -> void #foreign libraylib "rlColorMask"; SetCullFace :: (mode: s32) -> void #foreign libraylib "rlSetCullFace"; EnableScissorTest :: () -> void #foreign libraylib "rlEnableScissorTest"; DisableScissorTest :: () -> void #foreign libraylib "rlDisableScissorTest"; Scissor :: (x: s32, y: s32, width: s32, height: s32) -> void #foreign libraylib "rlScissor"; EnableWireMode :: () -> void #foreign libraylib "rlEnableWireMode"; EnablePointMode :: () -> void #foreign libraylib "rlEnablePointMode"; DisableWireMode :: () -> void #foreign libraylib "rlDisableWireMode"; SetLineWidth :: (width: float) -> void #foreign libraylib "rlSetLineWidth"; GetLineWidth :: () -> float #foreign libraylib "rlGetLineWidth"; EnableSmoothLines :: () -> void #foreign libraylib "rlEnableSmoothLines"; DisableSmoothLines :: () -> void #foreign libraylib "rlDisableSmoothLines"; EnableStereoRender :: () -> void #foreign libraylib "rlEnableStereoRender"; DisableStereoRender :: () -> void #foreign libraylib "rlDisableStereoRender"; IsStereoRenderEnabled :: () -> bool #foreign libraylib "rlIsStereoRenderEnabled"; ClearColor :: (r: u8, g: u8, b: u8, a: u8) -> void #foreign libraylib "rlClearColor"; ClearScreenBuffers :: () -> void #foreign libraylib "rlClearScreenBuffers"; CheckErrors :: () -> void #foreign libraylib "rlCheckErrors"; SetBlendMode :: (mode: s32) -> void #foreign libraylib "rlSetBlendMode"; SetBlendFactors :: (glSrcFactor: s32, glDstFactor: s32, glEquation: s32) -> void #foreign libraylib "rlSetBlendFactors"; SetBlendFactorsSeparate :: (glSrcRGB: s32, glDstRGB: s32, glSrcAlpha: s32, glDstAlpha: s32, glEqRGB: s32, glEqAlpha: s32) -> void #foreign libraylib "rlSetBlendFactorsSeparate"; //------------------------------------------------------------------------------------ // Functions Declaration - rlgl functionality //------------------------------------------------------------------------------------ // rlgl initialization functions glInit :: (width: s32, height: s32) -> void #foreign libraylib "rlglInit"; glClose :: () -> void #foreign libraylib "rlglClose"; LoadExtensions :: (loader: *void) -> void #foreign libraylib "rlLoadExtensions"; GetVersion :: () -> s32 #foreign libraylib "rlGetVersion"; SetFramebufferWidth :: (width: s32) -> void #foreign libraylib "rlSetFramebufferWidth"; GetFramebufferWidth :: () -> s32 #foreign libraylib "rlGetFramebufferWidth"; SetFramebufferHeight :: (height: s32) -> void #foreign libraylib "rlSetFramebufferHeight"; GetFramebufferHeight :: () -> s32 #foreign libraylib "rlGetFramebufferHeight"; GetTextureIdDefault :: () -> u32 #foreign libraylib "rlGetTextureIdDefault"; GetShaderIdDefault :: () -> u32 #foreign libraylib "rlGetShaderIdDefault"; GetShaderLocsDefault :: () -> *s32 #foreign libraylib "rlGetShaderLocsDefault"; // Render batch management // NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode // but this render batch API is exposed in case of custom batches are required LoadRenderBatch :: (numBuffers: s32, bufferElements: s32) -> RenderBatch #foreign libraylib "rlLoadRenderBatch"; UnloadRenderBatch :: (batch: RenderBatch) -> void #foreign libraylib "rlUnloadRenderBatch"; DrawRenderBatch :: (batch: *RenderBatch) -> void #foreign libraylib "rlDrawRenderBatch"; SetRenderBatchActive :: (batch: *RenderBatch) -> void #foreign libraylib "rlSetRenderBatchActive"; DrawRenderBatchActive :: () -> void #foreign libraylib "rlDrawRenderBatchActive"; CheckRenderBatchLimit :: (vCount: s32) -> bool #foreign libraylib "rlCheckRenderBatchLimit"; SetTexture :: (id: u32) -> void #foreign libraylib "rlSetTexture"; // Vertex buffers management LoadVertexArray :: () -> u32 #foreign libraylib "rlLoadVertexArray"; LoadVertexBuffer :: (buffer: *void, size: s32, dynamic: bool) -> u32 #foreign libraylib "rlLoadVertexBuffer"; LoadVertexBufferElement :: (buffer: *void, size: s32, dynamic: bool) -> u32 #foreign libraylib "rlLoadVertexBufferElement"; UpdateVertexBuffer :: (bufferId: u32, data: *void, dataSize: s32, offset: s32) -> void #foreign libraylib "rlUpdateVertexBuffer"; UpdateVertexBufferElements :: (id: u32, data: *void, dataSize: s32, offset: s32) -> void #foreign libraylib "rlUpdateVertexBufferElements"; UnloadVertexArray :: (vaoId: u32) -> void #foreign libraylib "rlUnloadVertexArray"; UnloadVertexBuffer :: (vboId: u32) -> void #foreign libraylib "rlUnloadVertexBuffer"; SetVertexAttribute :: (index: u32, compSize: s32, type: s32, normalized: bool, stride: s32, offset: s32) -> void #foreign libraylib "rlSetVertexAttribute"; SetVertexAttributeDivisor :: (index: u32, divisor: s32) -> void #foreign libraylib "rlSetVertexAttributeDivisor"; SetVertexAttributeDefault :: (locIndex: s32, value: *void, attribType: s32, count: s32) -> void #foreign libraylib "rlSetVertexAttributeDefault"; DrawVertexArray :: (offset: s32, count: s32) -> void #foreign libraylib "rlDrawVertexArray"; DrawVertexArrayElements :: (offset: s32, count: s32, buffer: *void) -> void #foreign libraylib "rlDrawVertexArrayElements"; DrawVertexArrayInstanced :: (offset: s32, count: s32, instances: s32) -> void #foreign libraylib "rlDrawVertexArrayInstanced"; DrawVertexArrayElementsInstanced :: (offset: s32, count: s32, buffer: *void, instances: s32) -> void #foreign libraylib "rlDrawVertexArrayElementsInstanced"; // Textures management LoadTexture :: (data: *void, width: s32, height: s32, format: s32, mipmapCount: s32) -> u32 #foreign libraylib "rlLoadTexture"; LoadTextureDepth :: (width: s32, height: s32, useRenderBuffer: bool) -> u32 #foreign libraylib "rlLoadTextureDepth"; LoadTextureCubemap :: (data: *void, size: s32, format: s32, mipmapCount: s32) -> u32 #foreign libraylib "rlLoadTextureCubemap"; UpdateTexture :: (id: u32, offsetX: s32, offsetY: s32, width: s32, height: s32, format: s32, data: *void) -> void #foreign libraylib "rlUpdateTexture"; GetGlTextureFormats :: (format: s32, glInternalFormat: *u32, glFormat: *u32, glType: *u32) -> void #foreign libraylib "rlGetGlTextureFormats"; GetPixelFormatName :: (format: u32) -> *u8 #foreign libraylib "rlGetPixelFormatName"; UnloadTexture :: (id: u32) -> void #foreign libraylib "rlUnloadTexture"; GenTextureMipmaps :: (id: u32, width: s32, height: s32, format: s32, mipmaps: *s32) -> void #foreign libraylib "rlGenTextureMipmaps"; ReadTexturePixels :: (id: u32, width: s32, height: s32, format: s32) -> *void #foreign libraylib "rlReadTexturePixels"; ReadScreenPixels :: (width: s32, height: s32) -> *u8 #foreign libraylib "rlReadScreenPixels"; // Framebuffer management (fbo) LoadFramebuffer :: () -> u32 #foreign libraylib "rlLoadFramebuffer"; FramebufferAttach :: (fboId: u32, texId: u32, attachType: s32, texType: s32, mipLevel: s32) -> void #foreign libraylib "rlFramebufferAttach"; FramebufferComplete :: (id: u32) -> bool #foreign libraylib "rlFramebufferComplete"; UnloadFramebuffer :: (id: u32) -> void #foreign libraylib "rlUnloadFramebuffer"; // Shaders management LoadShaderCode :: (vsCode: *u8, fsCode: *u8) -> u32 #foreign libraylib "rlLoadShaderCode"; CompileShader :: (shaderCode: *u8, type: s32) -> u32 #foreign libraylib "rlCompileShader"; LoadShaderProgram :: (vShaderId: u32, fShaderId: u32) -> u32 #foreign libraylib "rlLoadShaderProgram"; UnloadShaderProgram :: (id: u32) -> void #foreign libraylib "rlUnloadShaderProgram"; GetLocationUniform :: (shaderId: u32, uniformName: *u8) -> s32 #foreign libraylib "rlGetLocationUniform"; GetLocationAttrib :: (shaderId: u32, attribName: *u8) -> s32 #foreign libraylib "rlGetLocationAttrib"; SetUniform :: (locIndex: s32, value: *void, uniformType: s32, count: s32) -> void #foreign libraylib "rlSetUniform"; SetUniformMatrix :: (locIndex: s32, mat: Matrix) -> void #foreign libraylib "rlSetUniformMatrix"; SetUniformMatrices :: (locIndex: s32, mat: *Matrix, count: s32) -> void #foreign libraylib "rlSetUniformMatrices"; SetUniformSampler :: (locIndex: s32, textureId: u32) -> void #foreign libraylib "rlSetUniformSampler"; SetShader :: (id: u32, locs: *s32) -> void #foreign libraylib "rlSetShader"; // Compute shader management LoadComputeShaderProgram :: (shaderId: u32) -> u32 #foreign libraylib "rlLoadComputeShaderProgram"; ComputeShaderDispatch :: (groupX: u32, groupY: u32, groupZ: u32) -> void #foreign libraylib "rlComputeShaderDispatch"; // Shader buffer storage object management (ssbo) LoadShaderBuffer :: (size: u32, data: *void, usageHint: s32) -> u32 #foreign libraylib "rlLoadShaderBuffer"; UnloadShaderBuffer :: (ssboId: u32) -> void #foreign libraylib "rlUnloadShaderBuffer"; UpdateShaderBuffer :: (id: u32, data: *void, dataSize: u32, offset: u32) -> void #foreign libraylib "rlUpdateShaderBuffer"; BindShaderBuffer :: (id: u32, index: u32) -> void #foreign libraylib "rlBindShaderBuffer"; ReadShaderBuffer :: (id: u32, dest: *void, count: u32, offset: u32) -> void #foreign libraylib "rlReadShaderBuffer"; CopyShaderBuffer :: (destId: u32, srcId: u32, destOffset: u32, srcOffset: u32, count: u32) -> void #foreign libraylib "rlCopyShaderBuffer"; GetShaderBufferSize :: (id: u32) -> u32 #foreign libraylib "rlGetShaderBufferSize"; // Buffer management BindImageTexture :: (id: u32, index: u32, format: s32, readonly: bool) -> void #foreign libraylib "rlBindImageTexture"; // Matrix state management GetMatrixModelview :: () -> Matrix #foreign libraylib "rlGetMatrixModelview"; GetMatrixProjection :: () -> Matrix #foreign libraylib "rlGetMatrixProjection"; GetMatrixTransform :: () -> Matrix #foreign libraylib "rlGetMatrixTransform"; GetMatrixProjectionStereo :: (eye: s32) -> Matrix #foreign libraylib "rlGetMatrixProjectionStereo"; GetMatrixViewOffsetStereo :: (eye: s32) -> Matrix #foreign libraylib "rlGetMatrixViewOffsetStereo"; SetMatrixProjection :: (proj: Matrix) -> void #foreign libraylib "rlSetMatrixProjection"; SetMatrixModelview :: (view: Matrix) -> void #foreign libraylib "rlSetMatrixModelview"; SetMatrixProjectionStereo :: (right: Matrix, left: Matrix) -> void #foreign libraylib "rlSetMatrixProjectionStereo"; SetMatrixViewOffsetStereo :: (right: Matrix, left: Matrix) -> void #foreign libraylib "rlSetMatrixViewOffsetStereo"; // Quick and dirty cube/quad buffers load->draw->unload LoadDrawCube :: () -> void #foreign libraylib "rlLoadDrawCube"; LoadDrawQuad :: () -> void #foreign libraylib "rlLoadDrawQuad"; #scope_file #import "Basic"; // For assert #run { { info := type_info(Matrix); for info.members { if it.name == { case "m0"; assert(it.offset_in_bytes == 0, "Matrix.m0 has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m0 has unexpected size % instead of 4", it.type.runtime_size); case "m4"; assert(it.offset_in_bytes == 4, "Matrix.m4 has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m4 has unexpected size % instead of 4", it.type.runtime_size); case "m8"; assert(it.offset_in_bytes == 8, "Matrix.m8 has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m8 has unexpected size % instead of 4", it.type.runtime_size); case "m12"; assert(it.offset_in_bytes == 12, "Matrix.m12 has unexpected offset % instead of 12", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m12 has unexpected size % instead of 4", it.type.runtime_size); case "m1"; assert(it.offset_in_bytes == 16, "Matrix.m1 has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m1 has unexpected size % instead of 4", it.type.runtime_size); case "m5"; assert(it.offset_in_bytes == 20, "Matrix.m5 has unexpected offset % instead of 20", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m5 has unexpected size % instead of 4", it.type.runtime_size); case "m9"; assert(it.offset_in_bytes == 24, "Matrix.m9 has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m9 has unexpected size % instead of 4", it.type.runtime_size); case "m13"; assert(it.offset_in_bytes == 28, "Matrix.m13 has unexpected offset % instead of 28", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m13 has unexpected size % instead of 4", it.type.runtime_size); case "m2"; assert(it.offset_in_bytes == 32, "Matrix.m2 has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m2 has unexpected size % instead of 4", it.type.runtime_size); case "m6"; assert(it.offset_in_bytes == 36, "Matrix.m6 has unexpected offset % instead of 36", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m6 has unexpected size % instead of 4", it.type.runtime_size); case "m10"; assert(it.offset_in_bytes == 40, "Matrix.m10 has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m10 has unexpected size % instead of 4", it.type.runtime_size); case "m14"; assert(it.offset_in_bytes == 44, "Matrix.m14 has unexpected offset % instead of 44", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m14 has unexpected size % instead of 4", it.type.runtime_size); case "m3"; assert(it.offset_in_bytes == 48, "Matrix.m3 has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m3 has unexpected size % instead of 4", it.type.runtime_size); case "m7"; assert(it.offset_in_bytes == 52, "Matrix.m7 has unexpected offset % instead of 52", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m7 has unexpected size % instead of 4", it.type.runtime_size); case "m11"; assert(it.offset_in_bytes == 56, "Matrix.m11 has unexpected offset % instead of 56", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m11 has unexpected size % instead of 4", it.type.runtime_size); case "m15"; assert(it.offset_in_bytes == 60, "Matrix.m15 has unexpected offset % instead of 60", it.offset_in_bytes); assert(it.type.runtime_size == 4, "Matrix.m15 has unexpected size % instead of 4", it.type.runtime_size); } } assert(size_of(Matrix) == 64, "Matrix has size % instead of 64", size_of(Matrix)); } { info := type_info(VertexBuffer); for info.members { if it.name == { case "elementCount"; assert(it.offset_in_bytes == 0, "VertexBuffer.elementCount has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "VertexBuffer.elementCount has unexpected size % instead of 4", it.type.runtime_size); case "vertices"; assert(it.offset_in_bytes == 8, "VertexBuffer.vertices has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "VertexBuffer.vertices has unexpected size % instead of 8", it.type.runtime_size); case "texcoords"; assert(it.offset_in_bytes == 16, "VertexBuffer.texcoords has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "VertexBuffer.texcoords has unexpected size % instead of 8", it.type.runtime_size); case "normals"; assert(it.offset_in_bytes == 24, "VertexBuffer.normals has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 8, "VertexBuffer.normals has unexpected size % instead of 8", it.type.runtime_size); case "colors"; assert(it.offset_in_bytes == 32, "VertexBuffer.colors has unexpected offset % instead of 32", it.offset_in_bytes); assert(it.type.runtime_size == 8, "VertexBuffer.colors has unexpected size % instead of 8", it.type.runtime_size); case "indices"; assert(it.offset_in_bytes == 40, "VertexBuffer.indices has unexpected offset % instead of 40", it.offset_in_bytes); assert(it.type.runtime_size == 8, "VertexBuffer.indices has unexpected size % instead of 8", it.type.runtime_size); case "vaoId"; assert(it.offset_in_bytes == 48, "VertexBuffer.vaoId has unexpected offset % instead of 48", it.offset_in_bytes); assert(it.type.runtime_size == 4, "VertexBuffer.vaoId has unexpected size % instead of 4", it.type.runtime_size); case "vboId"; assert(it.offset_in_bytes == 52, "VertexBuffer.vboId has unexpected offset % instead of 52", it.offset_in_bytes); assert(it.type.runtime_size == 20, "VertexBuffer.vboId has unexpected size % instead of 20", it.type.runtime_size); } } assert(size_of(VertexBuffer) == 72, "VertexBuffer has size % instead of 72", size_of(VertexBuffer)); } { info := type_info(DrawCall); for info.members { if it.name == { case "mode"; assert(it.offset_in_bytes == 0, "DrawCall.mode has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "DrawCall.mode has unexpected size % instead of 4", it.type.runtime_size); case "vertexCount"; assert(it.offset_in_bytes == 4, "DrawCall.vertexCount has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "DrawCall.vertexCount has unexpected size % instead of 4", it.type.runtime_size); case "vertexAlignment"; assert(it.offset_in_bytes == 8, "DrawCall.vertexAlignment has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 4, "DrawCall.vertexAlignment has unexpected size % instead of 4", it.type.runtime_size); case "textureId"; assert(it.offset_in_bytes == 12, "DrawCall.textureId has unexpected offset % instead of 12", it.offset_in_bytes); assert(it.type.runtime_size == 4, "DrawCall.textureId has unexpected size % instead of 4", it.type.runtime_size); } } assert(size_of(DrawCall) == 16, "DrawCall has size % instead of 16", size_of(DrawCall)); } { info := type_info(RenderBatch); for info.members { if it.name == { case "bufferCount"; assert(it.offset_in_bytes == 0, "RenderBatch.bufferCount has unexpected offset % instead of 0", it.offset_in_bytes); assert(it.type.runtime_size == 4, "RenderBatch.bufferCount has unexpected size % instead of 4", it.type.runtime_size); case "currentBuffer"; assert(it.offset_in_bytes == 4, "RenderBatch.currentBuffer has unexpected offset % instead of 4", it.offset_in_bytes); assert(it.type.runtime_size == 4, "RenderBatch.currentBuffer has unexpected size % instead of 4", it.type.runtime_size); case "vertexBuffer"; assert(it.offset_in_bytes == 8, "RenderBatch.vertexBuffer has unexpected offset % instead of 8", it.offset_in_bytes); assert(it.type.runtime_size == 8, "RenderBatch.vertexBuffer has unexpected size % instead of 8", it.type.runtime_size); case "draws"; assert(it.offset_in_bytes == 16, "RenderBatch.draws has unexpected offset % instead of 16", it.offset_in_bytes); assert(it.type.runtime_size == 8, "RenderBatch.draws has unexpected size % instead of 8", it.type.runtime_size); case "drawCounter"; assert(it.offset_in_bytes == 24, "RenderBatch.drawCounter has unexpected offset % instead of 24", it.offset_in_bytes); assert(it.type.runtime_size == 4, "RenderBatch.drawCounter has unexpected size % instead of 4", it.type.runtime_size); case "currentDepth"; assert(it.offset_in_bytes == 28, "RenderBatch.currentDepth has unexpected offset % instead of 28", it.offset_in_bytes); assert(it.type.runtime_size == 4, "RenderBatch.currentDepth has unexpected size % instead of 4", it.type.runtime_size); } } assert(size_of(RenderBatch) == 32, "RenderBatch has size % instead of 32", size_of(RenderBatch)); } }