raylib

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

README

raylib

GoDoc GitHub release LLGo LLGo bindings XGo

LLGo bindings for raylib 6.0.0. The generated package exposes the public raylib.h API, camera helpers from rcamera.h, and raylib value types and constants. Functions that take a raylib struct as their first argument are available as methods where LLGo can represent that form.

Installation

Install LLGo, raylib, and pkg-config:

brew install raylib pkg-config

The binding links with pkg-config --libs raylib and therefore uses the raylib installation selected by your PKG_CONFIG_PATH.

Usage

package main

import (
	"github.com/goplus/lib/c"
	"github.com/llarhub/raylib"
)

func main() {
	raylib.InitWindow(800, 450, c.AllocaCStr("raylib + LLGo"))
	defer raylib.CloseWindow()
	for !raylib.WindowShouldClose() {
		raylib.BeginDrawing()
		raylib.RAYWHITE.ClearBackground()
		raylib.EndDrawing()
	}
}

The package also supports headless data operations such as raylib.GenImageColor; call the generated Image.Unload method when an image is no longer needed.

Verification

Run the standard Go check and the LLGo tests from the repository root:

go test ./...
llgo test ./...

The LLGo test exercises image generation, resource release, generated constants, and value type layout. The binding is generated from the raylib headers installed on the build machine, so keep the raylib API version aligned with the headers and library used at link time.

Documentation

Index

Constants

View Source
const (
	LIGHTGRAY = Color(200 | 200<<8 | 200<<16 | 255<<24) // Light Gray
	GRAY      = Color(130 | 130<<8 | 130<<16 | 255<<24) // Gray
	DARKGRAY  = Color(80 | 80<<8 | 80<<16 | 255<<24)    // Dark Gray
	YELLOW    = Color(253 | 249<<8 | 0<<16 | 255<<24)   // Yellow
	GOLD      = Color(255 | 203<<8 | 0<<16 | 255<<24)   // Gold
	ORANGE    = Color(255 | 161<<8 | 0<<16 | 255<<24)   // Orange
	PINK      = Color(255 | 109<<8 | 194<<16 | 255<<24) // Pink
	RED       = Color(230 | 41<<8 | 55<<16 | 255<<24)   // Red
	MAROON    = Color(190 | 33<<8 | 55<<16 | 255<<24)   // Maroon
	GREEN     = Color(0 | 228<<8 | 48<<16 | 255<<24)    // Green
	LIME      = Color(0 | 158<<8 | 47<<16 | 255<<24)    // Lime
	DARKGREEN = Color(0 | 117<<8 | 44<<16 | 255<<24)    // Dark Green
	SKYBLUE   = Color(102 | 191<<8 | 255<<16 | 255<<24) // Sky Blue
	BLUE      = Color(0 | 121<<8 | 241<<16 | 255<<24)   // Blue

	DARKBLUE   = Color(0 | 82<<8 | 172<<16 | 255<<24)    // Dark Blue
	PURPLE     = Color(200 | 122<<8 | 255<<16 | 255<<24) // Purple
	VIOLET     = Color(135 | 60<<8 | 190<<16 | 255<<24)  // Violet
	DARKPURPLE = Color(112 | 31<<8 | 126<<16 | 255<<24)  // Dark Purple
	BEIGE      = Color(211 | 176<<8 | 131<<16 | 255<<24) // Beige
	BROWN      = Color(127 | 106<<8 | 79<<16 | 255<<24)  // Brown
	DARKBROWN  = Color(76 | 63<<8 | 47<<16 | 255<<24)    // Dark Brown

	WHITE    = Color(255 | 255<<8 | 255<<16 | 255<<24) // White
	BLACK    = Color(0 | 0<<8 | 0<<16 | 255<<24)       // Black
	BLANK    = Color(0 | 0<<8 | 0<<16 | 0<<24)         // Blank (Transparent)
	MAGENTA  = Color(255 | 0<<8 | 255<<16 | 255<<24)   // Magenta
	RAYWHITE = Color(245 | 245<<8 | 245<<16 | 255<<24) // My own White (raylib logo)
)
View Source
const (
	VERSION_MAJOR = 6
	VERSION_MINOR = 0
	VERSION_PATCH = 0
	VERSION       = "6.0"
)
View Source
const (
	FLAG_VSYNC_HINT               = 64
	FLAG_FULLSCREEN_MODE          = 2
	FLAG_WINDOW_RESIZABLE         = 4
	FLAG_WINDOW_UNDECORATED       = 8
	FLAG_WINDOW_HIDDEN            = 128
	FLAG_WINDOW_MINIMIZED         = 512
	FLAG_WINDOW_MAXIMIZED         = 1024
	FLAG_WINDOW_UNFOCUSED         = 2048
	FLAG_WINDOW_TOPMOST           = 4096
	FLAG_WINDOW_ALWAYS_RUN        = 256
	FLAG_WINDOW_TRANSPARENT       = 16
	FLAG_WINDOW_HIGHDPI           = 8192
	FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384
	FLAG_BORDERLESS_WINDOWED_MODE = 32768
	FLAG_MSAA_4X_HINT             = 32
	// Set to try enabling interlaced video format (for V3D)
	FLAG_INTERLACED_HINT = 65536
)
View Source
const (
	LOG_ALL     = 0
	LOG_TRACE   = 1
	LOG_DEBUG   = 2
	LOG_INFO    = 3
	LOG_WARNING = 4
	LOG_ERROR   = 5
	LOG_FATAL   = 6
	// Disable logging
	LOG_NONE = 7
)
View Source
const (
	KEY_NULL = 0
	// Alphanumeric keys
	KEY_APOSTROPHE    = 39
	KEY_COMMA         = 44
	KEY_MINUS         = 45
	KEY_PERIOD        = 46
	KEY_SLASH         = 47
	KEY_ZERO          = 48
	KEY_ONE           = 49
	KEY_TWO           = 50
	KEY_THREE         = 51
	KEY_FOUR          = 52
	KEY_FIVE          = 53
	KEY_SIX           = 54
	KEY_SEVEN         = 55
	KEY_EIGHT         = 56
	KEY_NINE          = 57
	KEY_SEMICOLON     = 59
	KEY_EQUAL         = 61
	KEY_A             = 65
	KEY_B             = 66
	KEY_C             = 67
	KEY_D             = 68
	KEY_E             = 69
	KEY_F             = 70
	KEY_G             = 71
	KEY_H             = 72
	KEY_I             = 73
	KEY_J             = 74
	KEY_K             = 75
	KEY_L             = 76
	KEY_M             = 77
	KEY_N             = 78
	KEY_O             = 79
	KEY_P             = 80
	KEY_Q             = 81
	KEY_R             = 82
	KEY_S             = 83
	KEY_T             = 84
	KEY_U             = 85
	KEY_V             = 86
	KEY_W             = 87
	KEY_X             = 88
	KEY_Y             = 89
	KEY_Z             = 90
	KEY_LEFT_BRACKET  = 91
	KEY_BACKSLASH     = 92
	KEY_RIGHT_BRACKET = 93
	KEY_GRAVE         = 96
	// Function keys
	KEY_SPACE         = 32
	KEY_ESCAPE        = 256
	KEY_ENTER         = 257
	KEY_TAB           = 258
	KEY_BACKSPACE     = 259
	KEY_INSERT        = 260
	KEY_DELETE        = 261
	KEY_RIGHT         = 262
	KEY_LEFT          = 263
	KEY_DOWN          = 264
	KEY_UP            = 265
	KEY_PAGE_UP       = 266
	KEY_PAGE_DOWN     = 267
	KEY_HOME          = 268
	KEY_END           = 269
	KEY_CAPS_LOCK     = 280
	KEY_SCROLL_LOCK   = 281
	KEY_NUM_LOCK      = 282
	KEY_PRINT_SCREEN  = 283
	KEY_PAUSE         = 284
	KEY_F1            = 290
	KEY_F2            = 291
	KEY_F3            = 292
	KEY_F4            = 293
	KEY_F5            = 294
	KEY_F6            = 295
	KEY_F7            = 296
	KEY_F8            = 297
	KEY_F9            = 298
	KEY_F10           = 299
	KEY_F11           = 300
	KEY_F12           = 301
	KEY_LEFT_SHIFT    = 340
	KEY_LEFT_CONTROL  = 341
	KEY_LEFT_ALT      = 342
	KEY_LEFT_SUPER    = 343
	KEY_RIGHT_SHIFT   = 344
	KEY_RIGHT_CONTROL = 345
	KEY_RIGHT_ALT     = 346
	KEY_RIGHT_SUPER   = 347
	KEY_KB_MENU       = 348
	// Keypad keys
	KEY_KP_0        = 320
	KEY_KP_1        = 321
	KEY_KP_2        = 322
	KEY_KP_3        = 323
	KEY_KP_4        = 324
	KEY_KP_5        = 325
	KEY_KP_6        = 326
	KEY_KP_7        = 327
	KEY_KP_8        = 328
	KEY_KP_9        = 329
	KEY_KP_DECIMAL  = 330
	KEY_KP_DIVIDE   = 331
	KEY_KP_MULTIPLY = 332
	KEY_KP_SUBTRACT = 333
	KEY_KP_ADD      = 334
	KEY_KP_ENTER    = 335
	KEY_KP_EQUAL    = 336
	// Android key buttons
	KEY_BACK      = 4
	KEY_MENU      = 5
	KEY_VOLUME_UP = 24
	// Key: Android volume down button
	KEY_VOLUME_DOWN = 25
)
View Source
const (
	MOUSE_BUTTON_LEFT    = 0
	MOUSE_BUTTON_RIGHT   = 1
	MOUSE_BUTTON_MIDDLE  = 2
	MOUSE_BUTTON_SIDE    = 3
	MOUSE_BUTTON_EXTRA   = 4
	MOUSE_BUTTON_FORWARD = 5
	MOUSE_BUTTON_BACK    = 6
)
View Source
const (
	MOUSE_CURSOR_DEFAULT       = 0
	MOUSE_CURSOR_ARROW         = 1
	MOUSE_CURSOR_IBEAM         = 2
	MOUSE_CURSOR_CROSSHAIR     = 3
	MOUSE_CURSOR_POINTING_HAND = 4
	MOUSE_CURSOR_RESIZE_EW     = 5
	MOUSE_CURSOR_RESIZE_NS     = 6
	MOUSE_CURSOR_RESIZE_NWSE   = 7
	MOUSE_CURSOR_RESIZE_NESW   = 8
	MOUSE_CURSOR_RESIZE_ALL    = 9
	// The operation-not-allowed shape
	MOUSE_CURSOR_NOT_ALLOWED = 10
)
View Source
const (
	GAMEPAD_BUTTON_UNKNOWN          = 0
	GAMEPAD_BUTTON_LEFT_FACE_UP     = 1
	GAMEPAD_BUTTON_LEFT_FACE_RIGHT  = 2
	GAMEPAD_BUTTON_LEFT_FACE_DOWN   = 3
	GAMEPAD_BUTTON_LEFT_FACE_LEFT   = 4
	GAMEPAD_BUTTON_RIGHT_FACE_UP    = 5
	GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6
	GAMEPAD_BUTTON_RIGHT_FACE_DOWN  = 7
	GAMEPAD_BUTTON_RIGHT_FACE_LEFT  = 8
	GAMEPAD_BUTTON_LEFT_TRIGGER_1   = 9
	GAMEPAD_BUTTON_LEFT_TRIGGER_2   = 10
	GAMEPAD_BUTTON_RIGHT_TRIGGER_1  = 11
	GAMEPAD_BUTTON_RIGHT_TRIGGER_2  = 12
	GAMEPAD_BUTTON_MIDDLE_LEFT      = 13
	GAMEPAD_BUTTON_MIDDLE           = 14
	GAMEPAD_BUTTON_MIDDLE_RIGHT     = 15
	GAMEPAD_BUTTON_LEFT_THUMB       = 16
	// Gamepad joystick pressed button right
	GAMEPAD_BUTTON_RIGHT_THUMB = 17
)
View Source
const (
	GAMEPAD_AXIS_LEFT_X       = 0
	GAMEPAD_AXIS_LEFT_Y       = 1
	GAMEPAD_AXIS_RIGHT_X      = 2
	GAMEPAD_AXIS_RIGHT_Y      = 3
	GAMEPAD_AXIS_LEFT_TRIGGER = 4
	// Gamepad back trigger right, pressure level: [1..-1]
	GAMEPAD_AXIS_RIGHT_TRIGGER = 5
)
View Source
const (
	MATERIAL_MAP_ALBEDO     = 0
	MATERIAL_MAP_METALNESS  = 1
	MATERIAL_MAP_NORMAL     = 2
	MATERIAL_MAP_ROUGHNESS  = 3
	MATERIAL_MAP_OCCLUSION  = 4
	MATERIAL_MAP_EMISSION   = 5
	MATERIAL_MAP_HEIGHT     = 6
	MATERIAL_MAP_CUBEMAP    = 7
	MATERIAL_MAP_IRRADIANCE = 8
	MATERIAL_MAP_PREFILTER  = 9
	// Brdf material
	MATERIAL_MAP_BRDF = 10
)
View Source
const (
	SHADER_LOC_VERTEX_POSITION       = 0
	SHADER_LOC_VERTEX_TEXCOORD01     = 1
	SHADER_LOC_VERTEX_TEXCOORD02     = 2
	SHADER_LOC_VERTEX_NORMAL         = 3
	SHADER_LOC_VERTEX_TANGENT        = 4
	SHADER_LOC_VERTEX_COLOR          = 5
	SHADER_LOC_MATRIX_MVP            = 6
	SHADER_LOC_MATRIX_VIEW           = 7
	SHADER_LOC_MATRIX_PROJECTION     = 8
	SHADER_LOC_MATRIX_MODEL          = 9
	SHADER_LOC_MATRIX_NORMAL         = 10
	SHADER_LOC_VECTOR_VIEW           = 11
	SHADER_LOC_COLOR_DIFFUSE         = 12
	SHADER_LOC_COLOR_SPECULAR        = 13
	SHADER_LOC_COLOR_AMBIENT         = 14
	SHADER_LOC_MAP_ALBEDO            = 15
	SHADER_LOC_MAP_METALNESS         = 16
	SHADER_LOC_MAP_NORMAL            = 17
	SHADER_LOC_MAP_ROUGHNESS         = 18
	SHADER_LOC_MAP_OCCLUSION         = 19
	SHADER_LOC_MAP_EMISSION          = 20
	SHADER_LOC_MAP_HEIGHT            = 21
	SHADER_LOC_MAP_CUBEMAP           = 22
	SHADER_LOC_MAP_IRRADIANCE        = 23
	SHADER_LOC_MAP_PREFILTER         = 24
	SHADER_LOC_MAP_BRDF              = 25
	SHADER_LOC_VERTEX_BONEIDS        = 26
	SHADER_LOC_VERTEX_BONEWEIGHTS    = 27
	SHADER_LOC_MATRIX_BONETRANSFORMS = 28
	// Shader location: vertex attribute: instance transforms
	SHADER_LOC_VERTEX_INSTANCETRANSFORM = 29
)
View Source
const (
	SHADER_UNIFORM_FLOAT  = 0
	SHADER_UNIFORM_VEC2   = 1
	SHADER_UNIFORM_VEC3   = 2
	SHADER_UNIFORM_VEC4   = 3
	SHADER_UNIFORM_INT    = 4
	SHADER_UNIFORM_IVEC2  = 5
	SHADER_UNIFORM_IVEC3  = 6
	SHADER_UNIFORM_IVEC4  = 7
	SHADER_UNIFORM_UINT   = 8
	SHADER_UNIFORM_UIVEC2 = 9
	SHADER_UNIFORM_UIVEC3 = 10
	SHADER_UNIFORM_UIVEC4 = 11
	// Shader uniform type: sampler2d
	SHADER_UNIFORM_SAMPLER2D = 12
)
View Source
const (
	SHADER_ATTRIB_FLOAT = 0
	SHADER_ATTRIB_VEC2  = 1
	SHADER_ATTRIB_VEC3  = 2
	// Shader attribute type: vec4 (4 float)
	SHADER_ATTRIB_VEC4 = 3
)
View Source
const (
	PIXELFORMAT_UNCOMPRESSED_GRAYSCALE    = 1
	PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA   = 2
	PIXELFORMAT_UNCOMPRESSED_R5G6B5       = 3
	PIXELFORMAT_UNCOMPRESSED_R8G8B8       = 4
	PIXELFORMAT_UNCOMPRESSED_R5G5B5A1     = 5
	PIXELFORMAT_UNCOMPRESSED_R4G4B4A4     = 6
	PIXELFORMAT_UNCOMPRESSED_R8G8B8A8     = 7
	PIXELFORMAT_UNCOMPRESSED_R32          = 8
	PIXELFORMAT_UNCOMPRESSED_R32G32B32    = 9
	PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10
	PIXELFORMAT_UNCOMPRESSED_R16          = 11
	PIXELFORMAT_UNCOMPRESSED_R16G16B16    = 12
	PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13
	PIXELFORMAT_COMPRESSED_DXT1_RGB       = 14
	PIXELFORMAT_COMPRESSED_DXT1_RGBA      = 15
	PIXELFORMAT_COMPRESSED_DXT3_RGBA      = 16
	PIXELFORMAT_COMPRESSED_DXT5_RGBA      = 17
	PIXELFORMAT_COMPRESSED_ETC1_RGB       = 18
	PIXELFORMAT_COMPRESSED_ETC2_RGB       = 19
	PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA  = 20
	PIXELFORMAT_COMPRESSED_PVRT_RGB       = 21
	PIXELFORMAT_COMPRESSED_PVRT_RGBA      = 22
	PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA  = 23
	// 2 bpp
	PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24
)
View Source
const (
	TEXTURE_FILTER_POINT           = 0
	TEXTURE_FILTER_BILINEAR        = 1
	TEXTURE_FILTER_TRILINEAR       = 2
	TEXTURE_FILTER_ANISOTROPIC_4X  = 3
	TEXTURE_FILTER_ANISOTROPIC_8X  = 4
	TEXTURE_FILTER_ANISOTROPIC_16X = 5
)
View Source
const (
	TEXTURE_WRAP_REPEAT        = 0
	TEXTURE_WRAP_CLAMP         = 1
	TEXTURE_WRAP_MIRROR_REPEAT = 2
	// Mirrors and clamps to border the texture in tiled mode
	TEXTURE_WRAP_MIRROR_CLAMP = 3
)
View Source
const (
	CUBEMAP_LAYOUT_AUTO_DETECT         = 0
	CUBEMAP_LAYOUT_LINE_VERTICAL       = 1
	CUBEMAP_LAYOUT_LINE_HORIZONTAL     = 2
	CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3
	// Layout is defined by a 4x3 cross with cubemap faces
	CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4
)
View Source
const (
	FONT_DEFAULT = 0
	FONT_BITMAP  = 1
	// SDF font generation, requires external shader
	FONT_SDF = 2
)
View Source
const (
	BLEND_ALPHA             = 0
	BLEND_ADDITIVE          = 1
	BLEND_MULTIPLIED        = 2
	BLEND_ADD_COLORS        = 3
	BLEND_SUBTRACT_COLORS   = 4
	BLEND_ALPHA_PREMULTIPLY = 5
	BLEND_CUSTOM            = 6
	// Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())
	BLEND_CUSTOM_SEPARATE = 7
)
View Source
const (
	GESTURE_NONE        = 0
	GESTURE_TAP         = 1
	GESTURE_DOUBLETAP   = 2
	GESTURE_HOLD        = 4
	GESTURE_DRAG        = 8
	GESTURE_SWIPE_RIGHT = 16
	GESTURE_SWIPE_LEFT  = 32
	GESTURE_SWIPE_UP    = 64
	GESTURE_SWIPE_DOWN  = 128
	GESTURE_PINCH_IN    = 256
	// Pinch out gesture
	GESTURE_PINCH_OUT = 512
)
View Source
const (
	CAMERA_CUSTOM       = 0
	CAMERA_FREE         = 1
	CAMERA_ORBITAL      = 2
	CAMERA_FIRST_PERSON = 3
	// Camera third person
	CAMERA_THIRD_PERSON = 4
)
View Source
const (
	CAMERA_PERSPECTIVE = 0
	// Orthographic projection
	CAMERA_ORTHOGRAPHIC = 1
)
View Source
const (
	NPATCH_NINE_PATCH           = 0
	NPATCH_THREE_PATCH_VERTICAL = 1
	// Npatch layout: 3x1 tiles
	NPATCH_THREE_PATCH_HORIZONTAL = 2
)
View Source
const LLGoPackage = "link: $(pkg-config --libs raylib); -lraylib"

