rlgl

Search:
Group by:
Source   Edit  

Types

BlendFactor {.size: 4.} = enum
  Zero,                     ## GL_ZERO
  One,                      ## GL_ONE
  SrcColor = 768,           ## GL_SRC_COLOR
  OneMinusSrcColor = 769,   ## GL_ONE_MINUS_SRC_COLOR
  SrcAlpha = 770,           ## GL_SRC_ALPHA
  OneMinusSrcAlpha = 771,   ## GL_One_MINUS_SRC_ALPHA
  DstAlpha = 772,           ## GL_DST_ALPHA
  OneMinusDstAlpha = 773,   ## GL_ONE_MINUS_DST_ALPHA
  DstColor = 774,           ## GL_DST_COLOR
  OneMinusDstColor = 775,   ## GL_ONE_MINUS_DST_COLOR
  SrcAlphaSaturate = 776,   ## GL_SRC_ALPHA_SATURATE
  ConstantColor = 32769,    ## GL_CONSTANT_COLOR
  OneMinusConstantColor = 32770, ## GL_ONE_MINUS_CONSTANT_COLOR
  ConstantAlpha = 32771,    ## GL_CONSTANT_ALPHA
  OneMinusConstantAlpha = 32772 ## GL_ONE_MINUS_CONSTANT_ALPHA
GL blending factors Source   Edit  
BlendFuncOrEq {.size: 4.} = enum
  BlendColor = 32773,       ## GL_BLEND_COLOR
  FuncAdd = 32774,          ## GL_FUNC_ADD
  Min = 32775,              ## GL_MIN
  Max = 32776,              ## GL_MAX
  BlendEquation = 32777,    ## GL_BLEND_EQUATION
  FuncSubtract = 32778,     ## GL_FUNC_SUBTRACT
  FuncReverseSubtract = 32779, ## GL_FUNC_REVERSE_SUBTRACT
  BlendDstRgb = 32968,      ## GL_BLEND_DST_RGB
  BlendSrcRgb = 32969,      ## GL_BLEND_SRC_RGB
  BlendDstAlpha = 32970,    ## GL_BLEND_DST_ALPHA
  BlendSrcAlpha = 32971,    ## GL_BLEND_SRC_ALPHA
  BlendEquationAlpha = 34877 ## GL_BLEND_EQUATION_ALPHA
GL blending functions/equations Source   Edit  
BufferUsageHint {.size: 4.} = enum
  StreamDraw = 35040,       ## GL_STREAM_DRAW
  StreamRead = 35041,       ## GL_STREAM_READ
  StreamCopy = 35042,       ## GL_STREAM_COPY
  StaticDraw = 35044,       ## GL_STATIC_DRAW
  StaticRead = 35045,       ## GL_STATIC_READ
  StaticCopy = 35046,       ## GL_STATIC_COPY
  DynamicDraw = 35048,      ## GL_DYNAMIC_DRAW
  DynamicRead = 35049,      ## GL_DYNAMIC_READ
  DynamicCopy = 35050        ## GL_DYNAMIC_COPY
GL buffer usage hint Source   Edit  
CullMode {.size: 4.} = enum
  FaceFront, FaceBack
Face culling mode Source   Edit  
DefaultShaderVariableName = enum
  AttribPosition = "vertexPosition", ## Binded by default to shader location: 0
  AttribTexcoord = "vertexTexCoord", ## Binded by default to shader location: 1
  AttribNormal = "vertexNormal", ## Binded by default to shader location: 2
  AttribColor = "vertexColor", ## Binded by default to shader location: 3
  AttribTangent = "vertexTangent", ## Binded by default to shader location: 4
  AttribTexcoord2 = "vertexTexCoord2", ## Binded by default to shader location: 5
  UniformMvp = "mvp",       ## model-view-projection matrix
  UniformView = "matView",  ## view matrix
  UniformProjection = "matProjection", ## projection matrix
  UniformModel = "matModel", ## model matrix
  UniformNormal = "matNormal", ## normal matrix (transpose(inverse(matModelView))
  UniformColor = "colDiffuse", ## color diffuse (base tint color, multiplied by texture color)
  Sampler2dTexture0 = "texture0", ## texture0 (texture slot active 0)
  Sampler2dTexture1 = "texture1", ## texture1 (texture slot active 1)
  Sampler2dTexture2 = "texture2" ## texture2 (texture slot active 2)
Default shader vertex attribute names to set location points Source   Edit  
DrawCall {.importc: "rlDrawCall", nodecl, bycopy.} = object
  mode*: int32               ## Drawing mode: LINES, TRIANGLES, QUADS
  vertexCount*: int32        ## Number of vertex of the draw
  vertexAlignment*: int32    ## Number of vertex required for index alignment (LINES, TRIANGLES)
  textureId*: uint32         ## Texture id to be used on the draw -> Use to create new draw call if changes
of those state-change happens (this is done in core module) Source   Edit  
DrawMode {.size: 4.} = enum
  Lines = 1,                ## GL_LINES
  Triangles = 4,            ## GL_TRIANGLES
  Quads = 7                  ## GL_QUADS
