vendors.raylib

Bindings for raylib windowing, drawing, input, textures, fonts, 3D models, and audio.

14 structs · 69 functions · Public API

Structs

Vector2

struct
Vector2 : struct {

    x, y : f32 = 0.0

}

Vector3

struct
Vector3 : struct {

    x, y, z : f32 = 0.0
}

Vector4

struct
Vector4 : struct {

    x, y, z, w : f32 = 0.0
}

Matrix

struct
Matrix : struct {
    m0, m4, m8, m12  : f32 = 0.0
    m1, m5, m9, m13  : f32 = 0.0
    m2, m6, m10, m14 : f32 = 0.0
    m3, m7, m11, m15 : f32 = 0.0
}

Image

struct
Image : struct {

    data    : ^void = null
    width   : i32 = 0
    height  : i32 = 0
    mipmaps : i32 = 0
    format  : i32 = 0

}

Texture

struct
Texture : struct {

    id      : u32 = -1      // OpenGL texture id
    width   : i32 = 0       // Texture base width
    height  : i32 = 0       // Texture base height
    mipmaps : i32 = 0       // Mipmap levels, 1 by default
    format  : i32 = 0       // Data format (PixelFormat type)

}

Color

struct
Color : struct {

    R : u8 = 255
    G : u8 = 255
    B : u8 = 255
    A : u8 = 255

}

Rectangle

struct
Rectangle : struct {

    x       : f32        // Rectangle top-left corner position x
    y       : f32        // Rectangle top-left corner position y
    width   : f32        // Rectangle width
    height  : f32        // Rectangle height

}

RenderTexture

struct
RenderTexture : struct {

    id : u32             // OpenGL framebuffer object id
    texture : Texture    // Color buffer attachment texture
    depth : Texture      // Depth buffer attachment texture

}

GlyphInfo

struct
GlyphInfo : struct {
    value    : i32
    offsetX  : i32
    offsetY  : i32
    advanceX : i32
    image    : Image
}

Font

struct
Font : struct {

    baseSize      : i32
    glyphCount    : i32
    glyphPadding  : i32
    texture       : Texture2D
    rects         : ^Rectangle
    glyphs        : ^GlyphInfo
}

Camera3D

struct
Camera3D : struct {

    position    : Vector3
    target      : Vector3
    up          : Vector3
    fovy        : f32
    projection  : i32
}

Camera2D

struct
Camera2D : struct {

    offset    : Vector2
    target    : Vector2
    rotation  : f32
    zoom      : f32

}

NPatchInfo

struct
NPatchInfo : struct  {
    source : Rectangle  // Texture source rectangle
    left,               // Left border offset
    top,                // Top border offset
    right,              // Right border offset
    bottom,             // Bottom border offset
    layout : i64        // Layout type: NPatchLayout (3x3, 1x3, 3x1)
}

Functions

InitWindow

func
InitWindow : func(width : i32, height : i32, title : cstring) -> void
Windows Functions (Module: rcore)

BeginMode2D

func
BeginMode2D : func(camera : Camera2D)

BeginMode3D

func
BeginMode3D : func(camera : Camera3D)

DrawText

func
DrawText : func(text : cstring, posX : i32, posY : i32, fontSize : i32, color : Color)

DrawFPS

func
DrawFPS : func(posX : i32, posY : i32 )

DrawRectangle

func
DrawRectangle : func(posX : i32, posY : i32, width : i32, height : i32, color : Color)

IsKeyPressed

func
IsKeyPressed : func(key : Keys ) -> bool

IsKeyDown

func
IsKeyDown : func(key : Keys ) -> bool

IsKeyUp

func
IsKeyUp : func (key : Keys) -> bool

TraceLog

func
TraceLog : func(logLevel : TraceLevel, text : cstring)

GetTime

func
GetTime : func() -> f64

GetFPS

func
GetFPS : func() -> i32

SetMouseOffset

func
SetMouseOffset : func(offsetX : i32, offsetY : i32)

SetMouseScale

func
SetMouseScale : func(scaleX : float, scaleY : float)

LoadImage

func
LoadImage : func(filename : cstring) -> Image

UnloadImage

func
UnloadImage : func(image : Image ) -> void

LoadTexture

func
LoadTexture : func(filename : cstring) -> Texture2D

LoadImageFromMemory

func
LoadImageFromMemory : func(file_type : cstring, file_data : ^u8, data_size : i32 ) -> Image

DrawTexture

func
DrawTexture : func(texture : Texture2D, posX : i32, posY : i32, tint : Color)

DrawTextureV

func
DrawTextureV : func(texture : Texture2D, pos : Vector2, tint : Color)

DrawTextureRec

func
DrawTextureRec : func(texture : Texture2D, rect : Rectangle, position : Vector2, tint : Color)

DrawTextureEx

func
DrawTextureEx : func(texture : Texture2D, position : Vector2, rotation : float, scale : float, tint : Color)

DrawTexturePro

func
DrawTexturePro : func(texture : Texture2D, source : Rectangle, dest : Rectangle, origin : Vector2, rotation : float, tint : Color)

DrawTextureNPatch

func
DrawTextureNPatch : func(texture : Texture2D, patch_info : NPatchInfo, dest : Rectangle, origin : Vector2, rotation : float, tint : Color)