Variables

This section is empty.

Functions

func AttachAudioMixedProcessor

func AttachAudioMixedProcessor(processor AudioCallback)

Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo)

func BeginBlendMode

func BeginBlendMode(mode c.Int)

Begin blending mode (alpha, additive, multiplied, subtract, custom)

func BeginDrawing

func BeginDrawing()

Setup canvas (framebuffer) to start drawing

func BeginScissorMode

func BeginScissorMode(x c.Int, y c.Int, width c.Int, height c.Int)

Begin scissor mode (define screen area for following drawing)

func ChangeDirectory

func ChangeDirectory(dirPath *c.Char) bool

Change working directory, return true on success

func CheckCollisionBoxes

func CheckCollisionBoxes(box1 BoundingBox, box2 BoundingBox) bool

Check collision between two bounding boxes

func CheckCollisionRecs

func CheckCollisionRecs(rec1 Rectangle, rec2 Rectangle) bool

Basic shapes collision detection functions

func ClearBackground added in v0.3.0

func ClearBackground(color Color)

Drawing-related functions

func ClearWindowState

func ClearWindowState(flags c.Uint)

Clear window configuration state flags

func CloseAudioDevice

func CloseAudioDevice()

Close the audio device and context

func CloseWindow

func CloseWindow()

Close window and unload OpenGL context

func CodepointToUTF8

func CodepointToUTF8(codepoint c.Int, utf8Size *c.Int) *c.Char

Encode one codepoint into UTF-8 byte array (array length returned as parameter)

func ColorIsEqual

func ColorIsEqual(col1 Color, col2 Color) bool

Color/pixel related functions

func ColorToInt added in v0.3.0

func ColorToInt(color Color) c.Int

Get hexadecimal value for a Color (0xRRGGBBAA)

func CompressData

func CompressData(data *uint8, dataSize c.Int, compDataSize *c.Int) *uint8

Compression/Encoding functionality

func ComputeCRC32

func ComputeCRC32(data *uint8, dataSize c.Int) c.Uint

Compute CRC32 hash code

func ComputeMD5

func ComputeMD5(data *uint8, dataSize c.Int) *c.Uint

Compute MD5 hash code, returns static int[4] (16 bytes)

func ComputeSHA1

func ComputeSHA1(data *uint8, dataSize c.Int) *c.Uint

Compute SHA1 hash code, returns static int[5] (20 bytes)

func ComputeSHA256

func ComputeSHA256(data *uint8, dataSize c.Int) *c.Uint

Compute SHA256 hash code, returns static int[8] (32 bytes)

func DecodeDataBase64

func DecodeDataBase64(text *c.Char, outputSize *c.Int) *uint8

Decode Base64 string (expected NULL terminated), memory must be MemFree()

func DecompressData

func DecompressData(compData *uint8, compDataSize c.Int, dataSize *c.Int) *uint8

Decompress data (DEFLATE algorithm), memory must be MemFree()

func DetachAudioMixedProcessor

func DetachAudioMixedProcessor(processor AudioCallback)

Detach audio stream processor from the entire audio pipeline

func DirectoryExists

func DirectoryExists(dirPath *c.Char) bool

Check if a directory path exists

func DisableCursor

func DisableCursor()

Disables cursor (lock cursor)

func DisableEventWaiting

func DisableEventWaiting()

Disable waiting for events on EndDrawing(), automatic events polling

func DrawCircle

func DrawCircle(centerX c.Int, centerY c.Int, radius c.Float, color Color)

Draw a color-filled circle

func DrawCircleLines

func DrawCircleLines(centerX c.Int, centerY c.Int, radius c.Float, color Color)

Draw circle outline

func DrawEllipse

func DrawEllipse(centerX c.Int, centerY c.Int, radiusH c.Float, radiusV c.Float, color Color)

Draw ellipse

func DrawEllipseLines

func DrawEllipseLines(centerX c.Int, centerY c.Int, radiusH c.Float, radiusV c.Float, color Color)

Draw ellipse outline

func DrawFPS

func DrawFPS(posX c.Int, posY c.Int)

Text drawing functions

func DrawGrid

func DrawGrid(slices c.Int, spacing c.Float)

Draw a grid (centered at (0, 0, 0))

func DrawLine

func DrawLine(startPosX c.Int, startPosY c.Int, endPosX c.Int, endPosY c.Int, color Color)

Draw a line

func DrawPixel

func DrawPixel(posX c.Int, posY c.Int, color Color)

Basic shapes drawing functions

func DrawRectangle

func DrawRectangle(posX c.Int, posY c.Int, width c.Int, height c.Int, color Color)

Draw a color-filled rectangle

func DrawRectangleGradientH

func DrawRectangleGradientH(posX c.Int, posY c.Int, width c.Int, height c.Int, left Color, right Color)

Draw a horizontal-gradient-filled rectangle

func DrawRectangleGradientV

func DrawRectangleGradientV(posX c.Int, posY c.Int, width c.Int, height c.Int, top Color, bottom Color)

Draw a vertical-gradient-filled rectangle

func DrawRectangleLines

func DrawRectangleLines(posX c.Int, posY c.Int, width c.Int, height c.Int, color Color)

Draw rectangle outline

func DrawText

func DrawText(text *c.Char, posX c.Int, posY c.Int, fontSize c.Int, color Color)

Draw text (using default font)

func EnableCursor

func EnableCursor()

Enables cursor (unlock cursor)

func EnableEventWaiting

func EnableEventWaiting()

Enable waiting for events on EndDrawing(), no automatic event polling

func EncodeDataBase64

func EncodeDataBase64(data *uint8, dataSize c.Int, outputSize *c.Int) *c.Char

Encode data to Base64 string (includes NULL terminator), memory must be MemFree()

func EndBlendMode

func EndBlendMode()

End blending mode (reset to default: alpha blending)

func EndDrawing

func EndDrawing()

End canvas drawing and swap buffers (double buffering)

func EndMode2D

func EndMode2D()

Ends 2D mode with custom camera

func EndMode3D

func EndMode3D()

Ends 3D mode and returns to default 2D orthographic mode

func EndScissorMode

func EndScissorMode()

End scissor mode

func EndShaderMode

func EndShaderMode()

End custom shader drawing (use default shader)

func EndTextureMode

func EndTextureMode()

Ends drawing to render texture

func EndVrStereoMode

func EndVrStereoMode()

End stereo rendering (requires VR simulator)

func ExportDataAsCode

func ExportDataAsCode(data *uint8, dataSize c.Int, fileName *c.Char) bool

Export data to code (.h), returns true on success

func FileCopy

func FileCopy(srcPath *c.Char, dstPath *c.Char) c.Int

Copy file from one path to another, dstPath created if it doesn't exist

func FileExists

func FileExists(fileName *c.Char) bool

Check if file exists

func FileMove

func FileMove(srcPath *c.Char, dstPath *c.Char) c.Int

Move file from one directory to another, dstPath created if it doesn't exist

func FileRemove

func FileRemove(fileName *c.Char) c.Int

Remove file (if exists)

func FileRename

func FileRename(fileName *c.Char, fileRename *c.Char) c.Int

Rename file (if exists)

func FileTextFindIndex

func FileTextFindIndex(fileName *c.Char, search *c.Char) c.Int

Find text in existing file

func FileTextReplace

func FileTextReplace(fileName *c.Char, search *c.Char, replacement *c.Char) c.Int

Replace text in an existing file

func GetApplicationDirectory

func GetApplicationDirectory() *c.Char

Get the directory of the running application (uses static string)

func GetCharPressed

func GetCharPressed() c.Int

Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty

func GetClipboardText

func GetClipboardText() *c.Char

Get clipboard text content

func GetCodepoint

func GetCodepoint(text *c.Char, codepointSize *c.Int) c.Int

Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure

func GetCodepointCount

func GetCodepointCount(text *c.Char) c.Int

Get total number of codepoints in a UTF-8 encoded string

func GetCodepointNext

func GetCodepointNext(text *c.Char, codepointSize *c.Int) c.Int

Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure

func GetCodepointPrevious

func GetCodepointPrevious(text *c.Char, codepointSize *c.Int) c.Int

Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure

func GetCurrentMonitor

func GetCurrentMonitor() c.Int

Get current monitor where window is placed

func GetDirectoryFileCount

func GetDirectoryFileCount(dirPath *c.Char) c.Uint

Get the file count in a directory

func GetDirectoryFileCountEx

func GetDirectoryFileCountEx(basePath *c.Char, filter *c.Char, scanSubdirs bool) c.Uint

Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result

func GetDirectoryPath

func GetDirectoryPath(filePath *c.Char) *c.Char

Get full path for a given fileName with path (uses static string)

func GetFPS

func GetFPS() c.Int

Get current FPS

func GetFileExtension

func GetFileExtension(fileName *c.Char) *c.Char

Get pointer to extension for a filename string (includes dot: '.png')

func GetFileLength

func GetFileLength(fileName *c.Char) c.Int

Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)

func GetFileModTime

func GetFileModTime(fileName *c.Char) c.Long

Get file modification time (last write time)

func GetFileName

func GetFileName(filePath *c.Char) *c.Char

Get pointer to filename for a path string

func GetFileNameWithoutExt

func GetFileNameWithoutExt(filePath *c.Char) *c.Char

Get filename string without extension (uses static string)

func GetFrameTime

func GetFrameTime() c.Float

Get time in seconds for last frame drawn (delta time)

func GetGamepadAxisCount

func GetGamepadAxisCount(gamepad c.Int) c.Int

Get axis count for a gamepad

func GetGamepadAxisMovement

func GetGamepadAxisMovement(gamepad c.Int, axis c.Int) c.Float

Get movement value for a gamepad axis

func GetGamepadButtonPressed

func GetGamepadButtonPressed() c.Int

Get the last gamepad button pressed

func GetGamepadName

func GetGamepadName(gamepad c.Int) *c.Char

Get gamepad internal name id

func GetGestureDetected

func GetGestureDetected() c.Int

Get latest detected gesture

func GetGestureDragAngle

func GetGestureDragAngle() c.Float

Get gesture drag angle

func GetGestureHoldDuration

func GetGestureHoldDuration() c.Float

Get gesture hold time in seconds

func GetGesturePinchAngle

func GetGesturePinchAngle() c.Float

Get gesture pinch angle

func GetKeyName

func GetKeyName(key c.Int) *c.Char

Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)

func GetKeyPressed

func GetKeyPressed() c.Int

Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty

func GetMasterVolume

func GetMasterVolume() c.Float

Get master volume (listener)

func GetMonitorCount

func GetMonitorCount() c.Int

Get number of connected monitors

func GetMonitorHeight

func GetMonitorHeight(monitor c.Int) c.Int

Get specified monitor height (current video mode used by monitor)

func GetMonitorName

func GetMonitorName(monitor c.Int) *c.Char

Get the human-readable, UTF-8 encoded name of the specified monitor

func GetMonitorPhysicalHeight

func GetMonitorPhysicalHeight(monitor c.Int) c.Int

Get specified monitor physical height in millimetres

func GetMonitorPhysicalWidth

func GetMonitorPhysicalWidth(monitor c.Int) c.Int

Get specified monitor physical width in millimetres

func GetMonitorRefreshRate

func GetMonitorRefreshRate(monitor c.Int) c.Int

Get specified monitor refresh rate

func GetMonitorWidth

func GetMonitorWidth(monitor c.Int) c.Int

Get specified monitor width (current video mode used by monitor)

func GetMouseWheelMove

func GetMouseWheelMove() c.Float

Get mouse wheel movement for X or Y, whichever is larger

func GetMouseX

func GetMouseX() c.Int

Get mouse position X

func GetMouseY

func GetMouseY() c.Int

Get mouse position Y

func GetPixelDataSize

func GetPixelDataSize(width c.Int, height c.Int, format c.Int) c.Int

Get pixel data size in bytes for certain format

func GetPrevDirectoryPath

func GetPrevDirectoryPath(dirPath *c.Char) *c.Char

Get previous directory path for a given path (uses static string)

func GetRandomValue

func GetRandomValue(min c.Int, max c.Int) c.Int

Get a random value between min and max (both included)

func GetRenderHeight

func GetRenderHeight() c.Int

Get current render height (it considers HiDPI)

func GetRenderWidth

func GetRenderWidth() c.Int

Get current render width (it considers HiDPI)

func GetScreenHeight

func GetScreenHeight() c.Int

Get current screen height

func GetScreenWidth

func GetScreenWidth() c.Int

Get current screen width

func GetTextBetween

func GetTextBetween(text *c.Char, begin *c.Char, end *c.Char) *c.Char

Get text between two strings

func GetTime

func GetTime() c.Double

Get elapsed time in seconds since InitWindow()

func GetTouchPointCount

func GetTouchPointCount() c.Int

Get number of touch points

func GetTouchPointId

func GetTouchPointId(index c.Int) c.Int

Get touch point identifier for given index

func GetTouchX

func GetTouchX() c.Int

Input-related functions: touch

func GetTouchY

func GetTouchY() c.Int

Get touch position Y for touch point 0 (relative to screen size)

func GetWindowHandle

func GetWindowHandle() unsafe.Pointer

Get native window handle

func GetWorkingDirectory

func GetWorkingDirectory() *c.Char

Get current working directory (uses static string)

func HideCursor

func HideCursor()

Hides cursor

func InitAudioDevice

func InitAudioDevice()

Audio device management functions

func InitWindow

func InitWindow(width c.Int, height c.Int, title *c.Char)

Window-related functions

func IsAudioDeviceReady

func IsAudioDeviceReady() bool

Check if audio device has been initialized successfully

func IsCursorHidden

func IsCursorHidden() bool

Check if cursor is not visible

func IsCursorOnScreen

func IsCursorOnScreen() bool

Check if cursor is on the screen

func IsFileDropped

func IsFileDropped() bool

Check if a file has been dropped into window

func IsFileExtension