Primitive assembly draw modes Source   Edit  
FramebufferAttachTextureType {.size: 4.} = enum
  CubemapPositiveX,         ## Framebuffer texture attachment type: cubemap, +X side
  CubemapNegativeX,         ## Framebuffer texture attachment type: cubemap, -X side
  CubemapPositiveY,         ## Framebuffer texture attachment type: cubemap, +Y side
  CubemapNegativeY,         ## Framebuffer texture attachment type: cubemap, -Y side
  CubemapPositiveZ,         ## Framebuffer texture attachment type: cubemap, +Z side
  CubemapNegativeZ,         ## 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 Source   Edit  
FramebufferAttachType {.size: 4.} = enum
  ColorChannel0,            ## Framebuffer attachment type: color 0
  ColorChannel1,            ## Framebuffer attachment type: color 1
  ColorChannel2,            ## Framebuffer attachment type: color 2
  ColorChannel3,            ## Framebuffer attachment type: color 3
  ColorChannel4,            ## Framebuffer attachment type: color 4
  ColorChannel5,            ## Framebuffer attachment type: color 5
  ColorChannel6,            ## Framebuffer attachment type: color 6
  ColorChannel7,            ## Framebuffer attachment type: color 7
  Depth = 100,              ## Framebuffer attachment type: depth
  Stencil = 200              ## Framebuffer attachment type: stencil
Framebuffer attachment type Source   Edit  
GlType {.size: 4.} = enum
  UnsignedByte = 5121,      ## GL_UNSIGNED_BYTE
  Float = 5126               ## GL_FLOAT
GL equivalent data types Source   Edit  
GlVersion {.size: 4.} = enum
  Opengl11 = 1,             ## OpenGL 1.1
  Opengl21,                 ## OpenGL 2.1 (GLSL 120)
  Opengl33,                 ## OpenGL 3.3 (GLSL 330)
  Opengl43,                 ## OpenGL 4.3 (using GLSL 330)
  OpenglEs20,               ## OpenGL ES 2.0 (GLSL 100)
  OpenglEs30                 ## OpenGL ES 3.0 (GLSL 300 es)
OpenGL version Source   Edit  
IndicesArr = array[6, uint32]
Source   Edit  
MatrixMode {.size: 4.} = enum
  Modelview = 5888,         ## GL_MODELVIEW
  Projection = 5889,        ## GL_PROJECTION
  Texture = 5890             ## GL_TEXTURE
Matrix modes (equivalent to OpenGL) Source   Edit  
RenderBatch {.importc: "rlRenderBatch", nodecl, bycopy.} = object
  ## Number of vertex buffers (multi-buffering support)
  currentBuffer*: int32      ## Current buffer tracking in case of multi-buffering
  ## Dynamic buffer(s) for vertex data
  ## Draw calls array, depends on textureId
  drawCounter*: int32        ## Draw calls counter
  currentDepth*: float32     ## Current depth value for next draw
rlRenderBatch type Source   Edit  
rlglLoadProc = proc (name: cstring): pointer
OpenGL extension functions loader signature (same as GLADloadproc) Source   Edit  
ShaderType {.size: 4.} = enum
  FragmentShader = 35632,   ## GL_FRAGMENT_SHADER
  VertexShader = 35633,     ## GL_VERTEX_SHADER
  ComputeShader = 37305      ## GL_COMPUTE_SHADER
GL Shader type Source   Edit  
TextureParameter {.size: 4.} = enum
  FilterNearest = 9728,     ## GL_NEAREST
  FilterLinear = 9729,      ## GL_LINEAR
  FilterMipNearest = 9984,  ## GL_NEAREST_MIPMAP_NEAREST
  FilterLinearMipNearest = 9985, ## GL_LINEAR_MIPMAP_NEAREST
  FilterNearestMipLinear = 9986, ## GL_NEAREST_MIPMAP_LINEAR
  FilterMipLinear = 9987,   ## GL_LINEAR_MIPMAP_LINEAR
  MagFilter = 10240,        ## GL_TEXTURE_MAG_FILTER
  MinFilter = 10241,        ## GL_TEXTURE_MIN_FILTER
  WrapS = 10242,            ## GL_TEXTURE_WRAP_S
  WrapT = 10243,            ## GL_TEXTURE_WRAP_T
  WrapRepeat = 10497,       ## GL_REPEAT
  FilterAnisotropic = 12288, ## Anisotropic filter (custom identifier)
  MipmapBiasRatio = 16384,  ## Texture mipmap bias, percentage ratio (custom identifier)
  WrapClamp = 33071,        ## GL_CLAMP_TO_EDGE
  WrapMirrorRepeat = 33648, ## GL_MIRRORED_REPEAT
  WrapMirrorClamp = 34626    ## GL_MIRROR_CLAMP_EXT
Texture parameters (equivalent to OpenGL defines) Source   Edit  
VertexBuffer {.importc: "rlVertexBuffer", nodecl, bycopy.} = object
  ## Number of elements in the buffer (QUADS)
  ## Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
  ## Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
  ## Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
  when not UseEmbeddedGraphicsApi:
    ## Vertex indices (in case vertex data comes indexed) (6 indices per quad)
  else:
  vaoId*: uint32             ## OpenGL Vertex Array Object id
  vboId*: array[4, uint32]   ## OpenGL Vertex Buffer Objects id (4 types of vertex data)
Dynamic vertex buffers (position + texcoords + colors + indices arrays) Source   Edit  

Consts

