package vendor:raylib/rlgl

⌘K
Ctrl+K
or
/

    Overview

    ********************* * rlgl v6.0 - A multi-OpenGL abstraction layer with an immediate-mode style API * DESCRIPTION: An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0, ES 3.0) that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...) * ADDITIONAL NOTES: When choosing an OpenGL backend different than OpenGL 1.1, some internal buffers are initialized on rlglInit() to accumulate vertex data * When an internal state change is required all the stored vertex data is rendered in a batch, additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch * Some resources are also loaded for convenience, here the complete list: - Default batch (RLGL.defaultBatch): RenderBatch system to accumulate vertex data - Default texture (RLGL.defaultTextureId): 1x1 white pixel R8G8B8A8 - Default shader (RLGL.State.defaultShaderId, RLGL.State.defaultShaderLocs) * Internal buffer (and resources) must be manually unloaded calling rlglClose() * CONFIGURATION: #define GRAPHICS_API_OPENGL_SOFTWARE #define GRAPHICS_API_OPENGL_11 #define GRAPHICS_API_OPENGL_21 #define GRAPHICS_API_OPENGL_33 #define GRAPHICS_API_OPENGL_43 #define GRAPHICS_API_OPENGL_ES2 #define GRAPHICS_API_OPENGL_ES3 Use selected OpenGL graphics backend, should be supported by platform Those preprocessor defines are only used on the rlgl module, if OpenGL version is required by any other module, use rlGetVersion() to check it * #define RLGL_IMPLEMENTATION Generates the implementation of the library into the included file If not defined, the library is in header only mode and can be included in other headers or source files without problems. But only ONE file should hold the implementation * #if RLGL_SHOW_GL_DETAILS_INFO Show OpenGL extensions and capabilities detailed logs on init * #if RLGL_ENABLE_OPENGL_DEBUG_CONTEXT Enable debug context (only available on OpenGL 4.3) * rlgl capabilities could be customized defining some internal values before library inclusion (default values listed): * #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering) #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture) #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of texture units that can be activated on batch drawing (SetShaderValueTexture()) * #define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported #define RL_CULL_DISTANCE_NEAR 0.05 // Default projection matrix near cull distance #define RL_CULL_DISTANCE_FAR 4000.0 // Default projection matrix far cull distance * When loading a shader, the following vertex attributes and uniform location names are tried to be set automatically: * #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEINDICES "vertexBoneIndices" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix #define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView))) #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color) #define RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES "boneMatrices" // bone matrices #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0) #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1) #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2) * DEPENDENCIES: - OpenGL libraries (depending on platform and OpenGL version selected) - GLAD OpenGL extensions loading library (only for OpenGL 3.3 Core, 4.3 Core) * * LICENSE: zlib/libpng * Copyright (c) 2014-2026 Ramon Santamaria (@raysan5) * This software is provided "as-is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. * Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: * 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * *********************

    Index

    Constants (80)
    Variables (0)

    This section is empty.

    Procedures (152)
    Procedure Groups (0)

    This section is empty.

    `#config` values (2)

    Types

    BlendMode ¶

    BlendMode :: raylib.BlendMode

    CullMode ¶

    CullMode :: enum i32 {
    	FRONT = 0, 
    	BACK, 
    }

    Related Procedures With Parameters

    DrawCall ¶

    DrawCall :: struct {
    	mode:            i32,
    	// Drawing mode: LINES, TRIANGLES, QUADS
    	vertexCount:     i32,
    	// Number of vertex of the draw
    	vertexAlignment: i32,
    	// Number of vertex required for index alignment (LINES, TRIANGLES)
    	textureId:       u32,
    }
     

    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)

    FramebufferAttachTextureType ¶

    FramebufferAttachTextureType :: enum i32 {
    	CUBEMAP_POSITIVE_X = 0,   // Framebuffer texture attachment type: cubemap, +X side
    	CUBEMAP_NEGATIVE_X = 1,   // Framebuffer texture attachment type: cubemap, -X side
    	CUBEMAP_POSITIVE_Y = 2,   // Framebuffer texture attachment type: cubemap, +Y side
    	CUBEMAP_NEGATIVE_Y = 3,   // Framebuffer texture attachment type: cubemap, -Y side
    	CUBEMAP_POSITIVE_Z = 4,   // Framebuffer texture attachment type: cubemap, +Z side
    	CUBEMAP_NEGATIVE_Z = 5,   // Framebuffer texture attachment type: cubemap, -Z side
    	TEXTURE2D          = 100, // Framebuffer texture attachment type: texture2d
    	RENDERBUFFER       = 200, // Framebuffer texture attachment type: renderbuffer
    }
     

    Framebuffer texture attachment type

    FramebufferAttachType ¶

    FramebufferAttachType :: enum i32 {
    	COLOR_CHANNEL0 = 0,   // Framebuffer attachment type: color 0
    	COLOR_CHANNEL1 = 1,   // Framebuffer attachment type: color 1
    	COLOR_CHANNEL2 = 2,   // Framebuffer attachment type: color 2
    	COLOR_CHANNEL3 = 3,   // Framebuffer attachment type: color 3
    	COLOR_CHANNEL4 = 4,   // Framebuffer attachment type: color 4
    	COLOR_CHANNEL5 = 5,   // Framebuffer attachment type: color 5
    	COLOR_CHANNEL6 = 6,   // Framebuffer attachment type: color 6
    	COLOR_CHANNEL7 = 7,   // Framebuffer attachment type: color 7
    	DEPTH          = 100, // Framebuffer attachment type: depth
    	STENCIL        = 200, // Framebuffer attachment type: stencil
    }
     

    Framebuffer attachment type NOTE: By default up to 8 color channels defined, but it can be more

    GlVersion ¶

    GlVersion :: enum i32 {
    	OPENGL_11    = 1, // OpenGL 1.1
    	OPENGL_21,        // OpenGL 2.1 (GLSL 120)
    	OPENGL_33,        // OpenGL 3.3 (GLSL 330)
    	OPENGL_43,        // OpenGL 4.3 (using GLSL 330)
    	OPENGL_ES_20,     // OpenGL ES 2.0 (GLSL 100)
    	OPENGL_ES_30,     // OpenGL ES 3.0 (GLSL 300 es)
    }
     

    OpenGL version

    Related Procedures With Returns

    PixelFormat ¶

    PixelFormat :: raylib.PixelFormat

    RenderBatch ¶

    RenderBatch :: struct {
    	bufferCount:   i32,
    	// Number of vertex buffers (multi-buffering support)
    	currentBuffer: i32,
    	// 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:   i32,
    	// Draw calls counter
    	currentDepth:  f32,
    }
     

    RenderBatch type

    Related Procedures With Parameters

    Related Procedures With Returns

    ShaderAttributeDataType ¶

    ShaderAttributeDataType :: enum i32 {
    	FLOAT = 0, // Shader attribute type: float
    	VEC2,      // Shader attribute type: vec2 (2 float)
    	VEC3,      // Shader attribute type: vec3 (3 float)
    	VEC4,      // Shader attribute type: vec4 (4 float)
    }
     

    Shader attribute data types

    ShaderLocationIndex ¶

    ShaderLocationIndex :: raylib.ShaderLocationIndex

    ShaderUniformDataType ¶

    ShaderUniformDataType :: raylib.ShaderUniformDataType

    TextureFilter ¶

    TextureFilter :: raylib.TextureFilter

    VertexBuffer ¶

    VertexBuffer :: struct {
    	elementCount: i32,
    	// Number of elements in the buffer (QUADS)
    	vertices:     [^]f32,
    	// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
    	texcoords:    [^]f32,
    	// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
    	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:        [4]u32,
    }
     

    Dynamic vertex buffers (position + texcoords + colors + indices arrays)

    Constants

    BLEND_COLOR ¶

    BLEND_COLOR :: 0x8005
     

    GL_BLEND_COLOR

    BLEND_DST_ALPHA ¶

    BLEND_DST_ALPHA :: 0x80CA
     

    GL_BLEND_DST_ALPHA

    BLEND_DST_RGB ¶

    BLEND_DST_RGB :: 0x80C8
     

    GL_BLEND_DST_RGB

    BLEND_EQUATION ¶

    BLEND_EQUATION :: 0x8009
     

    GL_BLEND_EQUATION

    BLEND_EQUATION_ALPHA ¶

    BLEND_EQUATION_ALPHA :: 0x883D
     

    GL_BLEND_EQUATION_ALPHA

    BLEND_EQUATION_RGB ¶

    BLEND_EQUATION_RGB :: 0x8009
     

    GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)

    BLEND_SRC_ALPHA ¶

    BLEND_SRC_ALPHA :: 0x80CB
     

    GL_BLEND_SRC_ALPHA

    BLEND_SRC_RGB ¶

    BLEND_SRC_RGB :: 0x80C9
     

    GL_BLEND_SRC_RGB

    COMPUTE_SHADER ¶

    COMPUTE_SHADER :: 0x91B9
     

    GL_COMPUTE_SHADER

    CONSTANT_ALPHA ¶

    CONSTANT_ALPHA :: 0x8003
     

    GL_CONSTANT_ALPHA

    CONSTANT_COLOR ¶

    CONSTANT_COLOR :: 0x8001
     

    GL_CONSTANT_COLOR

    CULL_DISTANCE_FAR ¶

    CULL_DISTANCE_FAR :: 1000.0
     

    Default far cull distance

    CULL_DISTANCE_NEAR ¶

    CULL_DISTANCE_NEAR :: 0.01
     

    Projection matrix culling

    DEFAULT_BATCH_BUFFERS ¶

    DEFAULT_BATCH_BUFFERS :: 1
     

    Default number of batch buffers (multi-buffering)

    DEFAULT_BATCH_BUFFER_ELEMENTS ¶

    DEFAULT_BATCH_BUFFER_ELEMENTS :: 8192
     

    This is the maximum amount of elements (quads) per batch NOTE: Be careful with text, every letter maps to a quad

    DEFAULT_BATCH_DRAWCALLS ¶

    DEFAULT_BATCH_DRAWCALLS :: 256
     

    Default number of batch draw calls (by state changes: mode, texture)

    DEFAULT_BATCH_MAX_TEXTURE_UNITS ¶

    DEFAULT_BATCH_MAX_TEXTURE_UNITS :: 4
     

    Maximum number of additional textures that can be activated on batch drawing (SetShaderValueTexture())

    DST_ALPHA ¶

    DST_ALPHA :: 0x0304
     

    GL_DST_ALPHA

    DST_COLOR ¶

    DST_COLOR :: 0x0306
     

    GL_DST_COLOR

    DYNAMIC_COPY ¶

    DYNAMIC_COPY :: 0x88EA
     

    GL_DYNAMIC_COPY

    DYNAMIC_DRAW ¶

    DYNAMIC_DRAW :: 0x88E8
     

    GL_DYNAMIC_DRAW

    DYNAMIC_READ ¶

    DYNAMIC_READ :: 0x88E9
     

    GL_DYNAMIC_READ

    FLOAT ¶

    FLOAT :: 0x1406
     

    GL_FLOAT

    FRAGMENT_SHADER ¶

    FRAGMENT_SHADER :: 0x8B30
     

    GL Shader type

    FUNC_ADD ¶

    FUNC_ADD :: 0x8006
     

    GL blending functions/equations

    FUNC_REVERSE_SUBTRACT ¶

    FUNC_REVERSE_SUBTRACT :: 0x800B
     

    GL_FUNC_REVERSE_SUBTRACT

    FUNC_SUBTRACT ¶

    FUNC_SUBTRACT :: 0x800A
     

    GL_FUNC_SUBTRACT

    GRAPHICS_API_OPENGL_11 ¶

    GRAPHICS_API_OPENGL_11 :: false

    GRAPHICS_API_OPENGL_21 ¶

    GRAPHICS_API_OPENGL_21 :: true

    GRAPHICS_API_OPENGL_33 ¶

    GRAPHICS_API_OPENGL_33 :: GRAPHICS_API_OPENGL_21
     

    default currently

    GRAPHICS_API_OPENGL_43 ¶

    GRAPHICS_API_OPENGL_43 :: false

    GRAPHICS_API_OPENGL_ES2 ¶

    GRAPHICS_API_OPENGL_ES2 :: false

    GRAPHICS_API_OPENGL_ES3 ¶

    GRAPHICS_API_OPENGL_ES3 :: false

    LINES ¶

    LINES :: 0x0001
     

    Primitive assembly draw modes

    MAX ¶

    MAX :: 0x8008
     

    GL_MAX

    MAX_MATRIX_STACK_SIZE ¶

    MAX_MATRIX_STACK_SIZE :: 32
     

    Internal Matrix stack

    MAX_SHADER_LOCATIONS ¶

    MAX_SHADER_LOCATIONS :: 32
     

    Shader limits

    MIN ¶

    MIN :: 0x8007
     

    GL_MIN

    MODELVIEW ¶

    MODELVIEW :: 0x1700
     

    Matrix modes (equivalent to OpenGL)

    ONE ¶

    ONE :: 1
     

    GL_ONE

    ONE_MINUS_CONSTANT_ALPHA ¶

    ONE_MINUS_CONSTANT_ALPHA :: 0x8004
     

    GL_ONE_MINUS_CONSTANT_ALPHA

    ONE_MINUS_CONSTANT_COLOR ¶

    ONE_MINUS_CONSTANT_COLOR :: 0x8002
     

    GL_ONE_MINUS_CONSTANT_COLOR

    ONE_MINUS_DST_ALPHA ¶

    ONE_MINUS_DST_ALPHA :: 0x0305
     

    GL_ONE_MINUS_DST_ALPHA

    ONE_MINUS_DST_COLOR ¶

    ONE_MINUS_DST_COLOR :: 0x0307
     

    GL_ONE_MINUS_DST_COLOR

    ONE_MINUS_SRC_ALPHA ¶

    ONE_MINUS_SRC_ALPHA :: 0x0303
     

    GL_ONE_MINUS_SRC_ALPHA

    ONE_MINUS_SRC_COLOR ¶

    ONE_MINUS_SRC_COLOR :: 0x0301
     

    GL_ONE_MINUS_SRC_COLOR

    PROJECTION ¶

    PROJECTION :: 0x1701
     

    GL_PROJECTION

    QUADS ¶

    QUADS :: 0x0007
     

    GL_QUADS

    RAYLIB_SHARED ¶

    RAYLIB_SHARED :: #config(RAYLIB_SHARED, false)

    RAYLIB_WASM_LIB ¶

    RAYLIB_WASM_LIB :: #config(RAYLIB_WASM_LIB, "../wasm/libraylib.web.a")

    SRC_ALPHA ¶

    SRC_ALPHA :: 0x0302
     

    GL_SRC_ALPHA

    SRC_ALPHA_SATURATE ¶

    SRC_ALPHA_SATURATE :: 0x0308
     

    GL_SRC_ALPHA_SATURATE

    SRC_COLOR ¶

    SRC_COLOR :: 0x0300
     

    GL_SRC_COLOR

    STATIC_COPY ¶

    STATIC_COPY :: 0x88E6
     

    GL_STATIC_COPY

    STATIC_DRAW ¶

    STATIC_DRAW :: 0x88E4
     

    GL_STATIC_DRAW

    STATIC_READ ¶

    STATIC_READ :: 0x88E5
     

    GL_STATIC_READ

    STREAM_COPY ¶

    STREAM_COPY :: 0x88E2
     

    GL_STREAM_COPY

    STREAM_DRAW ¶

    STREAM_DRAW :: 0x88E0
     

    Buffer usage hint

    STREAM_READ ¶

    STREAM_READ :: 0x88E1
     

    GL_STREAM_READ

    TEXTURE ¶

    TEXTURE :: 0x1702
     

    GL_TEXTURE

    TEXTURE_FILTER_ANISOTROPIC ¶

    TEXTURE_FILTER_ANISOTROPIC :: 0x3000
     

    Anisotropic filter (custom identifier)

    TEXTURE_FILTER_LINEAR ¶

    TEXTURE_FILTER_LINEAR :: 0x2601
     

    GL_LINEAR

    TEXTURE_FILTER_LINEAR_MIP_NEAREST ¶

    TEXTURE_FILTER_LINEAR_MIP_NEAREST :: 0x2701
     

    GL_LINEAR_MIPMAP_NEAREST

    TEXTURE_FILTER_MIP_LINEAR ¶

    TEXTURE_FILTER_MIP_LINEAR :: 0x2703
     

    GL_LINEAR_MIPMAP_LINEAR

    TEXTURE_FILTER_MIP_NEAREST ¶

    TEXTURE_FILTER_MIP_NEAREST :: 0x2700
     

    GL_NEAREST_MIPMAP_NEAREST

    TEXTURE_FILTER_NEAREST ¶

    TEXTURE_FILTER_NEAREST :: 0x2600
     

    GL_NEAREST

    TEXTURE_FILTER_NEAREST_MIP_LINEAR ¶

    TEXTURE_FILTER_NEAREST_MIP_LINEAR :: 0x2702
     

    GL_NEAREST_MIPMAP_LINEAR

    TEXTURE_MAG_FILTER ¶

    TEXTURE_MAG_FILTER :: 0x2800
     

    GL_TEXTURE_MAG_FILTER

    TEXTURE_MIN_FILTER ¶

    TEXTURE_MIN_FILTER :: 0x2801
     

    GL_TEXTURE_MIN_FILTER

    TEXTURE_WRAP_CLAMP ¶

    TEXTURE_WRAP_CLAMP :: 0x812F
     

    GL_CLAMP_TO_EDGE

    TEXTURE_WRAP_MIRROR_CLAMP ¶

    TEXTURE_WRAP_MIRROR_CLAMP :: 0x8742
     

    GL_MIRROR_CLAMP_EXT

    TEXTURE_WRAP_MIRROR_REPEAT ¶

    TEXTURE_WRAP_MIRROR_REPEAT :: 0x8370
     

    GL_MIRRORED_REPEAT

    TEXTURE_WRAP_REPEAT ¶

    TEXTURE_WRAP_REPEAT :: 0x2901
     

    GL_REPEAT

    TEXTURE_WRAP_S ¶

    TEXTURE_WRAP_S :: 0x2802
     

    Texture parameters (equivalent to OpenGL defines)

    TEXTURE_WRAP_T ¶

    TEXTURE_WRAP_T :: 0x2803
     

    GL_TEXTURE_WRAP_T

    TRIANGLES ¶

    TRIANGLES :: 0x0004
     

    GL_TRIANGLES

    UNSIGNED_BYTE ¶

    UNSIGNED_BYTE :: 0x1401
     

    GL equivalent data types

    VERSION ¶

    VERSION :: "6.0"

    VERTEX_SHADER ¶

    VERTEX_SHADER :: 0x8B31
     

    GL_VERTEX_SHADER

    ZERO ¶

    ZERO :: 0
     

    GL blending factors

    Variables

    This section is empty.

    Procedures

    ActiveDrawBuffers ¶

    ActiveDrawBuffers :: proc "c" (count: i32) ---
     

    Activate multiple draw color buffers

    ActiveTextureSlot ¶

    ActiveTextureSlot :: proc "c" (slot: i32) ---
     

    Textures state

    Begin ¶

    Begin :: proc "c" (mode: i32) ---
     

    ------------------------------------------------------------------------------------ Functions Declaration - Vertex level operations ------------------------------------------------------------------------------------

    BindImageTexture ¶

    BindImageTexture :: proc "c" (id: u32, index: u32, format: i32, readonly: bool) ---
     

    Buffer management

    BindShaderBuffer ¶

    BindShaderBuffer :: proc "c" (id: u32, index: u32) ---
     

    Bind SSBO buffer

    BlitFramebuffer ¶

    BlitFramebuffer :: proc "c" (
    	srcX, srcY, srcWidth, srcHeight, dstX, dstY, dstWidth, dstHeight, 
    	bufferMask:                                                       i32, 
    ) ---
     

    Blit active framebuffer to main framebuffer

    CheckErrors ¶

    CheckErrors :: proc "c" () ---
     

    Check and log OpenGL error codes

    CheckRenderBatchLimit ¶

    CheckRenderBatchLimit :: proc "c" (vCount: i32) -> i32 ---
     

    Check internal buffer overflow for a given number of vertex

    ClearColor ¶

    ClearColor :: proc "c" (r, g, b, a: u8) ---
     

    Clear color buffer with color

    ClearScreenBuffers ¶

    ClearScreenBuffers :: proc "c" () ---
     

    Clear used screen buffers (color and depth)

    Close ¶

    @(link_prefix="rlgl")
    Close :: proc "c" () ---
     

    De-initialize rlgl (buffers, shaders, textures)

    Color3f ¶

    Color3f :: proc "c" (x, y, z: f32) ---
     

    Define one vertex (color) - 3 f32

    Color4f ¶

    Color4f :: proc "c" (x, y, z, w: f32) ---
     

    Define one vertex (color) - 4 f32

    Color4ub ¶

    Color4ub :: proc "c" (r, g, b, a: u8) ---
     

    Define one vertex (color) - 4 byte

    CompileShader ¶

    CompileShader :: proc "c" (shaderCode: cstring, type: i32) -> u32 ---
     

    Compile custom shader and return shader id (type: VERTEX_SHADER, FRAGMENT_SHADER, COMPUTE_SHADER)

    ComputeShaderDispatch ¶

    ComputeShaderDispatch :: proc "c" (groupX, groupY, groupZ: u32) ---
     

    Dispatch compute shader (equivalent to draw for graphics pipeline)

    CopyShaderBuffer ¶

    CopyShaderBuffer :: proc "c" (destId, srcId: u32, destOffset, srcOffset: u32, count: u32) ---
     

    Copy SSBO data between buffers

    CubemapParameters ¶

    CubemapParameters :: proc "c" (id: i32, param: i32, value: i32) ---
     

    Set cubemap parameters (filter, wrap)

    DisableBackfaceCulling ¶

    DisableBackfaceCulling :: proc "c" () ---
     

    Disable backface culling

    DisableColorBlend ¶

    DisableColorBlend :: proc "c" () ---
     

    Disable color blending

    DisableDepthMask ¶

    DisableDepthMask :: proc "c" () ---
     

    Disable depth write

    DisableDepthTest ¶

    DisableDepthTest :: proc "c" () ---
     

    Disable depth test

    DisableFramebuffer ¶

    DisableFramebuffer :: proc "c" () ---
     

    Disable render texture (fbo), return to default framebuffer

    DisableScissorTest ¶

    DisableScissorTest :: proc "c" () ---
     

    Disable scissor test

    DisableShader ¶

    DisableShader :: proc "c" () ---
     

    Disable shader program

    DisableSmoothLines ¶

    DisableSmoothLines :: proc "c" () ---
     

    Disable line aliasing

    DisableStereoRender ¶

    DisableStereoRender :: proc "c" () ---
     

    Disable stereo rendering

    DisableTexture ¶

    DisableTexture :: proc "c" () ---
     

    Disable texture

    DisableTextureCubemap ¶

    DisableTextureCubemap :: proc "c" () ---
     

    Disable texture cubemap

    DisableVertexArray ¶

    DisableVertexArray :: proc "c" () ---
     

    Disable vertex array (VAO, if supported)

    DisableVertexAttribute ¶

    DisableVertexAttribute :: proc "c" (index: u32) ---
     

    Disable vertex attribute index

    DisableVertexBuffer ¶

    DisableVertexBuffer :: proc "c" () ---
     

    Disable vertex buffer (VBO)

    DisableVertexBufferElement ¶

    DisableVertexBufferElement :: proc "c" () ---
     

    Disable vertex buffer element (VBO element)

    DisableWireMode ¶

    DisableWireMode :: proc "c" () ---
     

    Disable wire and point modes

    DrawRenderBatch ¶

    DrawRenderBatch :: proc "c" (batch: ^RenderBatch) ---
     

    Draw render batch data (Update->Draw->Reset)

    DrawRenderBatchActive ¶

    DrawRenderBatchActive :: proc "c" () ---
     

    Update and draw internal render batch

    DrawVertexArray ¶

    DrawVertexArray :: proc "c" (offset: i32, count: i32) ---

    DrawVertexArrayElements ¶

    DrawVertexArrayElements :: proc "c" (offset: i32, count: i32, buffer: rawptr) ---

    DrawVertexArrayElementsInstanced ¶

    DrawVertexArrayElementsInstanced :: proc "c" (offset: i32, count: i32, buffer: rawptr, instances: i32) ---

    DrawVertexArrayInstanced ¶

    DrawVertexArrayInstanced :: proc "c" (offset: i32, count: i32, instances: i32) ---

    EnableBackfaceCulling ¶

    EnableBackfaceCulling :: proc "c" () ---
     

    Enable backface culling

    EnableColorBlend ¶

    EnableColorBlend :: proc "c" () ---
     

    General render state

    EnableDepthMask ¶

    EnableDepthMask :: proc "c" () ---
     

    Enable depth write

    EnableDepthTest ¶

    EnableDepthTest :: proc "c" () ---
     

    Enable depth test

    EnableFramebuffer ¶

    EnableFramebuffer :: proc "c" (id: u32) ---
     

    Framebuffer state

    EnablePointMode ¶

    EnablePointMode :: proc "c" () ---
     

    Enable point mode

    EnableScissorTest ¶

    EnableScissorTest :: proc "c" () ---
     

    Enable scissor test

    EnableShader ¶

    EnableShader :: proc "c" (id: u32) ---
     

    Shader state

    EnableSmoothLines ¶

    EnableSmoothLines :: proc "c" () ---
     

    Enable line aliasing

    EnableStereoRender ¶

    EnableStereoRender :: proc "c" () ---
     

    Enable stereo rendering

    EnableTexture ¶

    EnableTexture :: proc "c" (id: u32) ---
     

    Enable texture

    EnableTextureCubemap ¶

    EnableTextureCubemap :: proc "c" (id: u32) ---
     

    Enable texture cubemap

    EnableVertexArray ¶

    EnableVertexArray :: proc "c" (vaoId: u32) -> bool ---
     

    Vertex buffers state

    EnableVertexAttribute ¶

    EnableVertexAttribute :: proc "c" (index: u32) ---
     

    Enable vertex attribute index

    EnableVertexBuffer ¶

    EnableVertexBuffer :: proc "c" (id: u32) ---
     

    Enable vertex buffer (VBO)

    EnableVertexBufferElement ¶

    EnableVertexBufferElement :: proc "c" (id: u32) ---
     

    Enable vertex buffer element (VBO element)

    EnableWireMode ¶

    EnableWireMode :: proc "c" () ---
     

    Enable wire mode

    End ¶

    End :: proc "c" () ---
     

    Finish vertex providing

    FramebufferAttach ¶

    FramebufferAttach :: proc "c" (fboId, texId: u32, attachType: i32, texType: i32, mipLevel: i32) ---
     

    Attach texture/renderbuffer to a framebuffer

    FramebufferComplete ¶

    FramebufferComplete :: proc "c" (id: u32) -> bool ---
     

    Verify framebuffer is complete

    Frustum ¶

    Frustum :: proc "c" (
    	left, right, bottom, top, znear, 
    	zfar:                            f64, 
    ) ---

    GenTextureMipmaps ¶

    GenTextureMipmaps :: proc "c" (id: u32, width, height: i32, format: i32, mipmaps: ^i32) ---
     

    Generate mipmap data for selected texture

    GetCullDistanceFar ¶

    GetCullDistanceFar :: proc "c" () -> f64 ---
     

    Get cull plane distance far

    GetCullDistanceNear ¶

    GetCullDistanceNear :: proc "c" () -> f64 ---
     

    Get cull plane distance near

    GetFramebufferHeight ¶

    GetFramebufferHeight :: proc "c" () -> i32 ---
     

    Get default framebuffer height

    GetFramebufferWidth ¶

    GetFramebufferWidth :: proc "c" () -> i32 ---
     

    Get default framebuffer width

    GetGlTextureFormats ¶

    GetGlTextureFormats :: proc "c" (format: i32, glInternalFormat, glFormat, glType: ^u32) ---
     

    Get OpenGL internal formats

    GetLineWidth ¶

    GetLineWidth :: proc "c" () -> f32 ---
     

    Get the line drawing width

    GetLocationAttrib ¶

    GetLocationAttrib :: proc "c" (shaderId: u32, attribName: cstring) -> i32 ---
     

    Get shader location attribute

    GetLocationUniform ¶

    GetLocationUniform :: proc "c" (shaderId: u32, uniformName: cstring) -> i32 ---
     

    Get shader location uniform

    GetMatrixModelview ¶

    GetMatrixModelview :: proc "c" () -> matrix[4, 4]f32 ---
     

    Matrix state management

    GetMatrixProjection ¶

    GetMatrixProjection :: proc "c" () -> matrix[4, 4]f32 ---
     

    Get internal projection matrix

    GetMatrixProjectionStereo ¶

    GetMatrixProjectionStereo :: proc "c" (eye: i32) -> matrix[4, 4]f32 ---
     

    Get internal projection matrix for stereo render (selected eye)

    GetMatrixTransform ¶

    GetMatrixTransform :: proc "c" () -> matrix[4, 4]f32 ---
     

    Get internal accumulated transform matrix

    GetMatrixViewOffsetStereo ¶

    GetMatrixViewOffsetStereo :: proc "c" (eye: i32) -> matrix[4, 4]f32 ---
     

    Get internal view offset matrix for stereo render (selected eye)

    GetPixelFormatName ¶

    GetPixelFormatName :: proc "c" (format: u32) -> cstring ---
     

    Get name string for pixel format

    GetProcAddress ¶

    GetProcAddress :: proc "c" (procName: cstring) -> rawptr ---
     

    Get OpenGL procedure address

    GetShaderBufferSize ¶

    GetShaderBufferSize :: proc "c" (id: u32) -> u32 ---
     

    Get SSBO buffer size

    GetShaderIdDefault ¶

    GetShaderIdDefault :: proc "c" () -> u32 ---
     

    Get default shader id

    GetShaderLocsDefault ¶

    GetShaderLocsDefault :: proc "c" () -> [^]i32 ---
     

    Get default shader locations

    GetTextureIdDefault ¶

    GetTextureIdDefault :: proc "c" () -> u32 ---
     

    Get default texture id

    GetVersion ¶

    GetVersion :: proc "c" () -> GlVersion ---
     

    Get current OpenGL version

    Init ¶

    @(link_prefix="rlgl")
    Init :: proc "c" (width, height: i32) ---
     

    ------------------------------------------------------------------------------------ Functions Declaration - rlgl functionality ------------------------------------------------------------------------------------ rlgl initialization functions

    IsStereoRenderEnabled ¶

    IsStereoRenderEnabled :: proc "c" () -> bool ---
     

    Check if stereo render is enabled

    LoadComputeShaderProgram ¶

    LoadComputeShaderProgram :: proc "c" (shaderId: u32) -> u32 ---
     

    Compute shader management

    LoadDrawCube ¶

    LoadDrawCube :: proc "c" () ---
     

    Quick and dirty cube/quad buffers load->draw->unload

    LoadDrawQuad ¶

    LoadDrawQuad :: proc "c" () ---
     

    Load and draw a quad

    LoadExtensions ¶

    LoadExtensions :: proc "c" (loader: rawptr) ---
     

    Load OpenGL extensions (loader function required)

    LoadFramebuffer ¶

    LoadFramebuffer :: proc "c" () -> u32 ---
     

    Framebuffer management (fbo)

    LoadIdentity ¶

    LoadIdentity :: proc "c" () ---
     

    Reset current matrix to identity matrix

    LoadRenderBatch ¶

    LoadRenderBatch :: proc "c" (numBuffers, bufferElements: i32) -> RenderBatch ---
     

    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

    LoadShaderBuffer ¶

    LoadShaderBuffer :: proc "c" (size: u32, data: rawptr, usageHint: i32) -> u32 ---
     

    Shader buffer storage object management (ssbo)

    LoadShaderCode ¶

    LoadShaderCode :: proc "c" (vsCode, fsCode: cstring) -> u32 ---
     

    Shaders management

    LoadShaderProgram ¶

    LoadShaderProgram :: proc "c" (vShaderId, fShaderId: u32) -> u32 ---
     

    Load custom shader program

    LoadTexture ¶

    LoadTexture :: proc "c" (data: rawptr, width, height: i32, format: i32, mipmapCount: i32) -> u32 ---
     

    Textures management

    LoadTextureCubemap ¶

    LoadTextureCubemap :: proc "c" (data: rawptr, size: i32, format: i32) -> u32 ---
     

    Load texture cubemap

    LoadTextureDepth ¶

    LoadTextureDepth :: proc "c" (width, height: i32, useRenderBuffer: bool) -> u32 ---
     

    Load depth texture/renderbuffer (to be attached to fbo)

    LoadVertexArray ¶

    LoadVertexArray :: proc "c" () -> u32 ---
     

    Vertex buffers management

    LoadVertexBuffer ¶

    LoadVertexBuffer :: proc "c" (buffer: rawptr, size: i32, is_dynamic: bool) -> u32 ---
     

    Load a vertex buffer attribute

    LoadVertexBufferElement ¶

    LoadVertexBufferElement :: proc "c" (buffer: rawptr, size: i32, is_dynamic: bool) -> u32 ---
     

    Load a new attributes element buffer

    MatrixMode ¶

    MatrixMode :: proc "c" (mode: i32) ---
     

    ------------------------------------------------------------------------------------ Functions Declaration - Matrix operations ------------------------------------------------------------------------------------

    MultMatrixf ¶

    MultMatrixf :: proc "c" (matf: [^]f32) ---
     

    Multiply the current matrix by another matrix

    Normal3f ¶

    Normal3f :: proc "c" (x, y, z: f32) ---
     

    Define one vertex (normal) - 3 f32

    Ortho ¶

    Ortho :: proc "c" (
    	left, right, bottom, top, znear, 
    	zfar:                            f64, 
    ) ---

    PopMatrix ¶

    PopMatrix :: proc "c" () ---
     

    Pop lattest inserted matrix from stack

    PushMatrix ¶

    PushMatrix :: proc "c" () ---
     

    Push the current matrix to stack

    ReadScreenPixels ¶

    ReadScreenPixels :: proc "c" (width, height: i32) -> [^]u8 ---
     

    Read screen pixel data (color buffer)

    ReadShaderBuffer ¶

    ReadShaderBuffer :: proc "c" (id: u32, dest: rawptr, count: u32, offset: u32) ---
     

    Read SSBO buffer data (GPU->CPU)

    ReadTexturePixels ¶

    ReadTexturePixels :: proc "c" (id: u32, width, height: i32, format: i32) -> rawptr ---
     

    Read texture pixel data

    Rotatef ¶

    Rotatef :: proc "c" (angleDeg: f32, x, y, z: f32) ---
     

    Multiply the current matrix by a rotation matrix

    Scalef ¶

    Scalef :: proc "c" (x, y, z: f32) ---
     

    Multiply the current matrix by a scaling matrix

    Scissor ¶

    Scissor :: proc "c" (x, y, width, height: i32) ---
     

    Scissor test

    SetBlendFactors ¶

    SetBlendFactors :: proc "c" (glSrcFactor, glDstFactor, glEquation: i32) ---
     

    Set blending mode factor and equation (using OpenGL factors)

    SetBlendFactorsSeparate ¶

    SetBlendFactorsSeparate :: proc "c" (
    	glSrcRGB, glDstRGB, glSrcAlpha, glDstAlpha, glEqRGB, 
    	glEqAlpha:                                           i32, 
    ) ---
     

    Set blending mode factors and equations separately (using OpenGL factors)

    SetBlendMode ¶

    SetBlendMode :: proc "c" (mode: i32) ---
     

    Set blending mode

    SetClipPlanes ¶

    SetClipPlanes :: proc "c" (near, far: f64) ---
     

    Set clip planes distances

    SetCullFace ¶

    SetCullFace :: proc "c" (mode: CullMode) ---
     

    Set face culling mode

    SetFramebufferHeight ¶

    SetFramebufferHeight :: proc "c" (height: i32) ---
     

    Set current framebuffer height

    SetFramebufferWidth ¶

    SetFramebufferWidth :: proc "c" (width: i32) ---
     

    Set current framebuffer width

    SetLineWidth ¶

    SetLineWidth :: proc "c" (width: f32) ---
     

    Set the line drawing width

    SetMatrixModelview ¶

    SetMatrixModelview :: proc "c" (view: matrix[4, 4]f32) ---
     

    Set a custom modelview matrix (replaces internal modelview matrix)

    SetMatrixProjection ¶

    SetMatrixProjection :: proc "c" (proj: matrix[4, 4]f32) ---
     

    Set a custom projection matrix (replaces internal projection matrix)

    SetMatrixProjectionStereo ¶

    SetMatrixProjectionStereo :: proc "c" (right, left: matrix[4, 4]f32) ---
     

    Set eyes projection matrices for stereo rendering

    SetMatrixViewOffsetStereo ¶

    SetMatrixViewOffsetStereo :: proc "c" (right, left: matrix[4, 4]f32) ---
     

    Set eyes view offsets matrices for stereo rendering

    SetRenderBatchActive ¶

    SetRenderBatchActive :: proc "c" (batch: ^RenderBatch) ---
     

    Set the active render batch for rlgl (NULL for default internal)

    SetShader ¶

    SetShader :: proc "c" (id: u32, locs: [^]i32) ---
     

    Set shader currently active (id and locations)

    SetTexture ¶

    SetTexture :: proc "c" (id: u32) ---
     

    Set current texture for render batch and check buffers limits

    SetUniform ¶

    SetUniform :: proc "c" (locIndex: i32, value: rawptr, uniformType: i32, count: i32) ---
     

    Set shader value uniform

    SetUniformMatrix ¶

    SetUniformMatrix :: proc "c" (locIndex: i32, mat: matrix[4, 4]f32) ---
     

    Set shader value matrix

    SetUniformSampler ¶

    SetUniformSampler :: proc "c" (locIndex: i32, textureId: u32) ---
     

    Set shader value sampler

    SetVertexAttribute ¶

    SetVertexAttribute :: proc "c" (
    	index:      u32, 
    	compSize:   i32, 
    	type:       i32, 
    	normalized: bool, 
    	stride:     i32, 
    	offset:     i32, 
    ) ---

    SetVertexAttributeDefault ¶

    SetVertexAttributeDefault :: proc "c" (locIndex: i32, value: rawptr, attribType: i32, count: i32) ---
     

    Set vertex attribute default value

    SetVertexAttributeDivisor ¶

    SetVertexAttributeDivisor :: proc "c" (index: u32, divisor: i32) ---

    TexCoord2f ¶

    TexCoord2f :: proc "c" (x, y: f32) ---
     

    Define one vertex (texture coordinate) - 2 f32

    TextureParameters ¶

    TextureParameters :: proc "c" (id: u32, param: i32, value: i32) ---
     

    Set texture parameters (filter, wrap)

    Translatef ¶

    Translatef :: proc "c" (x, y, z: f32) ---
     

    Multiply the current matrix by a translation matrix

    UnloadFramebuffer ¶

    UnloadFramebuffer :: proc "c" (id: u32) ---
     

    Delete framebuffer from GPU

    UnloadRenderBatch ¶

    UnloadRenderBatch :: proc "c" (batch: RenderBatch) ---
     

    Unload render batch system

    UnloadShader ¶

    UnloadShader :: proc "c" (id: u32) ---
     

    Unload shader, loaded with rlLoadShader()

    UnloadShaderBuffer ¶

    UnloadShaderBuffer :: proc "c" (ssboId: u32) ---
     

    Unload shader storage buffer object (SSBO)

    UnloadShaderProgram ¶

    UnloadShaderProgram :: proc "c" (id: u32) ---
     

    Unload shader program

    UnloadTexture ¶

    UnloadTexture :: proc "c" (id: u32) ---
     

    Unload texture from GPU memory

    UnloadVertexArray ¶

    UnloadVertexArray :: proc "c" (vaoId: u32) ---

    UnloadVertexBuffer ¶

    UnloadVertexBuffer :: proc "c" (vboId: u32) ---

    UpdateShaderBuffer ¶

    UpdateShaderBuffer :: proc "c" (id: u32, data: rawptr, dataSize: u32, offset: u32) ---
     

    Update SSBO buffer data

    UpdateTexture ¶

    UpdateTexture :: proc "c" (
    	id:               u32, 
    	offsetX, offsetY: i32, 
    	width, height:    i32, 
    	format:           i32, 
    	data:             rawptr, 
    ) ---
     

    Update GPU texture with new data

    UpdateVertexBuffer ¶

    UpdateVertexBuffer :: proc "c" (bufferId: u32, data: rawptr, dataSize: i32, offset: i32) ---
     

    Update GPU buffer with new data

    UpdateVertexBufferElements ¶

    UpdateVertexBufferElements :: proc "c" (id: u32, data: rawptr, dataSize: i32, offset: i32) ---
     

    Update vertex buffer elements with new data

    Vertex2f ¶

    Vertex2f :: proc "c" (x, y: f32) ---
     

    Define one vertex (position) - 2 f32

    Vertex2i ¶

    Vertex2i :: proc "c" (x, y: i32) ---
     

    Define one vertex (position) - 2 int

    Vertex3f ¶

    Vertex3f :: proc "c" (x, y, z: f32) ---
     

    Define one vertex (position) - 3 f32

    Viewport ¶

    Viewport :: proc "c" (x, y, width, height: i32) ---
     

    Set the viewport area

    Procedure Groups

    This section is empty.

    `#config` values

    RAYLIB_SHARED ¶

    RAYLIB_SHARED :: #config(RAYLIB_SHARED, false)

    RAYLIB_WASM_LIB ¶

    RAYLIB_WASM_LIB :: #config(RAYLIB_WASM_LIB, "../wasm/libraylib.web.a")

    Source Files

    Generation Information

    Generated with odin version dev-2026-09 (vendor "odin") Windows_amd64 @ 2026-09-09 09:12:52.430476700 +0000 UTC