func IsFileExtension(fileName *c.Char, ext *c.Char) bool

Check file extension (recommended include point: .png, .wav)

func IsFileNameValid

func IsFileNameValid(fileName *c.Char) bool

Check if fileName is valid for the platform/OS

func IsGamepadAvailable

func IsGamepadAvailable(gamepad c.Int) bool

Input-related functions: gamepads

func IsGamepadButtonDown

func IsGamepadButtonDown(gamepad c.Int, button c.Int) bool

Check if a gamepad button is being pressed

func IsGamepadButtonPressed

func IsGamepadButtonPressed(gamepad c.Int, button c.Int) bool

Check if a gamepad button has been pressed once

func IsGamepadButtonReleased

func IsGamepadButtonReleased(gamepad c.Int, button c.Int) bool

Check if a gamepad button has been released once

func IsGamepadButtonUp

func IsGamepadButtonUp(gamepad c.Int, button c.Int) bool

Check if a gamepad button is NOT being pressed

func IsGestureDetected

func IsGestureDetected(gesture c.Uint) bool

Check if a gesture have been detected

func IsKeyDown

func IsKeyDown(key c.Int) bool

Check if a key is being pressed

func IsKeyPressed

func IsKeyPressed(key c.Int) bool

Input-related functions: keyboard

func IsKeyPressedRepeat

func IsKeyPressedRepeat(key c.Int) bool

Check if a key has been pressed again

func IsKeyReleased

func IsKeyReleased(key c.Int) bool

Check if a key has been released once

func IsKeyUp

func IsKeyUp(key c.Int) bool

Check if a key is NOT being pressed

func IsMouseButtonDown

func IsMouseButtonDown(button c.Int) bool

Check if a mouse button is being pressed

func IsMouseButtonPressed

func IsMouseButtonPressed(button c.Int) bool

Input-related functions: mouse

func IsMouseButtonReleased

func IsMouseButtonReleased(button c.Int) bool

Check if a mouse button has been released once

func IsMouseButtonUp

func IsMouseButtonUp(button c.Int) bool

Check if a mouse button is NOT being pressed

func IsPathFile

func IsPathFile(path *c.Char) bool

Check if a given path is a file or a directory

func IsWindowFocused

func IsWindowFocused() bool

Check if window is currently focused

func IsWindowFullscreen

func IsWindowFullscreen() bool

Check if window is currently fullscreen

func IsWindowHidden

func IsWindowHidden() bool

Check if window is currently hidden

func IsWindowMaximized

func IsWindowMaximized() bool

Check if window is currently maximized

func IsWindowMinimized

func IsWindowMinimized() bool

Check if window is currently minimized

func IsWindowReady

func IsWindowReady() bool

Check if window has been initialized successfully

func IsWindowResized

func IsWindowResized() bool

Check if window has been resized last frame

func IsWindowState

func IsWindowState(flag c.Uint) bool

Check if one specific window flag is enabled

func LoadCodepoints

func LoadCodepoints(text *c.Char, count *c.Int) *c.Int

Load all codepoints from a UTF-8 text string, codepoints count returned by parameter

func LoadFileData

func LoadFileData(fileName *c.Char, dataSize *c.Int) *uint8

File system management functions

func LoadFileText

func LoadFileText(fileName *c.Char) *c.Char

Load text data from file (read), returns a '\0' terminated string

func LoadRandomSequence

func LoadRandomSequence(count c.Uint, min c.Int, max c.Int) *c.Int

Load random values sequence, no values repeated

func LoadTextLines

func LoadTextLines(text *c.Char, count *c.Int) **c.Char

Text strings management functions (no UTF-8 strings, only byte chars) WARNING 1: Most of these functions use internal static buffers[], it's recommended to store returned data on user-side for re-use WARNING 2: Some functions allocate memory internally for the returned strings, those strings must be freed by user using MemFree()

func LoadUTF8

func LoadUTF8(codepoints *c.Int, length c.Int) *c.Char

Text codepoints management functions (unicode characters)

func MakeDirectory

func MakeDirectory(dirPath *c.Char) c.Int

Create directories (including full path requested), returns 0 on success

func MaximizeWindow

func MaximizeWindow()

Set window state: maximized, if resizable

func MeasureText

func MeasureText(text *c.Char, fontSize c.Int) c.Int

Measure string width for default font

func MemAlloc

func MemAlloc(size c.Uint) unsafe.Pointer

Memory management, using internal allocators

func MemFree

func MemFree(ptr unsafe.Pointer)

Internal memory free

func MemRealloc

func MemRealloc(ptr unsafe.Pointer, size c.Uint) unsafe.Pointer

Internal memory reallocator

func MinimizeWindow

func MinimizeWindow()

Set window state: minimized, if resizable

func OpenURL

func OpenURL(url *c.Char)

Open URL with default system browser (if available)

func PollInputEvents

func PollInputEvents()

Register all input events

func RestoreWindow

func RestoreWindow()

Restore window from being minimized/maximized

func SaveFileData

func SaveFileData(fileName *c.Char, data unsafe.Pointer, dataSize c.Int) bool

Save data to file from byte array (write), returns true on success

func SaveFileText

func SaveFileText(fileName *c.Char, text *c.Char) bool

Save text data to file (write), string must be '\0' terminated, returns true on success

func SetAudioStreamBufferSizeDefault

func SetAudioStreamBufferSizeDefault(size c.Int)

Default size for new audio streams

func SetAutomationEventBaseFrame

func SetAutomationEventBaseFrame(frame c.Int)

Set automation event internal base frame to start recording

func SetClipboardText

func SetClipboardText(text *c.Char)

Set clipboard text content

func SetConfigFlags

func SetConfigFlags(flags c.Uint)

Setup init configuration flags (view FLAGS)

func SetExitKey

func SetExitKey(key c.Int)

Set a custom key to exit program (default is ESC)

func SetGamepadMappings

func SetGamepadMappings(mappings *c.Char) c.Int

Set internal gamepad mappings (SDL_GameControllerDB)

func SetGamepadVibration

func SetGamepadVibration(gamepad c.Int, leftMotor c.Float, rightMotor c.Float, duration c.Float)

Set gamepad vibration for both motors (duration in seconds)

func SetGesturesEnabled

func SetGesturesEnabled(flags c.Uint)

------------------------------------------------------------------------------------ Gestures and Touch Handling Functions (Module: rgestures) ------------------------------------------------------------------------------------

func SetLoadFileDataCallback

func SetLoadFileDataCallback(callback LoadFileDataCallback)

File access custom callbacks WARNING: Callbacks setup is intended for advanced users

func SetLoadFileTextCallback

func SetLoadFileTextCallback(callback LoadFileTextCallback)

Set custom file text data loader

func SetMasterVolume

func SetMasterVolume(volume c.Float)

Set master volume (listener)

func SetMouseCursor

func SetMouseCursor(cursor c.Int)

Set mouse cursor

func SetMouseOffset

func SetMouseOffset(offsetX c.Int, offsetY c.Int)

Set mouse offset

func SetMousePosition

func SetMousePosition(x c.Int, y c.Int)

Set mouse position XY

func SetMouseScale

func SetMouseScale(scaleX c.Float, scaleY c.Float)

Set mouse scaling

func SetPixelColor

func SetPixelColor(dstPtr unsafe.Pointer, color Color, format c.Int)

Set color formatted into destination pixel pointer

func SetRandomSeed

func SetRandomSeed(seed c.Uint)

Random values generation functions

func SetSaveFileDataCallback

func SetSaveFileDataCallback(callback SaveFileDataCallback)

Set custom file binary data saver

func SetSaveFileTextCallback

func SetSaveFileTextCallback(callback SaveFileTextCallback)

Set custom file text data saver

func SetTargetFPS

func SetTargetFPS(fps c.Int)

Timing-related functions

func SetTextLineSpacing

func SetTextLineSpacing(spacing c.Int)

Text font info functions

func SetTraceLogCallback

func SetTraceLogCallback(callback TraceLogCallback)

Set custom trace log

func SetTraceLogLevel

func SetTraceLogLevel(logLevel c.Int)

Logging system

func SetWindowFocused

func SetWindowFocused()

Set window focused

func SetWindowMaxSize

func SetWindowMaxSize(width c.Int, height c.Int)

Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)

func SetWindowMinSize

func SetWindowMinSize(width c.Int, height c.Int)

Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)

func SetWindowMonitor

func SetWindowMonitor(monitor c.Int)

Set monitor for the current window

func SetWindowOpacity

func SetWindowOpacity(opacity c.Float)

Set window opacity [0.0f..1.0f]

func SetWindowPosition

func SetWindowPosition(x c.Int, y c.Int)

Set window position on screen

func SetWindowSize

func SetWindowSize(width c.Int, height c.Int)

Set window dimensions

func SetWindowState

func SetWindowState(flags c.Uint)

Set window configuration state using flags

func SetWindowTitle

func SetWindowTitle(title *c.Char)

Set title for window

func ShowCursor

func ShowCursor()

Cursor-related functions

func StartAutomationEventRecording

func StartAutomationEventRecording()

Start recording automation events (AutomationEventList must be set)

func StopAutomationEventRecording

func StopAutomationEventRecording()

Stop recording automation events

func SwapScreenBuffer

func SwapScreenBuffer()

Custom frame control functions NOTE: Those functions are intended for advanced users that want full control over the frame processing By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents() To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL

func TakeScreenshot

func TakeScreenshot(fileName *c.Char)

Misc. functions

func TextAppend

func TextAppend(text *c.Char, append *c.Char, position *c.Int)

Append text at specific position and move cursor

func TextCopy

func TextCopy(dst *c.Char, src *c.Char) c.Int

Copy one string to another, returns bytes copied

func TextFindIndex

func TextFindIndex(text *c.Char, search *c.Char) c.Int

Find first text occurrence within a string, -1 if not found

func TextFormat

func TextFormat(text *c.Char, __llgo_va_list ...any) *c.Char

Text formatting with variables (sprintf() style)

func TextInsert

func TextInsert(text *c.Char, insert *c.Char, position c.Int) *c.Char

Insert text in a defined byte position

func TextInsertAlloc

func TextInsertAlloc(text *c.Char, insert *c.Char, position c.Int) *c.Char

Insert text in a defined byte position, memory must be MemFree()

func TextIsEqual

func TextIsEqual(text1 *c.Char, text2 *c.Char) bool

Check if two text string are equal

func TextJoin

func TextJoin(textList **c.Char, count c.Int, delimiter *c.Char) *c.Char

Join text strings with delimiter

func TextLength

func TextLength(text *c.Char) c.Uint

Get text length, checks for '\0' ending

func TextRemoveSpaces

func TextRemoveSpaces(text *c.Char) *c.Char

Remove text spaces, concat words

func TextReplace

func TextReplace(text *c.Char, search *c.Char, replacement *c.Char) *c.Char

Replace text string with new string

func TextReplaceAlloc

func TextReplaceAlloc(text *c.Char, search *c.Char, replacement *c.Char) *c.Char

Replace text string with new string, memory must be MemFree()

func TextReplaceBetween

func TextReplaceBetween(text *c.Char, begin *c.Char, end *c.Char, replacement *c.Char) *c.Char

Replace text between two specific strings

func TextReplaceBetweenAlloc

func TextReplaceBetweenAlloc(text *c.Char, begin *c.Char, end *c.Char, replacement *c.Char) *c.Char

Replace text between two specific strings, memory must be MemFree()

func TextSplit

func TextSplit(text *c.Char, delimiter c.Char, count *c.Int) **c.Char

Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings

func TextSubtext

func TextSubtext(text *c.Char, position c.Int, length c.Int) *c.Char

Get a piece of a text string

func TextToCamel

func TextToCamel(text *c.Char) *c.Char

Get Camel case notation version of provided string

func TextToFloat

func TextToFloat(text *c.Char) c.Float

Get float value from text

func TextToInteger

func TextToInteger(text *c.Char) c.Int

Get integer value from text

func TextToLower

func TextToLower(text *c.Char) *c.Char

Get lower case version of provided string

func TextToPascal

func TextToPascal(text *c.Char) *c.Char

Get Pascal case notation version of provided string

func TextToSnake

func TextToSnake(text *c.Char) *c.Char

Get Snake case notation version of provided string

func TextToUpper

func TextToUpper(text *c.Char) *c.Char

Get upper case version of provided string

func ToggleBorderlessWindowed

func ToggleBorderlessWindowed()

Toggle window state: borderless windowed, resizes window to match monitor resolution

func ToggleFullscreen

func ToggleFullscreen()

Toggle window state: fullscreen/windowed, resizes monitor to match window resolution

func TraceLog

func TraceLog(logLevel c.Int, text *c.Char, __llgo_va_list ...any)

Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)

func UnloadCodepoints

func UnloadCodepoints(codepoints *c.Int)

Unload codepoints data from memory

func UnloadFileData

func UnloadFileData(data *uint8)

Unload file data allocated by LoadFileData()

func UnloadFileText

func UnloadFileText(text *c.Char)

Unload file text data allocated by LoadFileText()

func UnloadImageColors added in v0.3.0

func UnloadImageColors(colors *Color)

Unload color data loaded with LoadImageColors()

func UnloadImagePalette added in v0.3.0

func UnloadImagePalette(colors *Color)

Unload colors palette loaded with LoadImagePalette()

func UnloadRandomSequence

func UnloadRandomSequence(sequence *c.Int)

Unload random values sequence

func UnloadTextLines

func UnloadTextLines(text **c.Char, lineCount c.Int)

Unload text lines

func UnloadUTF8

func UnloadUTF8(text *c.Char)

Unload UTF-8 text encoded from codepoints array

func UnloadWaveSamples

func UnloadWaveSamples(samples *c.Float)

Unload samples data loaded with LoadWaveSamples()

func WaitTime

func WaitTime(seconds c.Double)

Wait for some time (halt program execution)

func WindowShouldClose

func WindowShouldClose() bool

Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)

Types

type AudioCallback

type AudioCallback = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 c.Uint)

------------------------------------------------------------------------------------ Audio Loading and Playing Functions (Module: audio) ------------------------------------------------------------------------------------

type AudioStream

type AudioStream struct {
	Buffer     *RAudioBuffer
	Processor  *RAudioProcessor
	SampleRate c.Uint
	SampleSize c.Uint
	Channels   c.Uint
}

AudioStream, custom audio stream

func LoadAudioStream

func LoadAudioStream(sampleRate c.Uint, sampleSize c.Uint, channels c.Uint) AudioStream

AudioStream management functions

func (AudioStream) AttachAudioStreamProcessor

func (self AudioStream) AttachAudioStreamProcessor(processor AudioCallback)

Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo)

llgo:link AudioStream.AttachAudioStreamProcessor C.AttachAudioStreamProcessor

func (AudioStream) DetachAudioStreamProcessor

func (self AudioStream) DetachAudioStreamProcessor(processor AudioCallback)

Detach audio stream processor from stream

llgo:link AudioStream.DetachAudioStreamProcessor C.DetachAudioStreamProcessor

func (AudioStream) IsAudioStreamPlaying

func (self AudioStream) IsAudioStreamPlaying() bool

Check if audio stream is playing

llgo:link AudioStream.IsAudioStreamPlaying C.IsAudioStreamPlaying

func (AudioStream) IsAudioStreamProcessed

func (self AudioStream) IsAudioStreamProcessed() bool

Check if any audio stream buffers requires refill

llgo:link AudioStream.IsAudioStreamProcessed C.IsAudioStreamProcessed

func (AudioStream) IsAudioStreamValid

func (self AudioStream) IsAudioStreamValid() bool

Checks if an audio stream is valid (buffers initialized)

llgo:link AudioStream.IsAudioStreamValid C.IsAudioStreamValid

func (AudioStream) Pause

func (self AudioStream) Pause()

Pause audio stream

llgo:link AudioStream.Pause C.PauseAudioStream

func (AudioStream) Play

func (self AudioStream) Play()

Play audio stream

llgo:link AudioStream.Play C.PlayAudioStream

func (AudioStream) Resume

func (self AudioStream) Resume()

Resume audio stream

llgo:link AudioStream.Resume C.ResumeAudioStream

func (AudioStream) SetAudioStreamCallback

func (self AudioStream) SetAudioStreamCallback(callback AudioCallback)

Audio thread callback to request new data

llgo:link AudioStream.SetAudioStreamCallback C.SetAudioStreamCallback

func (AudioStream) SetAudioStreamPan

func (self AudioStream) SetAudioStreamPan(pan c.Float)

Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)

llgo:link AudioStream.SetAudioStreamPan C.SetAudioStreamPan

func (AudioStream) SetAudioStreamPitch

func (self AudioStream) SetAudioStreamPitch(pitch c.Float)

Set pitch for audio stream (1.0 is base level)

llgo:link AudioStream.SetAudioStreamPitch C.SetAudioStreamPitch

func (AudioStream) SetAudioStreamVolume

func (self AudioStream) SetAudioStreamVolume(volume c.Float)

Set volume for audio stream (1.0 is max level)

llgo:link AudioStream.SetAudioStreamVolume C.SetAudioStreamVolume

func (AudioStream) Stop

func (self AudioStream) Stop()

Stop audio stream

llgo:link AudioStream.Stop C.StopAudioStream

func (AudioStream) Unload

func (self AudioStream) Unload()

Unload audio stream and free memory