CullDistanceFar = 1000.0
Default far cull distance Source   Edit  
CullDistanceNear = 0.01
Default near cull distance Source   Edit  
DefaultBatchBufferElements = 8192
This is the maximum amount of elements (quads) per batch NOTE: Be careful with text, every letter maps to a quad Source   Edit  
DefaultBatchBuffers = 1
Default number of batch buffers (multi-buffering) Source   Edit  
DefaultBatchDrawCalls = 256
Default number of batch draw calls (by state changes: mode, texture) Source   Edit  
DefaultBatchMaxTextureUnits = 4
Maximum number of textures units that can be activated on batch drawing Source   Edit  
MaxMatrixStackSize = 32
Maximum size of Matrix stack Source   Edit  
RlglVersion = (5, 1, 0)
Source   Edit  

Procs

proc `=copy`(dest: var RenderBatch; source: RenderBatch) {.error.}
Source   Edit  
proc `=copy`(dest: var VertexBuffer; source: VertexBuffer) {.error.}
Source   Edit  
proc `=destroy`(x: RenderBatch) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc `=dup`(source: RenderBatch): RenderBatch {.error.}
Source   Edit  
proc `=dup`(source: VertexBuffer): VertexBuffer {.error.}
Source   Edit  
proc `=sink`(dest: var VertexBuffer; source: VertexBuffer) {.error.}
Source   Edit  
proc `[]`(x: RenderBatchDraws; i: int): lent DrawCall {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `[]`(x: RenderBatchVertexBuffer; i: int): lent VertexBuffer {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc `[]`(x: var RenderBatchDraws; i: int): var DrawCall {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `[]`(x: var RenderBatchVertexBuffer; i: int): var VertexBuffer {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc `[]`(x: var VertexBufferColors; i: int): var Color {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `[]`(x: var VertexBufferIndices; i: int): var IndicesArr {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc `[]`(x: var VertexBufferTexcoords; i: int): var Vector2 {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc `[]`(x: var VertexBufferVertices; i: int): var Vector3 {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc `[]`(x: VertexBufferColors; i: int): Color {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `[]`(x: VertexBufferIndices; i: int): IndicesArr {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `[]`(x: VertexBufferTexcoords; i: int): Vector2 {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `[]`(x: VertexBufferVertices; i: int): Vector3 {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `[]=`(x: var VertexBufferColors; i: int; val: Color) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc `[]=`(x: var VertexBufferIndices; i: int; val: IndicesArr) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc `[]=`(x: var VertexBufferTexcoords; i: int; val: Vector2) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc `[]=`(x: var VertexBufferVertices; i: int; val: Vector3) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc activeDrawBuffers(count: int32) {.importc: "rlActiveDrawBuffers",
                                       header: "rlgl.h", ...raises: [], tags: [],
                                       forbids: [].}
Activate multiple draw color buffers Source   Edit  
proc activeTextureSlot(slot: int32) {.importc: "rlActiveTextureSlot",
                                      header: "rlgl.h", ...raises: [], tags: [],
                                      forbids: [].}
Select and active a texture slot Source   Edit  
proc bindImageTexture(id: uint32; index: uint32; format: PixelFormat;
                      readonly: bool) {.importc: "rlBindImageTexture",
                                        header: "rlgl.h", ...raises: [], tags: [],
                                        forbids: [].}
Bind image texture Source   Edit  
proc bindShaderBuffer(id: uint32; index: uint32) {.
    importc: "rlBindShaderBuffer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Bind SSBO buffer Source   Edit  
proc blitFramebuffer(srcX: int32; srcY: int32; srcWidth: int32;
                     srcHeight: int32; dstX: int32; dstY: int32;
                     dstWidth: int32; dstHeight: int32; bufferMask: int32) {.
    importc: "rlBlitFramebuffer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Blit active framebuffer to main framebuffer Source   Edit  
proc bufferCount(x: RenderBatch): int32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc checkErrors() {.importc: "rlCheckErrors", header: "rlgl.h", ...raises: [],
                     tags: [], forbids: [].}
Check and log OpenGL error codes Source   Edit  
proc checkRenderBatchLimit(vCount: int32): bool {.
    importc: "rlCheckRenderBatchLimit", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Check internal buffer overflow for a given number of vertex Source   Edit  
proc clearColor(r: uint8; g: uint8; b: uint8; a: uint8) {.
    importc: "rlClearColor", header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Clear color buffer with color Source   Edit  
proc clearScreenBuffers() {.importc: "rlClearScreenBuffers", header: "rlgl.h",
                            ...raises: [], tags: [], forbids: [].}
Clear used screen buffers (color and depth) Source   Edit  
proc color3f(x: float32; y: float32; z: float32) {.importc: "rlColor3f",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Define one vertex (color) - 3 float Source   Edit  
proc color4f(x: float32; y: float32; z: float32; w: float32) {.
    importc: "rlColor4f", header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Define one vertex (color) - 4 float Source   Edit  
proc color4ub(r: uint8; g: uint8; b: uint8; a: uint8) {.importc: "rlColor4ub",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Define one vertex (color) - 4 byte Source   Edit  
proc compileShader(shaderCode: cstring; type: ShaderType): uint32 {.
    importc: "rlCompileShader", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER) Source   Edit  
proc computeShaderDispatch(groupX: uint32; groupY: uint32; groupZ: uint32) {.
    importc: "rlComputeShaderDispatch", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Dispatch compute shader (equivalent to draw for graphics pipeline) Source   Edit  
proc copyShaderBuffer(destId: uint32; srcId: uint32; destOffset: uint32;
                      srcOffset: uint32; count: uint32) {.
    importc: "rlCopyShaderBuffer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Copy SSBO data between buffers Source   Edit  
proc cubemapParameters(id: uint32; param: int32; value: int32) {.
    importc: "rlCubemapParameters", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Set cubemap parameters (filter, wrap) Source   Edit  
proc disableBackfaceCulling() {.importc: "rlDisableBackfaceCulling",
                                header: "rlgl.h", ...raises: [], tags: [],
                                forbids: [].}
Disable backface culling Source   Edit  
proc disableColorBlend() {.importc: "rlDisableColorBlend", header: "rlgl.h",
                           ...raises: [], tags: [], forbids: [].}
Disable color blending Source   Edit  
proc disableDepthMask() {.importc: "rlDisableDepthMask", header: "rlgl.h",
                          ...raises: [], tags: [], forbids: [].}
Disable depth write Source   Edit  
proc disableDepthTest() {.importc: "rlDisableDepthTest", header: "rlgl.h",
                          ...raises: [], tags: [], forbids: [].}
Disable depth test Source   Edit  
proc disableFramebuffer() {.importc: "rlDisableFramebuffer", header: "rlgl.h",
                            ...raises: [], tags: [], forbids: [].}
Disable render texture (fbo), return to default framebuffer Source   Edit  
proc disableScissorTest() {.importc: "rlDisableScissorTest", header: "rlgl.h",
                            ...raises: [], tags: [], forbids: [].}
Disable scissor test Source   Edit  
proc disableShader() {.importc: "rlDisableShader", header: "rlgl.h", ...raises: [],
                       tags: [], forbids: [].}
Disable shader program Source   Edit  
proc disableSmoothLines() {.importc: "rlDisableSmoothLines", header: "rlgl.h",
                            ...raises: [], tags: [], forbids: [].}
Disable line aliasing Source   Edit  
proc disableStatePointer(vertexAttribType: int32) {.
    importc: "rlDisableStatePointer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Disable attribute state pointer Source   Edit  
proc disableStereoRender() {.importc: "rlDisableStereoRender", header: "rlgl.h",
                             ...raises: [], tags: [], forbids: [].}
Disable stereo rendering Source   Edit  
proc disableTexture() {.importc: "rlDisableTexture", header: "rlgl.h",
                        ...raises: [], tags: [], forbids: [].}
Disable texture Source   Edit  
proc disableTextureCubemap() {.importc: "rlDisableTextureCubemap",
                               header: "rlgl.h", ...raises: [], tags: [],
                               forbids: [].}
Disable texture cubemap Source   Edit  
proc disableVertexArray() {.importc: "rlDisableVertexArray", header: "rlgl.h",
                            ...raises: [], tags: [], forbids: [].}
Disable vertex array (VAO, if supported) Source   Edit  
proc disableVertexAttribute(index: uint32) {.
    importc: "rlDisableVertexAttribute", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Disable vertex attribute index Source   Edit  
proc disableVertexBuffer() {.importc: "rlDisableVertexBuffer", header: "rlgl.h",
                             ...raises: [], tags: [], forbids: [].}
Disable vertex buffer (VBO) Source   Edit  
proc disableVertexBufferElement() {.importc: "rlDisableVertexBufferElement",
                                    header: "rlgl.h", ...raises: [], tags: [],
                                    forbids: [].}
Disable vertex buffer element (VBO element) Source   Edit  
proc disableWireMode() {.importc: "rlDisableWireMode", header: "rlgl.h",
                         ...raises: [], tags: [], forbids: [].}
Disable wire mode ( and point ) maybe rename Source   Edit  
proc drawRenderBatch(batch: var RenderBatch) {.importc: "rlDrawRenderBatch",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Draw render batch data (Update->Draw->Reset) Source   Edit  
proc drawRenderBatchActive() {.importc: "rlDrawRenderBatchActive",
                               header: "rlgl.h", ...raises: [], tags: [],
                               forbids: [].}
Update and draw internal render batch Source   Edit  
proc drawVertexArray(offset: int32; count: int32) {.
    importc: "rlDrawVertexArray", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Draw vertex array (currently active vao) Source   Edit  
proc drawVertexArrayElements(offset: int32; count: int32; buffer: pointer) {.
    importc: "rlDrawVertexArrayElements", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Draw vertex array elements Source   Edit  
proc drawVertexArrayElementsInstanced(offset: int32; count: int32;
                                      buffer: pointer; instances: int32) {.
    importc: "rlDrawVertexArrayElementsInstanced", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Draw vertex array elements with instancing Source   Edit  
proc drawVertexArrayInstanced(offset: int32; count: int32; instances: int32) {.
    importc: "rlDrawVertexArrayInstanced", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Draw vertex array (currently active vao) with instancing Source   Edit  
proc elementCount(x: VertexBuffer): int32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc enableBackfaceCulling() {.importc: "rlEnableBackfaceCulling",
                               header: "rlgl.h", ...raises: [], tags: [],
                               forbids: [].}
Enable backface culling Source   Edit  
proc enableColorBlend() {.importc: "rlEnableColorBlend", header: "rlgl.h",
                          ...raises: [], tags: [], forbids: [].}
Enable color blending Source   Edit  
proc enableDepthMask() {.importc: "rlEnableDepthMask", header: "rlgl.h",
                         ...raises: [], tags: [], forbids: [].}
Enable depth write Source   Edit  
proc enableDepthTest() {.importc: "rlEnableDepthTest", header: "rlgl.h",
                         ...raises: [], tags: [], forbids: [].}
Enable depth test Source   Edit  
proc enableFramebuffer(id: uint32) {.importc: "rlEnableFramebuffer",
                                     header: "rlgl.h", ...raises: [], tags: [],
                                     forbids: [].}
Enable render texture (fbo) Source   Edit  
proc enablePointMode() {.importc: "rlEnablePointMode", header: "rlgl.h",
                         ...raises: [], tags: [], forbids: [].}
Enable point mode Source   Edit  
proc enableScissorTest() {.importc: "rlEnableScissorTest", header: "rlgl.h",
                           ...raises: [], tags: [], forbids: [].}
Enable scissor test Source   Edit  
proc enableShader(id: uint32) {.importc: "rlEnableShader", header: "rlgl.h",
                                ...raises: [], tags: [], forbids: [].}
Enable shader program Source   Edit  
proc enableSmoothLines() {.importc: "rlEnableSmoothLines", header: "rlgl.h",
                           ...raises: [], tags: [], forbids: [].}
Enable line aliasing Source   Edit  
proc enableStatePointer(vertexAttribType: int32; buffer: pointer) {.
    importc: "rlEnableStatePointer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Enable attribute state pointer Source   Edit  
proc enableStereoRender() {.importc: "rlEnableStereoRender", header: "rlgl.h",
                            ...raises: [], tags: [], forbids: [].}
Enable stereo rendering Source   Edit  
proc enableTexture(id: uint32) {.importc: "rlEnableTexture", header: "rlgl.h",
                                 ...raises: [], tags: [], forbids: [].}
Enable texture Source   Edit  
proc enableTextureCubemap(id: uint32) {.importc: "rlEnableTextureCubemap",
                                        header: "rlgl.h", ...raises: [], tags: [],
                                        forbids: [].}
Enable texture cubemap Source   Edit  
proc enableVertexArray(vaoId: uint32): bool {.importc: "rlEnableVertexArray",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Enable vertex array (VAO, if supported) Source   Edit  
proc enableVertexAttribute(index: uint32) {.importc: "rlEnableVertexAttribute",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Enable vertex attribute index Source   Edit  
proc enableVertexBuffer(id: uint32) {.importc: "rlEnableVertexBuffer",
                                      header: "rlgl.h", ...raises: [], tags: [],
                                      forbids: [].}
Enable vertex buffer (VBO) Source   Edit  
proc enableVertexBufferElement(id: uint32) {.
    importc: "rlEnableVertexBufferElement", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Enable vertex buffer element (VBO element) Source   Edit  
proc enableWireMode() {.importc: "rlEnableWireMode", header: "rlgl.h",
                        ...raises: [], tags: [], forbids: [].}
Enable wire mode Source   Edit  
proc framebufferAttach(fboId: uint32; texId: uint32;
                       attachType: FramebufferAttachType;
                       texType: FramebufferAttachTextureType; mipLevel: int32) {.
    importc: "rlFramebufferAttach", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Attach texture/renderbuffer to a framebuffer Source   Edit  
proc framebufferComplete(id: uint32): bool {.importc: "rlFramebufferComplete",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Verify framebuffer is complete Source   Edit  
proc frustum(left: float; right: float; bottom: float; top: float; znear: float;
             zfar: float) {.importc: "rlFrustum", header: "rlgl.h", ...raises: [],
                            tags: [], forbids: [].}
Source   Edit  
proc genTextureMipmaps(id: uint32; width: int32; height: int32;
                       format: PixelFormat; mipmaps: out int32) {.
    importc: "rlGenTextureMipmaps", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Generate mipmap data for selected texture Source   Edit  
proc getFramebufferHeight(): int32 {.importc: "rlGetFramebufferHeight",
                                     header: "rlgl.h", ...raises: [], tags: [],
                                     forbids: [].}
Get default framebuffer height Source   Edit  
proc getFramebufferWidth(): int32 {.importc: "rlGetFramebufferWidth",
                                    header: "rlgl.h", ...raises: [], tags: [],
                                    forbids: [].}
Get default framebuffer width Source   Edit  
proc getGlTextureFormats(format: PixelFormat; glInternalFormat: out uint32;
                         glFormat: out uint32; glType: out uint32) {.
    importc: "rlGetGlTextureFormats", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Get OpenGL internal formats Source   Edit  
proc getLineWidth(): float32 {.importc: "rlGetLineWidth", header: "rlgl.h",
                               ...raises: [], tags: [], forbids: [].}
Get the line drawing width Source   Edit  
proc getLocationAttrib(shaderId: uint32; attribName: cstring): ShaderLocation {.
    importc: "rlGetLocationAttrib", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Get shader location attribute Source   Edit  
proc getLocationUniform(shaderId: uint32; uniformName: cstring): ShaderLocation {.
    importc: "rlGetLocationUniform", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Get shader location uniform Source   Edit  
proc getMatrixModelview(): Matrix {.importc: "rlGetMatrixModelview",
                                    header: "rlgl.h", ...raises: [], tags: [],
                                    forbids: [].}
Get internal modelview matrix Source   Edit  
proc getMatrixProjection(): Matrix {.importc: "rlGetMatrixProjection",
                                     header: "rlgl.h", ...raises: [], tags: [],
                                     forbids: [].}
Get internal projection matrix Source   Edit  
proc getMatrixProjectionStereo(eye: int32): Matrix {.
    importc: "rlGetMatrixProjectionStereo", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Get internal projection matrix for stereo render (selected eye) Source   Edit  
proc getMatrixTransform(): Matrix {.importc: "rlGetMatrixTransform",
                                    header: "rlgl.h", ...raises: [], tags: [],
                                    forbids: [].}
Get internal accumulated transform matrix Source   Edit  
proc getMatrixViewOffsetStereo(eye: int32): Matrix {.
    importc: "rlGetMatrixViewOffsetStereo", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Get internal view offset matrix for stereo render (selected eye) Source   Edit  
proc getPixelFormatName(format: PixelFormat): string {....raises: [], tags: [],
    forbids: [].}
Get name string for pixel format Source   Edit  
proc getShaderBufferSize(id: uint32): uint32 {.importc: "rlGetShaderBufferSize",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Get SSBO buffer size Source   Edit  
proc getShaderIdDefault(): uint32 {.importc: "rlGetShaderIdDefault",
                                    header: "rlgl.h", ...raises: [], tags: [],
                                    forbids: [].}
Get default shader id Source   Edit  
proc getShaderLocsDefault(): ShaderLocsPtr {.importc: "rlGetShaderLocsDefault",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Get default shader locations Source   Edit  
proc getTextureIdDefault(): uint32 {.importc: "rlGetTextureIdDefault",
                                     header: "rlgl.h", ...raises: [], tags: [],
                                     forbids: [].}
Get default texture id Source   Edit  
proc getVersion(): GlVersion {.importc: "rlGetVersion", header: "rlgl.h",
                               ...raises: [], tags: [], forbids: [].}
Get current OpenGL version Source   Edit  
proc isStereoRenderEnabled(): bool {.importc: "rlIsStereoRenderEnabled",
                                     header: "rlgl.h", ...raises: [], tags: [],
                                     forbids: [].}
Check if stereo render is enabled Source   Edit  
proc loadComputeShaderProgram(shaderId: uint32): uint32 {.
    importc: "rlLoadComputeShaderProgram", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Load compute shader program Source   Edit  
proc loadDrawCube() {.importc: "rlLoadDrawCube", header: "rlgl.h", ...raises: [],
                      tags: [], forbids: [].}
Load and draw a cube Source   Edit  
proc loadDrawQuad() {.importc: "rlLoadDrawQuad", header: "rlgl.h", ...raises: [],
                      tags: [], forbids: [].}
Load and draw a quad Source   Edit  
proc loadExtensions(loader: rlglLoadProc) {.importc: "rlLoadExtensions",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Load OpenGL extensions (loader function required) Source   Edit  
proc loadFramebuffer(width: int32; height: int32): uint32 {.
    importc: "rlLoadFramebuffer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Load an empty framebuffer Source   Edit  
proc loadIdentity() {.importc: "rlLoadIdentity", header: "rlgl.h", ...raises: [],
                      tags: [], forbids: [].}
Reset current matrix to identity matrix Source   Edit  
proc loadRenderBatch(numBuffers: int32; bufferElements: int32): RenderBatch {.
    importc: "rlLoadRenderBatch", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Load a render batch system Source   Edit  
proc loadShaderBuffer(size: uint32; data: pointer; usageHint: BufferUsageHint): uint32 {.
    importc: "rlLoadShaderBuffer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Load shader storage buffer object (SSBO) Source   Edit  
proc loadShaderCode(vsCode: cstring; fsCode: cstring): uint32 {.
    importc: "rlLoadShaderCode", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Load shader from code strings Source   Edit  
proc loadShaderProgram(vShaderId: uint32; fShaderId: uint32): uint32 {.
    importc: "rlLoadShaderProgram", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Load custom shader program Source   Edit  
proc loadTexture(data: pointer; width: int32; height: int32; format: int32;
                 mipmapCount: int32): uint32 {.importc: "rlLoadTexture",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Load texture data Source   Edit  
proc loadTextureCubemap(data: pointer; size: int32; format: PixelFormat): uint32 {.
    importc: "rlLoadTextureCubemap", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Load texture cubemap data Source   Edit  
proc loadTextureDepth(width: int32; height: int32; useRenderBuffer: bool): uint32 {.
    importc: "rlLoadTextureDepth", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Load depth texture/renderbuffer (to be attached to fbo) Source   Edit  
proc loadVertexArray(): uint32 {.importc: "rlLoadVertexArray", header: "rlgl.h",
                                 ...raises: [], tags: [], forbids: [].}
Load vertex array (vao) if supported Source   Edit  
proc loadVertexBuffer(buffer: pointer; size: int32; dynamic: bool): uint32 {.
    importc: "rlLoadVertexBuffer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Load a vertex buffer object Source   Edit  
proc loadVertexBufferElement(buffer: pointer; size: int32; dynamic: bool): uint32 {.
    importc: "rlLoadVertexBufferElement", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Load vertex buffer elements object Source   Edit  
proc matrixMode(mode: MatrixMode) {.importc: "rlMatrixMode", header: "rlgl.h",
                                    ...raises: [], tags: [], forbids: [].}
Choose the current matrix to be transformed Source   Edit  
proc multMatrixf(matf: array[16, float32]) {.importc: "rlMultMatrixf",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Multiply the current matrix by another matrix Source   Edit  
proc normal3f(x: float32; y: float32; z: float32) {.importc: "rlNormal3f",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Define one vertex (normal) - 3 float Source   Edit  
proc ortho(left: float; right: float; bottom: float; top: float; znear: float;
           zfar: float) {.importc: "rlOrtho", header: "rlgl.h", ...raises: [],
                          tags: [], forbids: [].}
Source   Edit  
proc popMatrix() {.importc: "rlPopMatrix", header: "rlgl.h", ...raises: [],
                   tags: [], forbids: [].}
Pop latest inserted matrix from stack Source   Edit  
proc pushMatrix() {.importc: "rlPushMatrix", header: "rlgl.h", ...raises: [],
                    tags: [], forbids: [].}
Push the current matrix to stack Source   Edit  
proc readScreenPixels(width: int32; height: int32): var uint8 {.
    importc: "rlReadScreenPixels", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Read screen pixel data (color buffer) Source   Edit  
proc readShaderBuffer(id: uint32; dest: pointer; count: uint32; offset: uint32) {.
    importc: "rlReadShaderBuffer", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Read SSBO buffer data (GPU->CPU) Source   Edit  
proc readTexturePixels(id: uint32; width: int32; height: int32;
                       format: PixelFormat): pointer {.
    importc: "rlReadTexturePixels", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Read texture pixel data Source   Edit  
proc rlBegin(mode: DrawMode) {.importc: "rlBegin", header: "rlgl.h", ...raises: [],
                               tags: [], forbids: [].}
Initialize drawing mode (how to organize vertex) Source   Edit  
proc rlEnd() {.importc: "rlEnd", header: "rlgl.h", ...raises: [], tags: [],
               forbids: [].}
Finish vertex providing Source   Edit  
proc rlglClose() {.importc: "rlglClose", header: "rlgl.h", ...raises: [], tags: [],
                   forbids: [].}
De-initialize rlgl (buffers, shaders, textures) Source   Edit  
proc rlglInit(width: int32; height: int32) {.importc: "rlglInit",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Initialize rlgl (buffers, shaders, textures, states) Source   Edit  
proc rotatef(angle: float32; x: float32; y: float32; z: float32) {.
    importc: "rlRotatef", header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Multiply the current matrix by a rotation matrix Source   Edit  
proc scalef(x: float32; y: float32; z: float32) {.importc: "rlScalef",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Multiply the current matrix by a scaling matrix Source   Edit  
proc scissor(x: int32; y: int32; width: int32; height: int32) {.
    importc: "rlScissor", header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Scissor test Source   Edit  
proc setBlendFactors(glSrcFactor: BlendFactor; glDstFactor: BlendFactor;
                     glEquation: BlendFuncOrEq) {.importc: "rlSetBlendFactors",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Set blending mode factor and equation (using OpenGL factors) Source   Edit  
proc setBlendFactorsSeparate(glSrcRGB: BlendFactor; glDstRGB: BlendFactor;
                             glSrcAlpha: BlendFactor; glDstAlpha: BlendFactor;
                             glEqRGB: BlendFuncOrEq; glEqAlpha: BlendFuncOrEq) {.
    importc: "rlSetBlendFactorsSeparate", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Set blending mode factors and equations separately (using OpenGL factors) Source   Edit  
proc setBlendMode(mode: BlendMode) {.importc: "rlSetBlendMode",
                                     header: "rlgl.h", ...raises: [], tags: [],
                                     forbids: [].}
Set blending mode Source   Edit  
proc setCullFace(mode: CullMode) {.importc: "rlSetCullFace", header: "rlgl.h",
                                   ...raises: [], tags: [], forbids: [].}
Set face culling mode Source   Edit  
proc setFramebufferHeight(height: int32) {.importc: "rlSetFramebufferHeight",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Set current framebuffer height Source   Edit  
proc setFramebufferWidth(width: int32) {.importc: "rlSetFramebufferWidth",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Set current framebuffer width Source   Edit  
proc setLineWidth(width: float32) {.importc: "rlSetLineWidth", header: "rlgl.h",
                                    ...raises: [], tags: [], forbids: [].}
Set the line drawing width Source   Edit  
proc setMatrixModelview(view: Matrix) {.importc: "rlSetMatrixModelview",
                                        header: "rlgl.h", ...raises: [], tags: [],
                                        forbids: [].}
Set a custom modelview matrix (replaces internal modelview matrix) Source   Edit  
proc setMatrixProjection(proj: Matrix) {.importc: "rlSetMatrixProjection",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Set a custom projection matrix (replaces internal projection matrix) Source   Edit  
proc setMatrixProjectionStereo(right: Matrix; left: Matrix) {.
    importc: "rlSetMatrixProjectionStereo", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Set eyes projection matrices for stereo rendering Source   Edit  
proc setMatrixViewOffsetStereo(right: Matrix; left: Matrix) {.
    importc: "rlSetMatrixViewOffsetStereo", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Set eyes view offsets matrices for stereo rendering Source   Edit  
proc setRenderBatchActive(batch: var RenderBatch) {.
    importc: "rlSetRenderBatchActive", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Set the active render batch for rlgl (NULL for default internal) Source   Edit  
proc setShader(id: uint32; locs: ShaderLocsPtr) {.importc: "rlSetShader",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Set shader currently active (id and locations) Source   Edit  
proc setTexture(id: uint32) {.importc: "rlSetTexture", header: "rlgl.h",
                              ...raises: [], tags: [], forbids: [].}
Set current texture for render batch and check buffers limits Source   Edit  
proc setUniform(locIndex: ShaderLocation; value: pointer;
                uniformType: ShaderUniformDataType; count: int32) {.
    importc: "rlSetUniform", header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Set shader value uniform Source   Edit  
proc setUniformMatrix(locIndex: ShaderLocation; mat: Matrix) {.
    importc: "rlSetUniformMatrix", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Set shader value matrix Source   Edit  
proc setUniformSampler(locIndex: ShaderLocation; textureId: uint32) {.
    importc: "rlSetUniformSampler", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Set shader value sampler Source   Edit  
proc setVertexAttribute(index: uint32; compSize: int32; type: GlType;
                        normalized: bool; stride: int32; pointer: pointer) {.
    importc: "rlSetVertexAttribute", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Set vertex attribute data configuration Source   Edit  
proc setVertexAttributeDefault(locIndex: ShaderLocation; value: pointer;
                               attribType: ShaderAttributeDataType; count: int32) {.
    importc: "rlSetVertexAttributeDefault", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Set vertex attribute default value, when attribute to provided Source   Edit  
proc setVertexAttributeDivisor(index: uint32; divisor: int32) {.
    importc: "rlSetVertexAttributeDivisor", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Set vertex attribute data divisor Source   Edit  
proc texCoord2f(x: float32; y: float32) {.importc: "rlTexCoord2f",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Define one vertex (texture coordinate) - 2 float Source   Edit  
proc textureParameters(id: uint32; param: TextureParameter; value: int32) {.
    importc: "rlTextureParameters", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Set texture parameters (filter, wrap) Source   Edit  
proc translatef(x: float32; y: float32; z: float32) {.importc: "rlTranslatef",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Multiply the current matrix by a translation matrix Source   Edit  
proc unloadFramebuffer(id: uint32) {.importc: "rlUnloadFramebuffer",
                                     header: "rlgl.h", ...raises: [], tags: [],
                                     forbids: [].}
Delete framebuffer from GPU Source   Edit  
proc unloadRenderBatch(batch: RenderBatch) {.importc: "rlUnloadRenderBatch",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Unload render batch system Source   Edit  
proc unloadShaderBuffer(ssboId: uint32) {.importc: "rlUnloadShaderBuffer",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Unload shader storage buffer object (SSBO) Source   Edit  
proc unloadShaderProgram(id: uint32) {.importc: "rlUnloadShaderProgram",
                                       header: "rlgl.h", ...raises: [], tags: [],
                                       forbids: [].}
Unload shader program Source   Edit  
proc unloadTexture(id: uint32) {.importc: "rlUnloadTexture", header: "rlgl.h",
                                 ...raises: [], tags: [], forbids: [].}
Unload texture from GPU memory Source   Edit  
proc unloadVertexArray(vaoId: uint32) {.importc: "rlUnloadVertexArray",
                                        header: "rlgl.h", ...raises: [], tags: [],
                                        forbids: [].}
Unload vertex array (vao) Source   Edit  
proc unloadVertexBuffer(vboId: uint32) {.importc: "rlUnloadVertexBuffer",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Unload vertex buffer object Source   Edit  
proc updateShaderBuffer(id: uint32; data: pointer; dataSize: uint32;
                        offset: uint32) {.importc: "rlUpdateShaderBuffer",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Update SSBO buffer data Source   Edit  
proc updateTexture(id: uint32; offsetX: int32; offsetY: int32; width: int32;
                   height: int32; format: PixelFormat; data: pointer) {.
    importc: "rlUpdateTexture", header: "rlgl.h", ...raises: [], tags: [],
    forbids: [].}
Update texture with new data on GPU Source   Edit  
proc updateVertexBuffer(bufferId: uint32; data: pointer; dataSize: int32;
                        offset: int32) {.importc: "rlUpdateVertexBuffer",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Update vertex buffer object data on GPU buffer Source   Edit  
proc updateVertexBufferElements(id: uint32; data: pointer; dataSize: int32;
                                offset: int32) {.
    importc: "rlUpdateVertexBufferElements", header: "rlgl.h", ...raises: [],
    tags: [], forbids: [].}
Update vertex buffer elements data on GPU buffer Source   Edit  
proc vertex2f(x: float32; y: float32) {.importc: "rlVertex2f", header: "rlgl.h",
                                        ...raises: [], tags: [], forbids: [].}
Define one vertex (position) - 2 float Source   Edit  
proc vertex2i(x: int32; y: int32) {.importc: "rlVertex2i", header: "rlgl.h",
                                    ...raises: [], tags: [], forbids: [].}
Define one vertex (position) - 2 int Source   Edit  
proc vertex3f(x: float32; y: float32; z: float32) {.importc: "rlVertex3f",
    header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Define one vertex (position) - 3 float Source   Edit  
proc viewport(x: int32; y: int32; width: int32; height: int32) {.
    importc: "rlViewport", header: "rlgl.h", ...raises: [], tags: [], forbids: [].}
Set the viewport area Source   Edit  

Templates

template BlendEquationRgb(_: typedesc[BlendFuncOrEq]): untyped
Source   Edit  
template drawMode(mode: DrawMode; body: untyped)
Drawing mode (how to organize vertex) Source   Edit  
template draws(x: RenderBatch): RenderBatchDraws
Source   Edit