llgo:link AudioStream.Unload C.UnloadAudioStream

func (AudioStream) Update

func (self AudioStream) Update(data unsafe.Pointer, frameCount c.Int)

Update audio stream buffers with data

llgo:link AudioStream.Update C.UpdateAudioStream

type AutomationEvent

type AutomationEvent struct {
	Frame  c.Uint
	Type   c.Uint
	Params [4]c.Int
}

Automation event

func (AutomationEvent) Play

func (self AutomationEvent) Play()

Play a recorded automation event

llgo:link AutomationEvent.Play C.PlayAutomationEvent

type AutomationEventList

type AutomationEventList struct {
	Capacity c.Uint
	Count    c.Uint
	Events   *AutomationEvent
}

Automation event list

func LoadAutomationEventList

func LoadAutomationEventList(fileName *c.Char) AutomationEventList

Automation events functionality

func (AutomationEventList) Export

func (self AutomationEventList) Export(fileName *c.Char) bool

Export automation events list as text file

llgo:link AutomationEventList.Export C.ExportAutomationEventList

func (*AutomationEventList) Set

func (self *AutomationEventList) Set()

Set automation event list to record to

llgo:link (*AutomationEventList).Set C.SetAutomationEventList

func (AutomationEventList) Unload

func (self AutomationEventList) Unload()

Unload automation events list from file

llgo:link AutomationEventList.Unload C.UnloadAutomationEventList

type BlendMode

type BlendMode c.Uint

Color blending modes (pre-defined)

type BoneInfo

type BoneInfo struct {
	Name   [32]c.Char
	Parent c.Int
}

Bone, skeletal animation bone

type BoundingBox

type BoundingBox struct {
	Min Vector3
	Max Vector3
}

BoundingBox

func (BoundingBox) CheckCollisionBoxSphere

func (self BoundingBox) CheckCollisionBoxSphere(center Vector3, radius c.Float) bool

Check collision between box and sphere

llgo:link BoundingBox.CheckCollisionBoxSphere C.CheckCollisionBoxSphere

func (BoundingBox) Draw

func (self BoundingBox) Draw(color Color)

Draw bounding box (wires)

llgo:link BoundingBox.Draw C.DrawBoundingBox

type Camera

type Camera = Camera3D

Camera type fallback, defaults to Camera3D

func (Camera) DrawBillboard

func (self Camera) DrawBillboard(texture Texture2D, position Vector3, scale c.Float, tint Color)

Draw a billboard texture

llgo:link Camera.DrawBillboard C.DrawBillboard

func (Camera) DrawBillboardPro

func (self Camera) DrawBillboardPro(texture Texture2D, source Rectangle, position Vector3, up Vector3, size Vector2, origin Vector2, rotation c.Float, tint Color)

Draw a billboard texture defined by source and rotation

llgo:link Camera.DrawBillboardPro C.DrawBillboardPro

func (Camera) DrawBillboardRec

func (self Camera) DrawBillboardRec(texture Texture2D, source Rectangle, position Vector3, size Vector2, tint Color)

Draw a billboard texture defined by source

llgo:link Camera.DrawBillboardRec C.DrawBillboardRec

func (*Camera) Forward

func (self *Camera) Forward() Vector3

llgo:link (*Camera).Forward C.GetCameraForward

func (*Camera) GetCameraUp

func (self *Camera) GetCameraUp() Vector3

llgo:link (*Camera).GetCameraUp C.GetCameraUp

func (Camera) Matrix

func (self Camera) Matrix() Matrix

Get camera transform matrix (view matrix)

llgo:link Camera.Matrix C.GetCameraMatrix

func (*Camera) MoveForward

func (self *Camera) MoveForward(distance c.Float, moveInWorldPlane bool)

Camera movement

llgo:link (*Camera).MoveForward C.CameraMoveForward

func (*Camera) MoveRight

func (self *Camera) MoveRight(distance c.Float, moveInWorldPlane bool)

llgo:link (*Camera).MoveRight C.CameraMoveRight

func (*Camera) MoveToTarget

func (self *Camera) MoveToTarget(delta c.Float)

llgo:link (*Camera).MoveToTarget C.CameraMoveToTarget

func (*Camera) MoveUp

func (self *Camera) MoveUp(distance c.Float)

llgo:link (*Camera).MoveUp C.CameraMoveUp

func (*Camera) Pitch

func (self *Camera) Pitch(angle c.Float, lockView bool, rotateAroundTarget bool, rotateUp bool)

llgo:link (*Camera).Pitch C.CameraPitch

func (*Camera) ProjectionMatrix

func (self *Camera) ProjectionMatrix(aspect c.Float) Matrix

llgo:link (*Camera).ProjectionMatrix C.GetCameraProjectionMatrix

func (*Camera) Right

func (self *Camera) Right() Vector3

llgo:link (*Camera).Right C.GetCameraRight

func (*Camera) Roll

func (self *Camera) Roll(angle c.Float)

llgo:link (*Camera).Roll C.CameraRoll

func (*Camera) Update

func (self *Camera) Update(mode c.Int)

------------------------------------------------------------------------------------ Camera System Functions (Module: rcamera) ------------------------------------------------------------------------------------

llgo:link (*Camera).Update C.UpdateCamera

func (*Camera) UpdateCameraPro

func (self *Camera) UpdateCameraPro(movement Vector3, rotation Vector3, zoom c.Float)

Update camera movement/rotation

llgo:link (*Camera).UpdateCameraPro C.UpdateCameraPro

func (*Camera) ViewMatrix

func (self *Camera) ViewMatrix() Matrix

llgo:link (*Camera).ViewMatrix C.GetCameraViewMatrix

func (*Camera) Yaw

func (self *Camera) Yaw(angle c.Float, rotateAroundTarget bool)

Camera rotation

llgo:link (*Camera).Yaw C.CameraYaw

type Camera2D

type Camera2D struct {
	Offset   Vector2
	Target   Vector2
	Rotation c.Float
	Zoom     c.Float
}

Camera2D, defines position/orientation in 2d space

func (Camera2D) BeginMode2D

func (self Camera2D) BeginMode2D()

Begin 2D mode with custom camera (2D)

llgo:link Camera2D.BeginMode2D C.BeginMode2D

func (Camera2D) CameraMatrix2D

func (self Camera2D) CameraMatrix2D() Matrix

Get camera 2d transform matrix

llgo:link Camera2D.CameraMatrix2D C.GetCameraMatrix2D

type Camera3D

type Camera3D struct {
	Position   Vector3
	Target     Vector3
	Up         Vector3
	Fovy       c.Float
	Projection c.Int
}

Camera, defines position/orientation in 3d space

func (Camera3D) BeginMode3D

func (self Camera3D) BeginMode3D()

Begin 3D mode with custom camera (3D)

llgo:link Camera3D.BeginMode3D C.BeginMode3D

type CameraMode

type CameraMode c.Uint

Camera system modes

type CameraProjection

type CameraProjection c.Uint

Camera projection

type Color

type Color uint32

Color, 4 components, R8G8B8A8 (32bit) R, G, B, A uint8

func ColorAlpha added in v0.3.0

func ColorAlpha(color Color, alpha c.Float) Color

Get color with alpha applied, alpha goes from 0.0f to 1.0f

func ColorAlphaBlend added in v0.3.0

func ColorAlphaBlend(dst Color, src Color, tint Color) Color

Get src alpha-blended into dst color with tint

func ColorBrightness added in v0.3.0

func ColorBrightness(color Color, factor c.Float) Color

Get color with brightness correction, brightness factor goes from -1.0f to 1.0f

func ColorContrast added in v0.3.0

func ColorContrast(color Color, contrast c.Float) Color

Get color with contrast correction, contrast values between -1.0f and 1.0f

func ColorFromHSV

func ColorFromHSV(hue c.Float, saturation c.Float, value c.Float) Color

Get a Color from HSV values, hue [0..360], saturation/value [0..1]

func ColorLerp added in v0.3.0

func ColorLerp(color1 Color, color2 Color, factor c.Float) Color

Get color lerp interpolation between two colors, factor [0.0f..1.0f]

func ColorTint

func ColorTint(color Color, tint Color) Color

Get color multiplied with another color

func Fade added in v0.3.0

func Fade(color Color, alpha c.Float) Color

Get color with alpha applied, alpha goes from 0.0f to 1.0f

func GetColor

func GetColor(hexValue c.Uint) Color

Get Color structure from hexadecimal value

func GetPixelColor

func GetPixelColor(srcPtr unsafe.Pointer, format c.Int) Color

Get Color from a source pixel pointer of certain format

type ConfigFlags

type ConfigFlags c.Uint

---------------------------------------------------------------------------------- Enumerators Definition ---------------------------------------------------------------------------------- System/Window config flags NOTE: Every bit registers one state (use it with bit masks) By default all flags are set to 0

type CubemapLayout

type CubemapLayout c.Uint

Cubemap layouts

type FilePathList

type FilePathList struct {
	Count c.Uint
	Paths **c.Char
}

File path list

func LoadDirectoryFiles

func LoadDirectoryFiles(dirPath *c.Char) FilePathList

Load directory filepaths, files and directories, no subdirs scan

func LoadDirectoryFilesEx

func LoadDirectoryFilesEx(basePath *c.Char, filter *c.Char, scanSubdirs bool) FilePathList

Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"

func LoadDroppedFiles

func LoadDroppedFiles() FilePathList

Load dropped filepaths

func (FilePathList) UnloadDirectoryFiles

func (self FilePathList) UnloadDirectoryFiles()

Unload filepaths

llgo:link FilePathList.UnloadDirectoryFiles C.UnloadDirectoryFiles

func (FilePathList) UnloadDroppedFiles

func (self FilePathList) UnloadDroppedFiles()

Unload dropped filepaths

llgo:link FilePathList.UnloadDroppedFiles C.UnloadDroppedFiles

type Float3

type Float3 struct {
	V [3]c.Float
}

type Float16

type Float16 struct {
	V [16]c.Float
}

type Font

type Font struct {
	BaseSize     c.Int
	GlyphCount   c.Int
	GlyphPadding c.Int
	Texture      Texture2D
	Recs         *Rectangle
	Glyphs       *GlyphInfo
}

Font, font texture and GlyphInfo array data

func GetFontDefault

func GetFontDefault() Font

Font loading/unloading functions

func LoadFont

func LoadFont(fileName *c.Char) Font

Load font from file into GPU memory (VRAM)

func LoadFontEx

func LoadFontEx(fileName *c.Char, fontSize c.Int, codepoints *c.Int, codepointCount c.Int) Font

Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height

func LoadFontFromMemory

func LoadFontFromMemory(fileType *c.Char, fileData *uint8, dataSize c.Int, fontSize c.Int, codepoints *c.Int, codepointCount c.Int) Font

Load font from memory buffer, fileType refers to extension: i.e. '.ttf'

func (Font) DrawTextCodepoint

func (self Font) DrawTextCodepoint(codepoint c.Int, position Vector2, fontSize c.Float, tint Color)

Draw one character (codepoint)

llgo:link Font.DrawTextCodepoint C.DrawTextCodepoint

func (Font) DrawTextCodepoints

func (self Font) DrawTextCodepoints(codepoints *c.Int, codepointCount c.Int, position Vector2, fontSize c.Float, spacing c.Float, tint Color)

Draw multiple character (codepoint)

llgo:link Font.DrawTextCodepoints C.DrawTextCodepoints

func (Font) DrawTextEx

func (self Font) DrawTextEx(text *c.Char, position Vector2, fontSize c.Float, spacing c.Float, tint Color)

Draw text using font and additional parameters

llgo:link Font.DrawTextEx C.DrawTextEx

func (Font) DrawTextPro

func (self Font) DrawTextPro(text *c.Char, position Vector2, origin Vector2, rotation c.Float, fontSize c.Float, spacing c.Float, tint Color)

Draw text using Font and pro parameters (rotation)

llgo:link Font.DrawTextPro C.DrawTextPro

func (Font) ExportFontAsCode

func (self Font) ExportFontAsCode(fileName *c.Char) bool

Export font as code file, returns true on success

llgo:link Font.ExportFontAsCode C.ExportFontAsCode

func (Font) GlyphAtlasRec

func (self Font) GlyphAtlasRec(codepoint c.Int) Rectangle

Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found

llgo:link Font.GlyphAtlasRec C.GetGlyphAtlasRec

func (Font) GlyphIndex

func (self Font) GlyphIndex(codepoint c.Int) c.Int

Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found

llgo:link Font.GlyphIndex C.GetGlyphIndex

func (Font) GlyphInfo

func (self Font) GlyphInfo(codepoint c.Int) GlyphInfo

Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found

llgo:link Font.GlyphInfo C.GetGlyphInfo

func (Font) ImageTextEx

func (self Font) ImageTextEx(text *c.Char, fontSize c.Float, spacing c.Float, tint Color) Image

Create an image from text (custom sprite font)

llgo:link Font.ImageTextEx C.ImageTextEx

func (Font) IsFontValid

func (self Font) IsFontValid() bool

Check if a font is valid (font data loaded, WARNING: GPU texture not checked)

llgo:link Font.IsFontValid C.IsFontValid

func (Font) MeasureTextCodepoints

func (self Font) MeasureTextCodepoints(codepoints *c.Int, length c.Int, fontSize c.Float, spacing c.Float) Vector2

Measure string size for an existing array of codepoints for Font

llgo:link Font.MeasureTextCodepoints C.MeasureTextCodepoints

func (Font) MeasureTextEx

func (self Font) MeasureTextEx(text *c.Char, fontSize c.Float, spacing c.Float) Vector2

Measure string size for Font

llgo:link Font.MeasureTextEx C.MeasureTextEx

func (Font) Unload

func (self Font) Unload()

Unload font from GPU memory (VRAM)

llgo:link Font.Unload C.UnloadFont

type FontType

type FontType c.Uint

Font type, defines generation method

type GamepadAxis

type GamepadAxis c.Uint

Gamepad axes

type GamepadButton

type GamepadButton c.Uint

Gamepad buttons

type Gesture

type Gesture c.Uint

Gesture NOTE: Provided as bit-wise flags to enable only desired gestures

type GlyphInfo

type GlyphInfo struct {
	Value    c.Int
	OffsetX  c.Int
	OffsetY  c.Int
	AdvanceX c.Int
	Image    Image
}

GlyphInfo, font characters glyphs info

func LoadFontData

func LoadFontData(fileData *uint8, dataSize c.Int, fontSize c.Int, codepoints *c.Int, codepointCount c.Int, type_ c.Int, glyphCount *c.Int) *GlyphInfo

Load font data for further use

func (*GlyphInfo) GenImageFontAtlas

func (self *GlyphInfo) GenImageFontAtlas(glyphRecs **Rectangle, glyphCount c.Int, fontSize c.Int, padding c.Int, packMethod c.Int) Image

Generate image font atlas using chars info

llgo:link (*GlyphInfo).GenImageFontAtlas C.GenImageFontAtlas

func (*GlyphInfo) UnloadFontData

func (self *GlyphInfo) UnloadFontData(glyphCount c.Int)

Unload font chars info data (RAM)

llgo:link (*GlyphInfo).UnloadFontData C.UnloadFontData

type Image

type Image struct {
	Data    unsafe.Pointer
	Width   c.Int
	Height  c.Int
	Mipmaps c.Int
	Format  c.Int
}

Image, pixel data stored in CPU memory (RAM)

func GenImageCellular

func GenImageCellular(width c.Int, height c.Int, tileSize c.Int) Image

Generate image: cellular algorithm, bigger tileSize means bigger cells

func GenImageChecked

func GenImageChecked(width c.Int, height c.Int, checksX c.Int, checksY c.Int, col1 Color, col2 Color) Image

Generate image: checked

func GenImageColor

func GenImageColor(width c.Int, height c.Int, color Color) Image

Image generation functions

func GenImageGradientLinear

func GenImageGradientLinear(width c.Int, height c.Int, direction c.Int, start Color, end Color) Image

Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient

func GenImageGradientRadial

func GenImageGradientRadial(width c.Int, height c.Int, density c.Float, inner Color, outer Color) Image

Generate image: radial gradient

func GenImageGradientSquare

func GenImageGradientSquare(width c.Int, height c.Int, density c.Float, inner Color, outer Color) Image

Generate image: square gradient

func GenImagePerlinNoise

func GenImagePerlinNoise(width c.Int, height c.Int, offsetX c.Int, offsetY c.Int, scale c.Float) Image

Generate image: perlin noise

func GenImageText

func GenImageText(width c.Int, height c.Int, text *c.Char) Image

Generate image: grayscale image from text data

func GenImageWhiteNoise

func GenImageWhiteNoise(width c.Int, height c.Int, factor c.Float) Image

Generate image: white noise

func GetClipboardImage

func GetClipboardImage() Image

Get clipboard image content

func ImageText

func ImageText(text *c.Char, fontSize c.Int, color Color) Image

Create an image from text (default font)

func LoadImage

func LoadImage(fileName *c.Char) Image

Image loading functions NOTE: These functions do not require GPU access

func LoadImageAnim

func LoadImageAnim(fileName *c.Char, frames *c.Int) Image

Load image sequence from file (frames appended to image.data)

func LoadImageAnimFromMemory

func LoadImageAnimFromMemory(fileType *c.Char, fileData *uint8, dataSize c.Int, frames *c.Int) Image

Load image sequence from memory buffer

func LoadImageFromMemory

func LoadImageFromMemory(fileType *c.Char, fileData *uint8, dataSize c.Int) Image

Load image from memory buffer, fileType refers to extension: i.e. '.png'

func LoadImageFromScreen

func LoadImageFromScreen() Image

Load image from screen buffer and (screenshot)

func LoadImageRaw

func LoadImageRaw(fileName *c.Char, width c.Int, height c.Int, format c.Int, headerSize c.Int) Image

Load image from RAW file data

func (Image) AlphaBorder

func (self Image) AlphaBorder(threshold c.Float) Rectangle

Get image alpha border rectangle

llgo:link Image.AlphaBorder C.GetImageAlphaBorder

func (*Image) AlphaClear

func (self *Image) AlphaClear(color Color, threshold c.Float)

Clear alpha channel to desired color

llgo:link (*Image).AlphaClear C.ImageAlphaClear

func (*Image) AlphaCrop

func (self *Image) AlphaCrop(threshold c.Float)

Crop image depending on alpha value

llgo:link (*Image).AlphaCrop C.ImageAlphaCrop

func (*Image) AlphaMask

func (self *Image) AlphaMask(alphaMask Image)

Apply alpha mask to image

llgo:link (*Image).AlphaMask C.ImageAlphaMask

func (*Image) AlphaPremultiply

func (self *Image) AlphaPremultiply()

Premultiply alpha channel

llgo:link (*Image).AlphaPremultiply C.ImageAlphaPremultiply

func (*Image) BlurGaussian

func (self *Image) BlurGaussian(blurSize c.Int)

Apply Gaussian blur using a box blur approximation

llgo:link (*Image).BlurGaussian C.ImageBlurGaussian

func (*Image) ClearBackground

func (self *Image) ClearBackground(color Color)

Image drawing functions NOTE: Image software-rendering functions (CPU)

llgo:link (*Image).ClearBackground C.ImageClearBackground

func (Image) Color

func (self Image) Color(x c.Int, y c.Int) Color

Get image pixel color at (x, y) position

llgo:link Image.Color C.GetImageColor

func (*Image) ColorBrightness

func (self *Image) ColorBrightness(brightness c.Int)

Modify image color: brightness (-255 to 255)

llgo:link (*Image).ColorBrightness C.ImageColorBrightness

func (*Image) ColorContrast

func (self *Image) ColorContrast(contrast c.Float)

Modify image color: contrast (-100 to 100)

llgo:link (*Image).ColorContrast C.ImageColorContrast

func (*Image) ColorGrayscale

func (self *Image) ColorGrayscale()

Modify image color: grayscale

llgo:link (*Image).ColorGrayscale C.ImageColorGrayscale

func (*Image) ColorInvert

func (self *Image) ColorInvert()

Modify image color: invert

llgo:link (*Image).ColorInvert C.ImageColorInvert

func (*Image) ColorReplace

func (self *Image) ColorReplace(color Color, replace Color)

Modify image color: replace color

llgo:link (*Image).ColorReplace C.ImageColorReplace

func (*Image) ColorTint

func (self *Image) ColorTint(color Color)

Modify image color: tint

llgo:link (*Image).ColorTint C.ImageColorTint

func (Image) Copy

func (self Image) Copy() Image

Image manipulation functions

llgo:link Image.Copy C.ImageCopy

func (*Image) Crop

func (self *Image) Crop(crop Rectangle)

Crop an image to a defined rectangle

llgo:link (*Image).Crop C.ImageCrop

func (*Image) Dither

func (self *Image) Dither(rBpp c.Int, gBpp c.Int, bBpp c.Int, aBpp c.Int)

Dither image data to 16bpp or lower (Floyd-Steinberg dithering)

llgo:link (*Image).Dither C.ImageDither

func (*Image) Draw

func (self *Image) Draw(src Image, srcRec Rectangle, dstRec Rectangle, tint Color)

Draw a source image within a destination image (tint applied to source)

llgo:link (*Image).Draw C.ImageDraw

func (*Image) DrawCircle

func (self *Image) DrawCircle(centerX c.Int, centerY c.Int, radius c.Int, color Color)

Draw a filled circle within an image

llgo:link (*Image).DrawCircle C.ImageDrawCircle

func (*Image) DrawCircleLines

func (self *Image) DrawCircleLines(centerX c.Int, centerY c.Int, radius c.Int, color Color)

Draw circle outline within an image

llgo:link (*Image).DrawCircleLines C.ImageDrawCircleLines

func (*Image) DrawCircleLinesV

func (self *Image) DrawCircleLinesV(center Vector2, radius c.Int, color Color)

Draw circle outline within an image (Vector version)

llgo:link (*Image).DrawCircleLinesV C.ImageDrawCircleLinesV

func (*Image) DrawCircleV

func (self *Image) DrawCircleV(center Vector2, radius c.Int, color Color)

Draw a filled circle within an image (Vector version)

llgo:link (*Image).DrawCircleV C.ImageDrawCircleV

func (*Image) DrawLine

func (self *Image) DrawLine(startPosX c.Int, startPosY c.Int, endPosX c.Int, endPosY c.Int, color Color)

Draw line within an image

llgo:link (*Image).DrawLine C.ImageDrawLine

func (*Image) DrawLineEx

func (self *Image) DrawLineEx(start Vector2, end Vector2, thick c.Int, color Color)

Draw a line defining thickness within an image

llgo:link (*Image).DrawLineEx C.ImageDrawLineEx

func (*Image) DrawLineV

func (self *Image) DrawLineV(start Vector2, end Vector2, color Color)

Draw line within an image (Vector version)

llgo:link (*Image).DrawLineV C.ImageDrawLineV

func (*Image) DrawPixel

func (self *Image) DrawPixel(posX c.Int, posY c.Int, color Color)

Draw pixel within an image

llgo:link (*Image).DrawPixel C.ImageDrawPixel

func (*Image) DrawPixelV

func (self *Image) DrawPixelV(position Vector2, color Color)

Draw pixel within an image (Vector version)

llgo:link (*Image).DrawPixelV C.ImageDrawPixelV

func (*Image) DrawRectangle

func (self *Image) DrawRectangle(posX c.Int, posY c.Int, width c.Int, height c.Int, color Color)

Draw rectangle within an image

llgo:link (*Image).DrawRectangle C.ImageDrawRectangle

func (*Image) DrawRectangleLines

func (self *Image) DrawRectangleLines(rec Rectangle, thick c.Int, color Color)

Draw rectangle lines within an image

llgo:link (*Image).DrawRectangleLines C.ImageDrawRectangleLines

func (*Image) DrawRectangleRec

func (self *Image) DrawRectangleRec(rec Rectangle, color Color)

Draw rectangle within an image

llgo:link (*Image).DrawRectangleRec C.ImageDrawRectangleRec

func (*Image) DrawRectangleV

func (self *Image) DrawRectangleV(position Vector2, size Vector2, color Color)

Draw rectangle within an image (Vector version)

llgo:link (*Image).DrawRectangleV C.ImageDrawRectangleV

func (*Image) DrawText

func (self *Image) DrawText(text *c.Char, posX c.Int, posY c.Int, fontSize c.Int, color Color)

Draw text (using default font) within an image (destination)

llgo:link (*Image).DrawText C.ImageDrawText

func (*Image) DrawTextEx

func (self *Image) DrawTextEx(font Font, text *c.Char, position Vector2, fontSize c.Float, spacing c.Float, tint Color)

Draw text (custom sprite font) within an image (destination)

llgo:link (*Image).DrawTextEx C.ImageDrawTextEx

func (*Image) DrawTriangle

func (self *Image) DrawTriangle(v1 Vector2, v2 Vector2, v3 Vector2, color Color)

Draw triangle within an image

llgo:link (*Image).DrawTriangle C.ImageDrawTriangle

func (*Image) DrawTriangleEx

func (self *Image) DrawTriangleEx(v1 Vector2, v2 Vector2, v3 Vector2, c1 Color, c2 Color, c3 Color)

Draw triangle with interpolated colors within an image

llgo:link (*Image).DrawTriangleEx C.ImageDrawTriangleEx

func (*Image) DrawTriangleFan

func (self *Image) DrawTriangleFan(points *Vector2, pointCount c.Int, color Color)

Draw a triangle fan defined by points within an image (first vertex is the center)

llgo:link (*Image).DrawTriangleFan C.ImageDrawTriangleFan

func (*Image) DrawTriangleLines

func (self *Image) DrawTriangleLines(v1 Vector2, v2 Vector2, v3 Vector2, color Color)

Draw triangle outline within an image

llgo:link (*Image).DrawTriangleLines C.ImageDrawTriangleLines

func (*Image) DrawTriangleStrip

func (self *Image) DrawTriangleStrip(points *Vector2, pointCount c.Int, color Color)

Draw a triangle strip defined by points within an image

llgo:link (*Image).DrawTriangleStrip C.ImageDrawTriangleStrip

func (Image) Export

func (self Image) Export(fileName *c.Char) bool

Export image data to file, returns true on success

llgo:link Image.Export C.ExportImage

func (Image) ExportImageAsCode

func (self Image) ExportImageAsCode(fileName *c.Char) bool

Export image as code file defining an array of bytes, returns true on success

llgo:link Image.ExportImageAsCode C.ExportImageAsCode

func (Image) ExportImageToMemory

func (self Image) ExportImageToMemory(fileType *c.Char, fileSize *c.Int) *uint8

Export image to memory buffer, memory must be MemFree()

llgo:link Image.ExportImageToMemory C.ExportImageToMemory

func (*Image) FlipHorizontal

func (self *Image) FlipHorizontal()

Flip image horizontally

llgo:link (*Image).FlipHorizontal C.ImageFlipHorizontal

func (*Image) FlipVertical

func (self *Image) FlipVertical()

Flip image vertically

llgo:link (*Image).FlipVertical C.ImageFlipVertical

func (Image) From

func (self Image) From(rec Rectangle) Image

Create an image from another image piece

llgo:link Image.From C.ImageFromImage

func (Image) FromChannel

func (self Image) FromChannel(selectedChannel c.Int) Image

Create an image from a selected channel of another image (GRAYSCALE)

llgo:link Image.FromChannel C.ImageFromChannel

func (Image) GenMeshCubicmap

func (self Image) GenMeshCubicmap(cubeSize Vector3) Mesh

Generate cubes-based map mesh from image data

llgo:link Image.GenMeshCubicmap C.GenMeshCubicmap

func (Image) GenMeshHeightmap

func (self Image) GenMeshHeightmap(size Vector3) Mesh

Generate heightmap mesh from image data

llgo:link Image.GenMeshHeightmap C.GenMeshHeightmap

func (*Image) ImageFormat

func (self *Image) ImageFormat(newFormat c.Int)

Convert image data to desired format

llgo:link (*Image).ImageFormat C.ImageFormat

func (*Image) ImageMipmaps

func (self *Image) ImageMipmaps()

Compute all mipmap levels for a provided image

llgo:link (*Image).ImageMipmaps C.ImageMipmaps

func (Image) IsImageValid

func (self Image) IsImageValid() bool

Check if an image is valid (data and parameters)

llgo:link Image.IsImageValid C.IsImageValid

func (*Image) KernelConvolution

func (self *Image) KernelConvolution(kernel *c.Float, kernelSize c.Int)

Apply custom square convolution kernel to image

llgo:link (*Image).KernelConvolution C.ImageKernelConvolution

func (Image) LoadFontFrom

func (self Image) LoadFontFrom(key Color, firstChar c.Int) Font

Load font from Image (XNA style)

llgo:link Image.LoadFontFrom C.LoadFontFromImage

func (Image) LoadImageColors

func (self Image) LoadImageColors() *Color

Load color data from image as a Color array (RGBA - 32bit)

llgo:link Image.LoadImageColors C.LoadImageColors

func (Image) LoadImagePalette

func (self Image) LoadImagePalette(maxPaletteSize c.Int, colorCount *c.Int) *Color

Load colors palette from image as a Color array (RGBA - 32bit)

llgo:link Image.LoadImagePalette C.LoadImagePalette

func (Image) LoadTextureCubemap

func (self Image) LoadTextureCubemap(layout c.Int) TextureCubemap

Load cubemap from image, multiple image cubemap layouts supported

llgo:link Image.LoadTextureCubemap C.LoadTextureCubemap

func (Image) LoadTextureFrom

func (self Image) LoadTextureFrom() Texture2D

Load texture from image data

llgo:link Image.LoadTextureFrom C.LoadTextureFromImage

func (*Image) Resize

func (self *Image) Resize(newWidth c.Int, newHeight c.Int)

Resize image (Bicubic scaling algorithm)

llgo:link (*Image).Resize C.ImageResize

func (*Image) ResizeCanvas

func (self *Image) ResizeCanvas(newWidth c.Int, newHeight c.Int, offsetX c.Int, offsetY c.Int, fill Color)

Resize canvas and fill with color

llgo:link (*Image).ResizeCanvas C.ImageResizeCanvas

func (*Image) ResizeNN

func (self *Image) ResizeNN(newWidth c.Int, newHeight c.Int)

Resize image (Nearest-Neighbor scaling algorithm)

llgo:link (*Image).ResizeNN C.ImageResizeNN

func (*Image) Rotate

func (self *Image) Rotate(degrees c.Int)

Rotate image by input angle in degrees (-359 to 359)

llgo:link (*Image).Rotate C.ImageRotate

func (*Image) RotateCCW

func (self *Image) RotateCCW()

Rotate image counter-clockwise 90deg

llgo:link (*Image).RotateCCW C.ImageRotateCCW

func (*Image) RotateCW

func (self *Image) RotateCW()

Rotate image clockwise 90deg

llgo:link (*Image).RotateCW C.ImageRotateCW

func (Image) SetWindowIcon

func (self Image) SetWindowIcon()

Set icon for window (single image, RGBA 32bit)

llgo:link Image.SetWindowIcon C.SetWindowIcon

func (*Image) SetWindowIcons

func (self *Image) SetWindowIcons(count c.Int)

Set icon for window (multiple images, RGBA 32bit)

llgo:link (*Image).SetWindowIcons C.SetWindowIcons

func (*Image) ToPOT

func (self *Image) ToPOT(fill Color)

Convert image to POT (power-of-two)

llgo:link (*Image).ToPOT C.ImageToPOT

func (Image) Unload

func (self Image) Unload()

Unload image from CPU memory (RAM)

llgo:link Image.Unload C.UnloadImage

type KeyboardKey

type KeyboardKey c.Uint

Keyboard keys (US keyboard layout) NOTE: Use GetKeyPressed() to allow redefining required keys for alternative layouts

type LoadFileDataCallback

type LoadFileDataCallback = func(_llcppg_param1 *c.Char, _llcppg_param2 *c.Int) *uint8

FileIO: Load binary data

type LoadFileTextCallback

type LoadFileTextCallback = func(_llcppg_param1 *c.Char) *c.Char

FileIO: Load text data

type Material

type Material struct {
	Shader Shader
	Maps   *MaterialMap
	Params [4]c.Float
}

Material, includes shader and maps

func LoadMaterialDefault

func LoadMaterialDefault() Material

Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)

func LoadMaterials

func LoadMaterials(fileName *c.Char, materialCount *c.Int) *Material

Material loading/unloading functions

func (Material) IsMaterialValid

func (self Material) IsMaterialValid() bool

Check if a material is valid (shader assigned, map textures loaded in GPU)

llgo:link Material.IsMaterialValid C.IsMaterialValid

func (*Material) SetMaterialTexture

func (self *Material) SetMaterialTexture(mapType c.Int, texture Texture2D)

Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)

llgo:link (*Material).SetMaterialTexture C.SetMaterialTexture

func (Material) Unload

func (self Material) Unload()

Unload material from GPU memory (VRAM)

llgo:link Material.Unload C.UnloadMaterial

type MaterialMap

type MaterialMap struct {
	Texture Texture2D
	Color   Color
	Value   c.Float
}

MaterialMap

type MaterialMapIndex

type MaterialMapIndex c.Uint

Material map index

type Matrix

type Matrix struct {
	M0  c.Float
	M4  c.Float
	M8  c.Float
	M12 c.Float
	M1  c.Float
	M5  c.Float
	M9  c.Float
	M13 c.Float
	M2  c.Float
	M6  c.Float
	M10 c.Float
	M14 c.Float
	M3  c.Float
	M7  c.Float
	M11 c.Float
	M15 c.Float
}

Matrix, 4x4 components, column major, OpenGL style, right-handed

type Mesh

type Mesh struct {
	VertexCount   c.Int
	TriangleCount c.Int
	Vertices      *c.Float
	Texcoords     *c.Float
	Texcoords2    *c.Float
	Normals       *c.Float
	Tangents      *c.Float
	Colors        *uint8
	Indices       *uint16
	BoneCount     c.Int
	BoneIndices   *uint8
	BoneWeights   *c.Float
	AnimVertices  *c.Float
	AnimNormals   *c.Float
	VaoId         c.Uint
	VboId         *c.Uint
}

Mesh, vertex data and vao/vbo

func GenMeshCone

func GenMeshCone(radius c.Float, height c.Float, slices c.Int) Mesh

Generate cone/pyramid mesh

func GenMeshCube

func GenMeshCube(width c.Float, height c.Float, length c.Float) Mesh

Generate cuboid mesh

func GenMeshCylinder

func GenMeshCylinder(radius c.Float, height c.Float, slices c.Int) Mesh

Generate cylinder mesh

func GenMeshHemiSphere

func GenMeshHemiSphere(radius c.Float, rings c.Int, slices c.Int) Mesh

Generate half-sphere mesh (no bottom cap)

func GenMeshKnot

func GenMeshKnot(radius c.Float, size c.Float, radSeg c.Int, sides c.Int) Mesh

Generate trefoil knot mesh

func GenMeshPlane

func GenMeshPlane(width c.Float, length c.Float, resX c.Int, resZ c.Int) Mesh

Generate plane mesh (with subdivisions)

func GenMeshPoly

func GenMeshPoly(sides c.Int, radius c.Float) Mesh

Mesh generation functions

func GenMeshSphere

func GenMeshSphere(radius c.Float, rings c.Int, slices c.Int) Mesh

Generate sphere mesh (standard sphere)

func GenMeshTorus

func GenMeshTorus(radius c.Float, size c.Float, radSeg c.Int, sides c.Int) Mesh

Generate torus mesh

func (Mesh) BoundingBox

func (self Mesh) BoundingBox() BoundingBox

Compute mesh bounding box limits

llgo:link Mesh.BoundingBox C.GetMeshBoundingBox

func (Mesh) Draw

func (self Mesh) Draw(material Material, transform Matrix)

Draw a 3d mesh with material and transform

llgo:link Mesh.Draw C.DrawMesh

func (Mesh) DrawMeshInstanced

func (self Mesh) DrawMeshInstanced(material Material, transforms *Matrix, instances c.Int)

Draw multiple mesh instances with material and different transforms

llgo:link Mesh.DrawMeshInstanced C.DrawMeshInstanced

func (Mesh) Export

func (self Mesh) Export(fileName *c.Char) bool

Export mesh data to file, returns true on success

llgo:link Mesh.Export C.ExportMesh

func (Mesh) ExportMeshAsCode

func (self Mesh) ExportMeshAsCode(fileName *c.Char) bool

Export mesh as code file (.h) defining multiple arrays of vertex attributes

llgo:link Mesh.ExportMeshAsCode C.ExportMeshAsCode

func (*Mesh) GenMeshTangents

func (self *Mesh) GenMeshTangents()

Compute mesh tangents

llgo:link (*Mesh).GenMeshTangents C.GenMeshTangents

func (Mesh) LoadModelFrom

func (self Mesh) LoadModelFrom() Model

Load model from generated mesh (default material)

llgo:link Mesh.LoadModelFrom C.LoadModelFromMesh

func (Mesh) Unload

func (self Mesh) Unload()

Unload mesh data from CPU and GPU

llgo:link Mesh.Unload C.UnloadMesh

func (Mesh) UpdateMeshBuffer

func (self Mesh) UpdateMeshBuffer(index c.Int, data unsafe.Pointer, dataSize c.Int, offset c.Int)

Update mesh vertex data in GPU for a specific buffer index

llgo:link Mesh.UpdateMeshBuffer C.UpdateMeshBuffer

func (*Mesh) Upload

func (self *Mesh) Upload(dynamic bool)

Mesh management functions

llgo:link (*Mesh).Upload C.UploadMesh

type Model

type Model struct {
	Transform     Matrix
	MeshCount     c.Int
	MaterialCount c.Int
	Meshes        *Mesh
	Materials     *Material
	MeshMaterial  *c.Int
	Skeleton      ModelSkeleton
	CurrentPose   ModelAnimPose
	BoneMatrices  *Matrix
}

Model, meshes, materials and animation data

func LoadModel

func LoadModel(fileName *c.Char) Model

Model management functions

func (Model) BoundingBox

func (self Model) BoundingBox() BoundingBox

Compute model bounding box limits (considers all meshes)

llgo:link Model.BoundingBox C.GetModelBoundingBox

func (Model) Draw

func (self Model) Draw(position Vector3, scale c.Float, tint Color)

Model drawing functions

llgo:link Model.Draw C.DrawModel

func (Model) DrawModelEx

func (self Model) DrawModelEx(position Vector3, rotationAxis Vector3, rotationAngle c.Float, scale Vector3, tint Color)

Draw a model with extended parameters

llgo:link Model.DrawModelEx C.DrawModelEx

func (Model) DrawModelWires

func (self Model) DrawModelWires(position Vector3, scale c.Float, tint Color)

Draw a model wires (with texture if set)

llgo:link Model.DrawModelWires C.DrawModelWires

func (Model) DrawModelWiresEx

func (self Model) DrawModelWiresEx(position Vector3, rotationAxis Vector3, rotationAngle c.Float, scale Vector3, tint Color)

Draw a model wires (with texture if set) with extended parameters

llgo:link Model.DrawModelWiresEx C.DrawModelWiresEx

func (Model) IsModelAnimationValid

func (self Model) IsModelAnimationValid(anim ModelAnimation) bool

Check model animation skeleton match

llgo:link Model.IsModelAnimationValid C.IsModelAnimationValid

func (Model) IsModelValid

func (self Model) IsModelValid() bool

Check if a model is valid (loaded in GPU, VAO/VBOs)

llgo:link Model.IsModelValid C.IsModelValid

func (*Model) SetModelMeshMaterial

func (self *Model) SetModelMeshMaterial(meshId c.Int, materialId c.Int)

Set material for a mesh

llgo:link (*Model).SetModelMeshMaterial C.SetModelMeshMaterial

func (Model) Unload

func (self Model) Unload()

Unload model (including meshes) from memory (RAM and/or VRAM)

llgo:link Model.Unload C.UnloadModel

func (Model) UpdateModelAnimation

func (self Model) UpdateModelAnimation(anim ModelAnimation, frame c.Float)

Update model animation pose (vertex buffers and bone matrices)

llgo:link Model.UpdateModelAnimation C.UpdateModelAnimation

func (Model) UpdateModelAnimationEx

func (self Model) UpdateModelAnimationEx(animA ModelAnimation, frameA c.Float, animB ModelAnimation, frameB c.Float, blend c.Float)

Update model animation pose, blending two animations

llgo:link Model.UpdateModelAnimationEx C.UpdateModelAnimationEx

type ModelAnimPose

type ModelAnimPose = *Transform

Anim pose, an array of Transform[]

type ModelAnimation

type ModelAnimation struct {
	Name          [32]c.Char
	BoneCount     c.Int
	KeyframeCount c.Int
	KeyframePoses *ModelAnimPose
}

ModelAnimation, contains a full animation sequence

func LoadModelAnimations

func LoadModelAnimations(fileName *c.Char, animCount *c.Int) *ModelAnimation

Model animations loading/unloading functions

func (*ModelAnimation) UnloadModelAnimations

func (self *ModelAnimation) UnloadModelAnimations(animCount c.Int)

Unload animation array data

llgo:link (*ModelAnimation).UnloadModelAnimations C.UnloadModelAnimations

type ModelSkeleton

type ModelSkeleton struct {
	BoneCount c.Int
	Bones     *BoneInfo
	BindPose  ModelAnimPose
}

Skeleton, animation bones hierarchy

type MouseButton

type MouseButton c.Uint

Mouse buttons

type MouseCursor

type MouseCursor c.Uint

Mouse cursor

type Music

type Music struct {
	Stream     AudioStream
	FrameCount c.Uint
	Looping    bool
	CtxType    c.Int
	CtxData    unsafe.Pointer
}

Music, audio stream, anything longer than ~10 seconds should be streamed

func LoadMusicStream

func LoadMusicStream(fileName *c.Char) Music

Music management functions

func LoadMusicStreamFromMemory

func LoadMusicStreamFromMemory(fileType *c.Char, data *uint8, dataSize c.Int) Music

Load music stream from data

func (Music) IsMusicStreamPlaying

func (self Music) IsMusicStreamPlaying() bool

Check if music is playing

llgo:link Music.IsMusicStreamPlaying C.IsMusicStreamPlaying

func (Music) IsMusicValid

func (self Music) IsMusicValid() bool

Checks if a music stream is valid (context and buffers initialized)

llgo:link Music.IsMusicValid C.IsMusicValid

func (Music) PauseMusicStream

func (self Music) PauseMusicStream()

Pause music playing

llgo:link Music.PauseMusicStream C.PauseMusicStream

func (Music) PlayMusicStream

func (self Music) PlayMusicStream()

Start music playing

llgo:link Music.PlayMusicStream C.PlayMusicStream

func (Music) ResumeMusicStream

func (self Music) ResumeMusicStream()

Resume playing paused music

llgo:link Music.ResumeMusicStream C.ResumeMusicStream

func (Music) SeekMusicStream

func (self Music) SeekMusicStream(position c.Float)

Seek music to a position (in seconds)

llgo:link Music.SeekMusicStream C.SeekMusicStream

func (Music) SetMusicPan

func (self Music) SetMusicPan(pan c.Float)

Set pan for a music (-1.0 left, 0.0 center, 1.0 right)

llgo:link Music.SetMusicPan C.SetMusicPan

func (Music) SetMusicPitch

func (self Music) SetMusicPitch(pitch c.Float)

Set pitch for a music (1.0 is base level)

llgo:link Music.SetMusicPitch C.SetMusicPitch

func (Music) SetMusicVolume

func (self Music) SetMusicVolume(volume c.Float)

Set volume for music (1.0 is max level)

llgo:link Music.SetMusicVolume C.SetMusicVolume

func (Music) StopMusicStream

func (self Music) StopMusicStream()

Stop music playing

llgo:link Music.StopMusicStream C.StopMusicStream

func (Music) TimeLength

func (self Music) TimeLength() c.Float

Get music time length (in seconds)

llgo:link Music.TimeLength C.GetMusicTimeLength

func (Music) TimePlayed

func (self Music) TimePlayed() c.Float

Get current music time played (in seconds)

llgo:link Music.TimePlayed C.GetMusicTimePlayed

func (Music) UnloadMusicStream

func (self Music) UnloadMusicStream()

Unload music stream

llgo:link Music.UnloadMusicStream C.UnloadMusicStream

func (Music) UpdateMusicStream

func (self Music) UpdateMusicStream()

Updates buffers for music streaming

llgo:link Music.UpdateMusicStream C.UpdateMusicStream

type NPatchInfo

type NPatchInfo struct {
	Source Rectangle
	Left   c.Int
	Top    c.Int
	Right  c.Int
	Bottom c.Int
	Layout c.Int
}

NPatchInfo, n-patch layout info

type NPatchLayout

type NPatchLayout c.Uint

N-patch layout

type PixelFormat

type PixelFormat c.Uint

Pixel formats NOTE: Support depends on OpenGL version and platform

type Quaternion

type Quaternion = Vector4

Quaternion, 4 components (Vector4 alias)

type RAudioBuffer

type RAudioBuffer struct {
}

type RAudioProcessor

type RAudioProcessor struct {
}

type Ray

type Ray struct {
	Position  Vector3
	Direction Vector3
}

Ray, ray for raycasting

func (Ray) CollisionBox

func (self Ray) CollisionBox(box BoundingBox) RayCollision

Get collision info between ray and box

llgo:link Ray.CollisionBox C.GetRayCollisionBox

func (Ray) CollisionMesh

func (self Ray) CollisionMesh(mesh Mesh, transform Matrix) RayCollision

Get collision info between ray and mesh

llgo:link Ray.CollisionMesh C.GetRayCollisionMesh

func (Ray) CollisionQuad

func (self Ray) CollisionQuad(p1 Vector3, p2 Vector3, p3 Vector3, p4 Vector3) RayCollision

Get collision info between ray and quad

llgo:link Ray.CollisionQuad C.GetRayCollisionQuad

func (Ray) CollisionSphere

func (self Ray) CollisionSphere(center Vector3, radius c.Float) RayCollision

Get collision info between ray and sphere

llgo:link Ray.CollisionSphere C.GetRayCollisionSphere

func (Ray) CollisionTriangle

func (self Ray) CollisionTriangle(p1 Vector3, p2 Vector3, p3 Vector3) RayCollision

Get collision info between ray and triangle

llgo:link Ray.CollisionTriangle C.GetRayCollisionTriangle

func (Ray) Draw

func (self Ray) Draw(color Color)

Draw a ray line

llgo:link Ray.Draw C.DrawRay

type RayCollision

type RayCollision struct {
	Hit      bool
	Distance c.Float
	Point    Vector3
	Normal   Vector3
}

RayCollision, ray hit information

type Rectangle

type Rectangle struct {
	X      c.Float
	Y      c.Float
	Width  c.Float
	Height c.Float
}

Rectangle, 4 components

func GetCollisionRec

func GetCollisionRec(rec1 Rectangle, rec2 Rectangle) Rectangle

Get collision rectangle for two rectangles collision

func GetShapesTextureRectangle

func GetShapesTextureRectangle() Rectangle

Get texture source rectangle that is used for shapes drawing

func (Rectangle) DrawRectangleGradientEx

func (self Rectangle) DrawRectangleGradientEx(topLeft Color, bottomLeft Color, bottomRight Color, topRight Color)

Draw a gradient-filled rectangle with custom vertex colors

llgo:link Rectangle.DrawRectangleGradientEx C.DrawRectangleGradientEx

func (Rectangle) DrawRectangleLinesEx

func (self Rectangle) DrawRectangleLinesEx(lineThick c.Float, color Color)

Draw rectangle outline with extended parameters

llgo:link Rectangle.DrawRectangleLinesEx C.DrawRectangleLinesEx

func (Rectangle) DrawRectanglePro

func (self Rectangle) DrawRectanglePro(origin Vector2, rotation c.Float, color Color)

Draw a color-filled rectangle with pro parameters

llgo:link Rectangle.DrawRectanglePro C.DrawRectanglePro

func (Rectangle) DrawRectangleRec

func (self Rectangle) DrawRectangleRec(color Color)

Draw a color-filled rectangle

llgo:link Rectangle.DrawRectangleRec C.DrawRectangleRec

func (Rectangle) DrawRectangleRounded

func (self Rectangle) DrawRectangleRounded(roundness c.Float, segments c.Int, color Color)

Draw rectangle with rounded edges

llgo:link Rectangle.DrawRectangleRounded C.DrawRectangleRounded

func (Rectangle) DrawRectangleRoundedLines

func (self Rectangle) DrawRectangleRoundedLines(roundness c.Float, segments c.Int, color Color)

Draw rectangle lines with rounded edges

llgo:link Rectangle.DrawRectangleRoundedLines C.DrawRectangleRoundedLines

func (Rectangle) DrawRectangleRoundedLinesEx

func (self Rectangle) DrawRectangleRoundedLinesEx(roundness c.Float, segments c.Int, lineThick c.Float, color Color)

Draw rectangle with rounded edges outline

llgo:link Rectangle.DrawRectangleRoundedLinesEx C.DrawRectangleRoundedLinesEx

type RenderTexture

type RenderTexture struct {
	Id      c.Uint
	Texture Texture
	Depth   Texture
}

RenderTexture, fbo for texture rendering

type RenderTexture2D

type RenderTexture2D = RenderTexture

RenderTexture2D, same as RenderTexture

func LoadRenderTexture

func LoadRenderTexture(width c.Int, height c.Int) RenderTexture2D

Load texture for rendering (framebuffer)

func (RenderTexture2D) BeginTextureMode

func (self RenderTexture2D) BeginTextureMode()

Begin drawing to render texture

llgo:link RenderTexture2D.BeginTextureMode C.BeginTextureMode

func (RenderTexture2D) IsRenderTextureValid

func (self RenderTexture2D) IsRenderTextureValid() bool

Check if a render texture is valid (loaded in GPU)

llgo:link RenderTexture2D.IsRenderTextureValid C.IsRenderTextureValid

func (RenderTexture2D) UnloadRenderTexture

func (self RenderTexture2D) UnloadRenderTexture()

Unload render texture from GPU memory (VRAM)

llgo:link RenderTexture2D.UnloadRenderTexture C.UnloadRenderTexture

type SaveFileDataCallback

type SaveFileDataCallback = func(_llcppg_param1 *c.Char, _llcppg_param2 unsafe.Pointer, _llcppg_param3 c.Int) bool

FileIO: Save binary data

type SaveFileTextCallback

type SaveFileTextCallback = func(_llcppg_param1 *c.Char, _llcppg_param2 *c.Char) bool

FileIO: Save text data

type Shader

type Shader struct {
	Id   c.Uint
	Locs *c.Int
}

Shader

func LoadShader

func LoadShader(vsFileName *c.Char, fsFileName *c.Char) Shader

Shader management functions NOTE: Shader functionality is not available on OpenGL 1.1

func LoadShaderFromMemory

func LoadShaderFromMemory(vsCode *c.Char, fsCode *c.Char) Shader

Load shader from code strings and bind default locations

func (Shader) BeginShaderMode

func (self Shader) BeginShaderMode()

Begin custom shader drawing

llgo:link Shader.BeginShaderMode C.BeginShaderMode

func (Shader) IsShaderValid

func (self Shader) IsShaderValid() bool

Check if a shader is valid (loaded on GPU)

llgo:link Shader.IsShaderValid C.IsShaderValid

func (Shader) Location

func (self Shader) Location(uniformName *c.Char) c.Int

Get shader uniform location

llgo:link Shader.Location C.GetShaderLocation

func (Shader) LocationAttrib

func (self Shader) LocationAttrib(attribName *c.Char) c.Int

Get shader attribute location

llgo:link Shader.LocationAttrib C.GetShaderLocationAttrib

func (Shader) SetShaderValue

func (self Shader) SetShaderValue(locIndex c.Int, value unsafe.Pointer, uniformType c.Int)

Set shader uniform value

llgo:link Shader.SetShaderValue C.SetShaderValue

func (Shader) SetShaderValueMatrix

func (self Shader) SetShaderValueMatrix(locIndex c.Int, mat Matrix)

Set shader uniform value (matrix 4x4)

llgo:link Shader.SetShaderValueMatrix C.SetShaderValueMatrix

func (Shader) SetShaderValueTexture

func (self Shader) SetShaderValueTexture(locIndex c.Int, texture Texture2D)

Set shader uniform value and bind the texture (sampler2d)

llgo:link Shader.SetShaderValueTexture C.SetShaderValueTexture

func (Shader) SetShaderValueV

func (self Shader) SetShaderValueV(locIndex c.Int, value unsafe.Pointer, uniformType c.Int, count c.Int)

Set shader uniform value vector

llgo:link Shader.SetShaderValueV C.SetShaderValueV

func (Shader) Unload

func (self Shader) Unload()

Unload shader from GPU memory (VRAM)

llgo:link Shader.Unload C.UnloadShader

type ShaderAttributeDataType

type ShaderAttributeDataType c.Uint

Shader attribute data types

type ShaderLocationIndex

type ShaderLocationIndex c.Uint

Shader location index NOTE: Some locations are tried to be set automatically on shader loading, but only if default attributes/uniforms names are found, check config.h for names

type ShaderUniformDataType

type ShaderUniformDataType c.Uint

Shader uniform data type

type Sound

type Sound struct {
	Stream     AudioStream
	FrameCount c.Uint
}

Sound

func LoadSound

func LoadSound(fileName *c.Char) Sound

Load sound from file

func (Sound) IsSoundPlaying

func (self Sound) IsSoundPlaying() bool

Check if a sound is currently playing

llgo:link Sound.IsSoundPlaying C.IsSoundPlaying

func (Sound) IsSoundValid

func (self Sound) IsSoundValid() bool

Checks if a sound is valid (data loaded and buffers initialized)

llgo:link Sound.IsSoundValid C.IsSoundValid

func (Sound) LoadSoundAlias

func (self Sound) LoadSoundAlias() Sound

Create a new sound that shares the same sample data as the source sound, does not own the sound data

llgo:link Sound.LoadSoundAlias C.LoadSoundAlias

func (Sound) Pause

func (self Sound) Pause()

Pause a sound

llgo:link Sound.Pause C.PauseSound

func (Sound) Play

func (self Sound) Play()

Wave/Sound management functions

llgo:link Sound.Play C.PlaySound

func (Sound) Resume

func (self Sound) Resume()

Resume a paused sound

llgo:link Sound.Resume C.ResumeSound

func (Sound) SetSoundPan

func (self Sound) SetSoundPan(pan c.Float)

Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)

llgo:link Sound.SetSoundPan C.SetSoundPan

func (Sound) SetSoundPitch

func (self Sound) SetSoundPitch(pitch c.Float)

Set pitch for a sound (1.0 is base level)

llgo:link Sound.SetSoundPitch C.SetSoundPitch

func (Sound) SetSoundVolume

func (self Sound) SetSoundVolume(volume c.Float)

Set volume for a sound (1.0 is max level)

llgo:link Sound.SetSoundVolume C.SetSoundVolume

func (Sound) Stop

func (self Sound) Stop()

Stop playing a sound

llgo:link Sound.Stop C.StopSound

func (Sound) Unload

func (self Sound) Unload()

Unload sound

llgo:link Sound.Unload C.UnloadSound

func (Sound) UnloadSoundAlias

func (self Sound) UnloadSoundAlias()

Unload a sound alias (does not deallocate sample data)

llgo:link Sound.UnloadSoundAlias C.UnloadSoundAlias

func (Sound) Update

func (self Sound) Update(data unsafe.Pointer, sampleCount c.Int)

Update sound buffer with new data (default data format: 32 bit float, stereo)

llgo:link Sound.Update C.UpdateSound

type Texture

type Texture struct {
	Id      c.Uint
	Width   c.Int
	Height  c.Int
	Mipmaps c.Int
	Format  c.Int
}

Texture, tex data stored in GPU memory (VRAM)

type Texture2D

type Texture2D = Texture

Texture2D, same as Texture

func GetShapesTexture

func GetShapesTexture() Texture2D

Get texture that is used for shapes drawing

func LoadTexture

func LoadTexture(fileName *c.Char) Texture2D

Texture loading functions NOTE: These functions require GPU access

func (Texture2D) DrawTexture

func (self Texture2D) DrawTexture(posX c.Int, posY c.Int, tint Color)

Texture drawing functions

llgo:link Texture2D.DrawTexture C.DrawTexture

func (Texture2D) DrawTextureEx

func (self Texture2D) DrawTextureEx(position Vector2, rotation c.Float, scale c.Float, tint Color)

Draw a Texture2D with extended parameters

llgo:link Texture2D.DrawTextureEx C.DrawTextureEx

func (Texture2D) DrawTextureNPatch

func (self Texture2D) DrawTextureNPatch(nPatchInfo NPatchInfo, dest Rectangle, origin Vector2, rotation c.Float, tint Color)

Draws a texture (or part of it) that stretches or shrinks nicely

llgo:link Texture2D.DrawTextureNPatch C.DrawTextureNPatch

func (Texture2D) DrawTexturePro

func (self Texture2D) DrawTexturePro(source Rectangle, dest Rectangle, origin Vector2, rotation c.Float, tint Color)

Draw a part of a texture defined by a rectangle with 'pro' parameters

llgo:link Texture2D.DrawTexturePro C.DrawTexturePro

func (Texture2D) DrawTextureRec

func (self Texture2D) DrawTextureRec(source Rectangle, position Vector2, tint Color)

Draw a part of a texture defined by a rectangle

llgo:link Texture2D.DrawTextureRec C.DrawTextureRec

func (Texture2D) DrawTextureV

func (self Texture2D) DrawTextureV(position Vector2, tint Color)

Draw a Texture2D with position defined as Vector2

llgo:link Texture2D.DrawTextureV C.DrawTextureV

func (*Texture2D) GenTextureMipmaps

func (self *Texture2D) GenTextureMipmaps()

Texture configuration functions

llgo:link (*Texture2D).GenTextureMipmaps C.GenTextureMipmaps

func (Texture2D) IsTextureValid

func (self Texture2D) IsTextureValid() bool

Check if a texture is valid (loaded in GPU)

llgo:link Texture2D.IsTextureValid C.IsTextureValid

func (Texture2D) LoadImageFromTexture

func (self Texture2D) LoadImageFromTexture() Image

Load image from GPU texture data

llgo:link Texture2D.LoadImageFromTexture C.LoadImageFromTexture

func (Texture2D) SetShapesTexture

func (self Texture2D) SetShapesTexture(source Rectangle)

------------------------------------------------------------------------------------ Basic Shapes Drawing Functions (Module: shapes) ------------------------------------------------------------------------------------ Set texture and rectangle to be used on shapes drawing NOTE: It can be useful when using basic shapes and one single font, defining a font char white rectangle would allow drawing everything in a single draw call

llgo:link Texture2D.SetShapesTexture C.SetShapesTexture

func (Texture2D) SetTextureFilter

func (self Texture2D) SetTextureFilter(filter c.Int)

Set texture scaling filter mode

llgo:link Texture2D.SetTextureFilter C.SetTextureFilter

func (Texture2D) SetTextureWrap

func (self Texture2D) SetTextureWrap(wrap c.Int)

Set texture wrapping mode

llgo:link Texture2D.SetTextureWrap C.SetTextureWrap

func (Texture2D) UnloadTexture

func (self Texture2D) UnloadTexture()

Unload texture from GPU memory (VRAM)

llgo:link Texture2D.UnloadTexture C.UnloadTexture

func (Texture2D) UpdateTexture

func (self Texture2D) UpdateTexture(pixels unsafe.Pointer)

Update GPU texture with new data (pixels should be able to fill texture)

llgo:link Texture2D.UpdateTexture C.UpdateTexture

func (Texture2D) UpdateTextureRec

func (self Texture2D) UpdateTextureRec(rec Rectangle, pixels unsafe.Pointer)

Update GPU texture rectangle with new data (pixels and rec should fit in texture)

llgo:link Texture2D.UpdateTextureRec C.UpdateTextureRec

type TextureCubemap

type TextureCubemap = Texture

TextureCubemap, same as Texture

type TextureFilter

type TextureFilter c.Uint

Texture parameters: filter mode NOTE 1: Filtering considers mipmaps if available in the texture NOTE 2: Filter is accordingly set for minification and magnification

type TextureWrap

type TextureWrap c.Uint

Texture parameters: wrap mode

type TraceLogCallback

type TraceLogCallback = func(_llcppg_param1 c.Int, _llcppg_param2 *c.Char, _llcppg_param3 c.VaList)

Callbacks to hook some internal functions WARNING: These callbacks are intended for advanced users

type TraceLogLevel

type TraceLogLevel c.Uint

Trace log level NOTE: Organized by priority level

type Transform

type Transform struct {
	Translation Vector3
	Rotation    Quaternion
	Scale       Vector3
}

Transform, vertex transformation data

type Vector2

type Vector2 struct {
	X c.Float
	Y c.Float
}

Vector2, 2 components

func GetGestureDragVector

func GetGestureDragVector() Vector2

Get gesture drag vector

func GetGesturePinchVector

func GetGesturePinchVector() Vector2

Get gesture pinch delta

func GetMonitorPosition

func GetMonitorPosition(monitor c.Int) Vector2

Get specified monitor position

func GetMouseDelta

func GetMouseDelta() Vector2

Get mouse delta between frames

func GetMousePosition

func GetMousePosition() Vector2

Get mouse position XY

func GetMouseWheelMoveV

func GetMouseWheelMoveV() Vector2

Get mouse wheel movement for both X and Y

func GetTouchPosition

func GetTouchPosition(index c.Int) Vector2

Get touch position XY for a touch point index (relative to screen size)

func GetWindowPosition

func GetWindowPosition() Vector2

Get window position XY on monitor

func GetWindowScaleDPI

func GetWindowScaleDPI() Vector2

Get window scale DPI factor

func (Vector2) CheckCollisionCircleLine

func (self Vector2) CheckCollisionCircleLine(radius c.Float, p1 Vector2, p2 Vector2) bool

Check if circle collides with a line created betweeen two points [p1] and [p2]

llgo:link Vector2.CheckCollisionCircleLine C.CheckCollisionCircleLine

func (Vector2) CheckCollisionCircleRec

func (self Vector2) CheckCollisionCircleRec(radius c.Float, rec Rectangle) bool

Check collision between circle and rectangle

llgo:link Vector2.CheckCollisionCircleRec C.CheckCollisionCircleRec

func (Vector2) CheckCollisionCircles

func (self Vector2) CheckCollisionCircles(radius1 c.Float, center2 Vector2, radius2 c.Float) bool

Check collision between two circles

llgo:link Vector2.CheckCollisionCircles C.CheckCollisionCircles

func (Vector2) CheckCollisionLines

func (self Vector2) CheckCollisionLines(endPos1 Vector2, startPos2 Vector2, endPos2 Vector2, collisionPoint *Vector2) bool

Check the collision between two lines defined by two points each, returns collision point by reference

llgo:link Vector2.CheckCollisionLines C.CheckCollisionLines

func (Vector2) CheckCollisionPointCircle

func (self Vector2) CheckCollisionPointCircle(center Vector2, radius c.Float) bool

Check if point is inside circle

llgo:link Vector2.CheckCollisionPointCircle C.CheckCollisionPointCircle

func (Vector2) CheckCollisionPointLine

func (self Vector2) CheckCollisionPointLine(p1 Vector2, p2 Vector2, threshold c.Int) bool

Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]

llgo:link Vector2.CheckCollisionPointLine C.CheckCollisionPointLine

func (Vector2) CheckCollisionPointPoly

func (self Vector2) CheckCollisionPointPoly(points *Vector2, pointCount c.Int) bool

Check if point is within a polygon described by array of vertices

llgo:link Vector2.CheckCollisionPointPoly C.CheckCollisionPointPoly

func (Vector2) CheckCollisionPointRec

func (self Vector2) CheckCollisionPointRec(rec Rectangle) bool

Check if point is inside rectangle

llgo:link Vector2.CheckCollisionPointRec C.CheckCollisionPointRec

func (Vector2) CheckCollisionPointTriangle

func (self Vector2) CheckCollisionPointTriangle(p1 Vector2, p2 Vector2, p3 Vector2) bool

Check if point is inside a triangle

llgo:link Vector2.CheckCollisionPointTriangle C.CheckCollisionPointTriangle

func (Vector2) DrawCircleGradient

func (self Vector2) DrawCircleGradient(radius c.Float, inner Color, outer Color)

Draw a gradient-filled circle

llgo:link Vector2.DrawCircleGradient C.DrawCircleGradient

func (Vector2) DrawCircleLinesV

func (self Vector2) DrawCircleLinesV(radius c.Float, color Color)

Draw circle outline (Vector version)

llgo:link Vector2.DrawCircleLinesV C.DrawCircleLinesV

func (Vector2) DrawCircleSector

func (self Vector2) DrawCircleSector(radius c.Float, startAngle c.Float, endAngle c.Float, segments c.Int, color Color)

Draw a piece of a circle

llgo:link Vector2.DrawCircleSector C.DrawCircleSector

func (Vector2) DrawCircleSectorLines

func (self Vector2) DrawCircleSectorLines(radius c.Float, startAngle c.Float, endAngle c.Float, segments c.Int, color Color)

Draw circle sector outline

llgo:link Vector2.DrawCircleSectorLines C.DrawCircleSectorLines

func (Vector2) DrawCircleV

func (self Vector2) DrawCircleV(radius c.Float, color Color)

Draw a color-filled circle (Vector version)

llgo:link Vector2.DrawCircleV C.DrawCircleV

func (Vector2) DrawEllipseLinesV

func (self Vector2) DrawEllipseLinesV(radiusH c.Float, radiusV c.Float, color Color)

Draw ellipse outline (Vector version)

llgo:link Vector2.DrawEllipseLinesV C.DrawEllipseLinesV

func (Vector2) DrawEllipseV

func (self Vector2) DrawEllipseV(radiusH c.Float, radiusV c.Float, color Color)

Draw ellipse (Vector version)

llgo:link Vector2.DrawEllipseV C.DrawEllipseV

func (Vector2) DrawLineBezier

func (self Vector2) DrawLineBezier(endPos Vector2, thick c.Float, color Color)

Draw line segment cubic-bezier in-out interpolation

llgo:link Vector2.DrawLineBezier C.DrawLineBezier

func (Vector2) DrawLineDashed

func (self Vector2) DrawLineDashed(endPos Vector2, dashSize c.Int, spaceSize c.Int, color Color)

Draw a dashed line

llgo:link Vector2.DrawLineDashed C.DrawLineDashed

func (Vector2) DrawLineEx

func (self Vector2) DrawLineEx(endPos Vector2, thick c.Float, color Color)

Draw a line (using triangles/quads)

llgo:link Vector2.DrawLineEx C.DrawLineEx

func (*Vector2) DrawLineStrip

func (self *Vector2) DrawLineStrip(pointCount c.Int, color Color)

Draw lines sequence (using gl lines)

llgo:link (*Vector2).DrawLineStrip C.DrawLineStrip

func (Vector2) DrawLineV

func (self Vector2) DrawLineV(endPos Vector2, color Color)

Draw a line (using gl lines)

llgo:link Vector2.DrawLineV C.DrawLineV

func (Vector2) DrawPixelV

func (self Vector2) DrawPixelV(color Color)

Draw a pixel using geometry (Vector version) [Can be slow, use with care]

llgo:link Vector2.DrawPixelV C.DrawPixelV

func (Vector2) DrawPoly

func (self Vector2) DrawPoly(sides c.Int, radius c.Float, rotation c.Float, color Color)

Draw a regular polygon (Vector version)

llgo:link Vector2.DrawPoly C.DrawPoly

func (Vector2) DrawPolyLines

func (self Vector2) DrawPolyLines(sides c.Int, radius c.Float, rotation c.Float, color Color)

Draw a polygon outline of n sides

llgo:link Vector2.DrawPolyLines C.DrawPolyLines

func (Vector2) DrawPolyLinesEx

func (self Vector2) DrawPolyLinesEx(sides c.Int, radius c.Float, rotation c.Float, lineThick c.Float, color Color)

Draw a polygon outline of n sides with extended parameters

llgo:link Vector2.DrawPolyLinesEx C.DrawPolyLinesEx

func (Vector2) DrawRectangleV

func (self Vector2) DrawRectangleV(size Vector2, color Color)

Draw a color-filled rectangle (Vector version)

llgo:link Vector2.DrawRectangleV C.DrawRectangleV

func (Vector2) DrawRing

func (self Vector2) DrawRing(innerRadius c.Float, outerRadius c.Float, startAngle c.Float, endAngle c.Float, segments c.Int, color Color)

Draw ring

llgo:link Vector2.DrawRing C.DrawRing

func (Vector2) DrawRingLines

func (self Vector2) DrawRingLines(innerRadius c.Float, outerRadius c.Float, startAngle c.Float, endAngle c.Float, segments c.Int, color Color)

Draw ring outline

llgo:link Vector2.DrawRingLines C.DrawRingLines

func (*Vector2) DrawSplineBasis

func (self *Vector2) DrawSplineBasis(pointCount c.Int, thick c.Float, color Color)

Draw spline: B-Spline, minimum 4 points

llgo:link (*Vector2).DrawSplineBasis C.DrawSplineBasis

func (*Vector2) DrawSplineBezierCubic

func (self *Vector2) DrawSplineBezierCubic(pointCount c.Int, thick c.Float, color Color)

Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]

llgo:link (*Vector2).DrawSplineBezierCubic C.DrawSplineBezierCubic

func (*Vector2) DrawSplineBezierQuadratic

func (self *Vector2) DrawSplineBezierQuadratic(pointCount c.Int, thick c.Float, color Color)

Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]

llgo:link (*Vector2).DrawSplineBezierQuadratic C.DrawSplineBezierQuadratic

func (*Vector2) DrawSplineCatmullRom

func (self *Vector2) DrawSplineCatmullRom(pointCount c.Int, thick c.Float, color Color)

Draw spline: Catmull-Rom, minimum 4 points

llgo:link (*Vector2).DrawSplineCatmullRom C.DrawSplineCatmullRom

func (*Vector2) DrawSplineLinear

func (self *Vector2) DrawSplineLinear(pointCount c.Int, thick c.Float, color Color)

Splines drawing functions

llgo:link (*Vector2).DrawSplineLinear C.DrawSplineLinear

func (Vector2) DrawSplineSegmentBasis

func (self Vector2) DrawSplineSegmentBasis(p2 Vector2, p3 Vector2, p4 Vector2, thick c.Float, color Color)

Draw spline segment: B-Spline, 4 points

llgo:link Vector2.DrawSplineSegmentBasis C.DrawSplineSegmentBasis

func (Vector2) DrawSplineSegmentBezierCubic

func (self Vector2) DrawSplineSegmentBezierCubic(c2 Vector2, c3 Vector2, p4 Vector2, thick c.Float, color Color)

Draw spline segment: Cubic Bezier, 2 points, 2 control points

llgo:link Vector2.DrawSplineSegmentBezierCubic C.DrawSplineSegmentBezierCubic

func (Vector2) DrawSplineSegmentBezierQuadratic

func (self Vector2) DrawSplineSegmentBezierQuadratic(c2 Vector2, p3 Vector2, thick c.Float, color Color)

Draw spline segment: Quadratic Bezier, 2 points, 1 control point

llgo:link Vector2.DrawSplineSegmentBezierQuadratic C.DrawSplineSegmentBezierQuadratic

func (Vector2) DrawSplineSegmentCatmullRom

func (self Vector2) DrawSplineSegmentCatmullRom(p2 Vector2, p3 Vector2, p4 Vector2, thick c.Float, color Color)

Draw spline segment: Catmull-Rom, 4 points

llgo:link Vector2.DrawSplineSegmentCatmullRom C.DrawSplineSegmentCatmullRom

func (Vector2) DrawSplineSegmentLinear

func (self Vector2) DrawSplineSegmentLinear(p2 Vector2, thick c.Float, color Color)

Draw spline segment: Linear, 2 points

llgo:link Vector2.DrawSplineSegmentLinear C.DrawSplineSegmentLinear

func (Vector2) DrawTriangle

func (self Vector2) DrawTriangle(v2 Vector2, v3 Vector2, color Color)

Draw a color-filled triangle (vertex in counter-clockwise order!)

llgo:link Vector2.DrawTriangle C.DrawTriangle

func (*Vector2) DrawTriangleFan

func (self *Vector2) DrawTriangleFan(pointCount c.Int, color Color)

Draw a triangle fan defined by points (first vertex is the center)

llgo:link (*Vector2).DrawTriangleFan C.DrawTriangleFan

func (Vector2) DrawTriangleLines

func (self Vector2) DrawTriangleLines(v2 Vector2, v3 Vector2, color Color)

Draw triangle outline (vertex in counter-clockwise order!)

llgo:link Vector2.DrawTriangleLines C.DrawTriangleLines

func (*Vector2) DrawTriangleStrip

func (self *Vector2) DrawTriangleStrip(pointCount c.Int, color Color)

Draw a triangle strip defined by points

llgo:link (*Vector2).DrawTriangleStrip C.DrawTriangleStrip

func (Vector2) ScreenToWorld2D

func (self Vector2) ScreenToWorld2D(camera Camera2D) Vector2

Get the world space position for a 2d camera screen space position

llgo:link Vector2.ScreenToWorld2D C.GetScreenToWorld2D

func (Vector2) ScreenToWorldRay

func (self Vector2) ScreenToWorldRay(camera Camera) Ray

Get a ray trace from screen position (i.e mouse)

llgo:link Vector2.ScreenToWorldRay C.GetScreenToWorldRay

func (Vector2) ScreenToWorldRayEx

func (self Vector2) ScreenToWorldRayEx(camera Camera, width c.Int, height c.Int) Ray

Get a ray trace from screen position (i.e mouse) in a viewport

llgo:link Vector2.ScreenToWorldRayEx C.GetScreenToWorldRayEx

func (Vector2) SplinePointBasis

func (self Vector2) SplinePointBasis(p2 Vector2, p3 Vector2, p4 Vector2, t c.Float) Vector2

Get (evaluate) spline point: B-Spline

llgo:link Vector2.SplinePointBasis C.GetSplinePointBasis

func (Vector2) SplinePointBezierCubic

func (self Vector2) SplinePointBezierCubic(c2 Vector2, c3 Vector2, p4 Vector2, t c.Float) Vector2

Get (evaluate) spline point: Cubic Bezier

llgo:link Vector2.SplinePointBezierCubic C.GetSplinePointBezierCubic

func (Vector2) SplinePointBezierQuad

func (self Vector2) SplinePointBezierQuad(c2 Vector2, p3 Vector2, t c.Float) Vector2

Get (evaluate) spline point: Quadratic Bezier

llgo:link Vector2.SplinePointBezierQuad C.GetSplinePointBezierQuad

func (Vector2) SplinePointCatmullRom

func (self Vector2) SplinePointCatmullRom(p2 Vector2, p3 Vector2, p4 Vector2, t c.Float) Vector2

Get (evaluate) spline point: Catmull-Rom

llgo:link Vector2.SplinePointCatmullRom C.GetSplinePointCatmullRom

func (Vector2) SplinePointLinear

func (self Vector2) SplinePointLinear(endPos Vector2, t c.Float) Vector2

Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]

llgo:link Vector2.SplinePointLinear C.GetSplinePointLinear

func (Vector2) WorldToScreen2D

func (self Vector2) WorldToScreen2D(camera Camera2D) Vector2

Get the screen space position for a 2d camera world space position

llgo:link Vector2.WorldToScreen2D C.GetWorldToScreen2D

type Vector3

type Vector3 struct {
	X c.Float
	Y c.Float
	Z c.Float
}

Vector3, 3 components

func ColorToHSV added in v0.3.0

func ColorToHSV(color Color) Vector3

Get HSV values for a Color, hue [0..360], saturation/value [0..1]

func (Vector3) CheckCollisionSpheres

func (self Vector3) CheckCollisionSpheres(radius1 c.Float, center2 Vector3, radius2 c.Float) bool

Collision detection functions

llgo:link Vector3.CheckCollisionSpheres C.CheckCollisionSpheres

func (Vector3) DrawCapsule

func (self Vector3) DrawCapsule(endPos Vector3, radius c.Float, slices c.Int, rings c.Int, color Color)

Draw a capsule with the center of its sphere caps at startPos and endPos

llgo:link Vector3.DrawCapsule C.DrawCapsule

func (Vector3) DrawCapsuleWires

func (self Vector3) DrawCapsuleWires(endPos Vector3, radius c.Float, slices c.Int, rings c.Int, color Color)

Draw capsule wireframe with the center of its sphere caps at startPos and endPos

llgo:link Vector3.DrawCapsuleWires C.DrawCapsuleWires

func (Vector3) DrawCircle3D

func (self Vector3) DrawCircle3D(radius c.Float, rotationAxis Vector3, rotationAngle c.Float, color Color)

Draw a circle in 3D world space

llgo:link Vector3.DrawCircle3D C.DrawCircle3D

func (Vector3) DrawCube

func (self Vector3) DrawCube(width c.Float, height c.Float, length c.Float, color Color)

Draw cube

llgo:link Vector3.DrawCube C.DrawCube

func (Vector3) DrawCubeV

func (self Vector3) DrawCubeV(size Vector3, color Color)

Draw cube (Vector version)

llgo:link Vector3.DrawCubeV C.DrawCubeV

func (Vector3) DrawCubeWires

func (self Vector3) DrawCubeWires(width c.Float, height c.Float, length c.Float, color Color)

Draw cube wires

llgo:link Vector3.DrawCubeWires C.DrawCubeWires

func (Vector3) DrawCubeWiresV

func (self Vector3) DrawCubeWiresV(size Vector3, color Color)

Draw cube wires (Vector version)

llgo:link Vector3.DrawCubeWiresV C.DrawCubeWiresV

func (Vector3) DrawCylinder

func (self Vector3) DrawCylinder(radiusTop c.Float, radiusBottom c.Float, height c.Float, slices c.Int, color Color)

Draw a cylinder/cone

llgo:link Vector3.DrawCylinder C.DrawCylinder

func (Vector3) DrawCylinderEx

func (self Vector3) DrawCylinderEx(endPos Vector3, startRadius c.Float, endRadius c.Float, sides c.Int, color Color)

Draw a cylinder with base at startPos and top at endPos

llgo:link Vector3.DrawCylinderEx C.DrawCylinderEx

func (Vector3) DrawCylinderWires

func (self Vector3) DrawCylinderWires(radiusTop c.Float, radiusBottom c.Float, height c.Float, slices c.Int, color Color)

Draw a cylinder/cone wires

llgo:link Vector3.DrawCylinderWires C.DrawCylinderWires

func (Vector3) DrawCylinderWiresEx

func (self Vector3) DrawCylinderWiresEx(endPos Vector3, startRadius c.Float, endRadius c.Float, sides c.Int, color Color)

Draw a cylinder wires with base at startPos and top at endPos

llgo:link Vector3.DrawCylinderWiresEx C.DrawCylinderWiresEx

func (Vector3) DrawLine3D

func (self Vector3) DrawLine3D(endPos Vector3, color Color)

Basic geometric 3D shapes drawing functions

llgo:link Vector3.DrawLine3D C.DrawLine3D

func (Vector3) DrawPlane

func (self Vector3) DrawPlane(size Vector2, color Color)

Draw a plane XZ

llgo:link Vector3.DrawPlane C.DrawPlane

func (Vector3) DrawPoint3D

func (self Vector3) DrawPoint3D(color Color)

Draw a point in 3D space, actually a small line

llgo:link Vector3.DrawPoint3D C.DrawPoint3D

func (Vector3) DrawSphere

func (self Vector3) DrawSphere(radius c.Float, color Color)

Draw sphere

llgo:link Vector3.DrawSphere C.DrawSphere

func (Vector3) DrawSphereEx

func (self Vector3) DrawSphereEx(radius c.Float, rings c.Int, slices c.Int, color Color)

Draw sphere with extended parameters

llgo:link Vector3.DrawSphereEx C.DrawSphereEx

func (Vector3) DrawSphereWires

func (self Vector3) DrawSphereWires(radius c.Float, rings c.Int, slices c.Int, color Color)

Draw sphere wires

llgo:link Vector3.DrawSphereWires C.DrawSphereWires

func (Vector3) DrawTriangle3D

func (self Vector3) DrawTriangle3D(v2 Vector3, v3 Vector3, color Color)

Draw a color-filled triangle (vertex in counter-clockwise order!)

llgo:link Vector3.DrawTriangle3D C.DrawTriangle3D

func (*Vector3) DrawTriangleStrip3D

func (self *Vector3) DrawTriangleStrip3D(pointCount c.Int, color Color)

Draw a triangle strip defined by points

llgo:link (*Vector3).DrawTriangleStrip3D C.DrawTriangleStrip3D

func (Vector3) WorldToScreen

func (self Vector3) WorldToScreen(camera Camera) Vector2

Get the screen space position for a 3d world space position

llgo:link Vector3.WorldToScreen C.GetWorldToScreen

func (Vector3) WorldToScreenEx

func (self Vector3) WorldToScreenEx(camera Camera, width c.Int, height c.Int) Vector2

Get size position for a 3d world space position

llgo:link Vector3.WorldToScreenEx C.GetWorldToScreenEx

type Vector4

type Vector4 struct {
	X c.Float
	Y c.Float
	Z c.Float
	W c.Float
}

Vector4, 4 components

func ColorNormalize added in v0.3.0

func ColorNormalize(color Color) Vector4

Get Color normalized as float [0..1]

func (Vector4) ColorFromNormalized

func (self Vector4) ColorFromNormalized() Color

Get Color from normalized values [0..1]

llgo:link Vector4.ColorFromNormalized C.ColorFromNormalized

type VrDeviceInfo

type VrDeviceInfo struct {
	HResolution            c.Int
	VResolution            c.Int
	HScreenSize            c.Float
	VScreenSize            c.Float
	EyeToScreenDistance    c.Float
	LensSeparationDistance c.Float
	InterpupillaryDistance c.Float
	LensDistortionValues   [4]c.Float
	ChromaAbCorrection     [4]c.Float
}

VrDeviceInfo, Head-Mounted-Display device parameters

func (VrDeviceInfo) LoadVrStereoConfig

func (self VrDeviceInfo) LoadVrStereoConfig() VrStereoConfig

VR stereo config functions for VR simulator

llgo:link VrDeviceInfo.LoadVrStereoConfig C.LoadVrStereoConfig

type VrStereoConfig

type VrStereoConfig struct {
	Projection        [2]Matrix
	ViewOffset        [2]Matrix
	LeftLensCenter    [2]c.Float
	RightLensCenter   [2]c.Float
	LeftScreenCenter  [2]c.Float
	RightScreenCenter [2]c.Float
	Scale             [2]c.Float
	ScaleIn           [2]c.Float
}

VrStereoConfig, VR stereo rendering configuration for simulator

func (VrStereoConfig) BeginVrStereoMode

func (self VrStereoConfig) BeginVrStereoMode()

Begin stereo rendering (requires VR simulator)

llgo:link VrStereoConfig.BeginVrStereoMode C.BeginVrStereoMode

func (VrStereoConfig) Unload

func (self VrStereoConfig) Unload()

Unload VR stereo config

llgo:link VrStereoConfig.Unload C.UnloadVrStereoConfig

type Wave

type Wave struct {
	FrameCount c.Uint
	SampleRate c.Uint
	SampleSize c.Uint
	Channels   c.Uint
	Data       unsafe.Pointer
}

Wave, audio wave data

func LoadWave

func LoadWave(fileName *c.Char) Wave

Wave/Sound loading/unloading functions

func LoadWaveFromMemory

func LoadWaveFromMemory(fileType *c.Char, fileData *uint8, dataSize c.Int) Wave

Load wave from memory buffer, fileType refers to extension: i.e. '.wav'

func (Wave) Copy

func (self Wave) Copy() Wave

Copy a wave to a new wave

llgo:link Wave.Copy C.WaveCopy

func (*Wave) Crop

func (self *Wave) Crop(initFrame c.Int, finalFrame c.Int)

Crop a wave to defined frames range

llgo:link (*Wave).Crop C.WaveCrop

func (Wave) Export

func (self Wave) Export(fileName *c.Char) bool

Export wave data to file, returns true on success

llgo:link Wave.Export C.ExportWave

func (Wave) ExportWaveAsCode

func (self Wave) ExportWaveAsCode(fileName *c.Char) bool

Export wave sample data to code (.h), returns true on success

llgo:link Wave.ExportWaveAsCode C.ExportWaveAsCode

func (*Wave) Format

func (self *Wave) Format(sampleRate c.Int, sampleSize c.Int, channels c.Int)

Convert wave data to desired format

llgo:link (*Wave).Format C.WaveFormat

func (Wave) IsWaveValid

func (self Wave) IsWaveValid() bool

Checks if wave data is valid (data loaded and parameters)

llgo:link Wave.IsWaveValid C.IsWaveValid

func (Wave) LoadSoundFrom

func (self Wave) LoadSoundFrom() Sound

Load sound from wave data

llgo:link Wave.LoadSoundFrom C.LoadSoundFromWave

func (Wave) LoadWaveSamples

func (self Wave) LoadWaveSamples() *c.Float

Load samples data from wave as a 32bit float data array

llgo:link Wave.LoadWaveSamples C.LoadWaveSamples

func (Wave) Unload

func (self Wave) Unload()

Unload wave data

llgo:link Wave.Unload C.UnloadWave

Directories

Path Synopsis
demo
raylibdemo command
tetris command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL