raylib-go: github.com/gen2brain/raylib-go/raylib Index | Files

package rl

import "github.com/gen2brain/raylib-go/raylib"

Package raylib - Go bindings for raylib, a simple and easy-to-use library to learn videogames programming.

raylib is highly inspired by Borland BGI graphics lib and by XNA framework.

raylib could be useful for prototyping, tools development, graphic applications, embedded systems and education.

NOTE for ADVENTURERS: raylib is a programming library to learn videogames programming; no fancy interface, no visual helpers, no auto-debugging... just coding in the most pure spartan-programmers way.

Example:

package main

import "github.com/gen2brain/raylib-go/raylib"

func main() {
	rl.InitWindow(800, 450, "raylib [core] example - basic window")

	rl.SetTargetFPS(60)

	for !rl.WindowShouldClose() {
		rl.BeginDrawing()

		rl.ClearBackground(rl.RayWhite)

		rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LightGray)

		rl.EndDrawing()
	}

	rl.CloseWindow()
}

Index

Package Files

audio.go camera.go cgo.go cgo_linux.go core.go gestures.go models.go platform_desktop.go raylib.go shaders.go shapes.go text.go textures.go utils.go

Constants

const (
    Pi      = 3.1415927
    Deg2rad = 0.017453292
    Rad2deg = 57.295776

    // Set to show raylib logo at startup
     = 1
    // Set to run program in fullscreen
    FlagFullscreenMode = 2
    // Set to allow resizable window
    FlagWindowResizable = 4
    // Set to disable window decoration (frame and buttons)
    FlagWindowUndecorated = 8
    // Set to allow transparent window
    FlagWindowTransparent = 16
    // Set to try enabling MSAA 4X
    FlagMsaa4xHint = 32
    // Set to try enabling V-Sync on GPU
    FlagVsyncHint = 64

    // Keyboard Function Keys
    KeySpace        = 32
    KeyEscape       = 256
    KeyEnter        = 257
    KeyTab          = 258
    KeyBackspace    = 259
    KeyInsert       = 260
    KeyDelete       = 261
    KeyRight        = 262
    KeyLeft         = 263
    KeyDown         = 264
    KeyUp           = 265
    KeyPageUp       = 266
    KeyPageDown     = 267
    KeyHome         = 268
    KeyEnd          = 269
    KeyCapsLock     = 280
    KeyScrollLock   = 281
    KeyNumLock      = 282
    KeyPrintScreen  = 283
    KeyPause        = 284
    KeyF1           = 290
    KeyF2           = 291
    KeyF3           = 292
    KeyF4           = 293
    KeyF5           = 294
    KeyF6           = 295
    KeyF7           = 296
    KeyF8           = 297
    KeyF9           = 298
    KeyF10          = 299
    KeyF11          = 300
    KeyF12          = 301
    KeyLeftShift    = 340
    KeyLeftControl  = 341
    KeyLeftAlt      = 342
    KeyLeftSuper    = 347
    KeyRightShift   = 344
    KeyRightControl = 345
    KeyRightAlt     = 346
    KeyRightSuper   = 347
    KeyKbMenu       = 348
    KeyLeftBracket  = 91
    KeyBackSlash    = 92
    KeyRightBracket = 93
    KeyGrave        = 96

    // Keyboard Number Pad Keys
    KeyKp0        = 320
    KeyKp1        = 321
    KeyKp2        = 322
    KeyKp3        = 323
    KeyKp4        = 324
    KeyKp5        = 325
    KeyKp6        = 326
    KeyKp7        = 327
    KeyKp8        = 328
    KeyKp9        = 329
    KeyKpDecimal  = 330
    KeyKpDivide   = 331
    KeyKpMultiply = 332
    KeyKpSubtract = 333
    KeyKpAdd      = 334
    KeyKpEnter    = 335
    KeyKpEqual    = 336

    // Keyboard Alpha Numeric Keys
    KeyApostrophe = 39
    KeyComma      = 44
    KeyMinus      = 45
    KeyPeriod     = 46
    KeySlash      = 47
    KeyZero       = 48
    KeyOne        = 49
    KeyTwo        = 50
    KeyThree      = 51
    KeyFour       = 52
    KeyFive       = 53
    KeySix        = 54
    KeySeven      = 55
    KeyEight      = 56
    KeyNine       = 57
    KeySemicolon  = 59
    KeyEqual      = 61
    KeyA          = 65
    KeyB          = 66
    KeyC          = 67
    KeyD          = 68
    KeyE          = 69
    KeyF          = 70
    KeyG          = 71
    KeyH          = 72
    KeyI          = 73
    KeyJ          = 74
    KeyK          = 75
    KeyL          = 76
    KeyM          = 77
    KeyN          = 78
    KeyO          = 79
    KeyP          = 80
    KeyQ          = 81
    KeyR          = 82
    KeyS          = 83
    KeyT          = 84
    KeyU          = 85
    KeyV          = 86
    KeyW          = 87
    KeyX          = 88
    KeyY          = 89
    KeyZ          = 90

    // Android keys
    KeyBack       = 4
    KeyMenu       = 82
    KeyVolumeUp   = 24
    KeyVolumeDown = 25

    // Mouse Buttons
    MouseLeftButton   = 0
    MouseRightButton  = 1
    MouseMiddleButton = 2

    // Touch points registered
    MaxTouchPoints = 2

    // Gamepad Number
    GamepadPlayer1 = 0
    GamepadPlayer2 = 1
    GamepadPlayer3 = 2
    GamepadPlayer4 = 3

    // PS3 USB Controller Buttons
    GamepadPs3ButtonTriangle = 0
    GamepadPs3ButtonCircle   = 1
    GamepadPs3ButtonCross    = 2
    GamepadPs3ButtonSquare   = 3
    GamepadPs3ButtonL1       = 6
    GamepadPs3ButtonR1       = 7
    GamepadPs3ButtonL2       = 4
    GamepadPs3ButtonR2       = 5
    GamepadPs3ButtonStart    = 8
    GamepadPs3ButtonSelect   = 9
    GamepadPs3ButtonUp       = 24
    GamepadPs3ButtonRight    = 25
    GamepadPs3ButtonDown     = 26
    GamepadPs3ButtonLeft     = 27
    GamepadPs3ButtonPs       = 12

    // PS3 USB Controller Axis
    GamepadPs3AxisLeftX  = 0
    GamepadPs3AxisLeftY  = 1
    GamepadPs3AxisRightX = 2
    GamepadPs3AxisRightY = 5
    // [1..-1] (pressure-level)
    GamepadPs3AxisL2 = 3
    // [1..-1] (pressure-level)
    GamepadPs3AxisR2 = 4

    // Xbox360 USB Controller Buttons
    GamepadXboxButtonA      = 0
    GamepadXboxButtonB      = 1
    GamepadXboxButtonX      = 2
    GamepadXboxButtonY      = 3
    GamepadXboxButtonLb     = 4
    GamepadXboxButtonRb     = 5
    GamepadXboxButtonSelect = 6
    GamepadXboxButtonStart  = 7
    GamepadXboxButtonUp     = 10
    GamepadXboxButtonRight  = 11
    GamepadXboxButtonDown   = 12
    GamepadXboxButtonLeft   = 13
    GamepadXboxButtonHome   = 8

    // Android Gamepad Controller (SNES CLASSIC)
    GamepadAndroidDpadUp     = 19
    GamepadAndroidDpadDown   = 20
    GamepadAndroidDpadLeft   = 21
    GamepadAndroidDpadRight  = 22
    GamepadAndroidDpadCenter = 23

    GamepadAndroidButtonA  = 96
    GamepadAndroidButtonB  = 97
    GamepadAndroidButtonC  = 98
    GamepadAndroidButtonX  = 99
    GamepadAndroidButtonY  = 100
    GamepadAndroidButtonZ  = 101
    GamepadAndroidButtonL1 = 102
    GamepadAndroidButtonR1 = 103
    GamepadAndroidButtonL2 = 104
    GamepadAndroidButtonR2 = 105

    // Xbox360 USB Controller Axis
    // [-1..1] (left->right)
    GamepadXboxAxisLeftX = 0
    // [1..-1] (up->down)
    GamepadXboxAxisLeftY = 1
    // [-1..1] (left->right)
    GamepadXboxAxisRightX = 2
    // [1..-1] (up->down)
    GamepadXboxAxisRightY = 3
    // [-1..1] (pressure-level)
    GamepadXboxAxisLt = 4
    // [-1..1] (pressure-level)
    GamepadXboxAxisRt = 5
)

Some basic Defines

const (
    LocVertexPosition = iota
    LocVertexTexcoord01
    LocVertexTexcoord02
    LocVertexNormal
    LocVertexTangent
    LocVertexColor
    LocMatrixMvp
    LocMatrixModel
    LocMatrixView
    LocMatrixProjection
    LocVectorView
    LocColorDiffuse
    LocColorSpecular
    LocColorAmbient
    LocMapAlbedo
    LocMapMetalness
    LocMapNormal
    LocMapRoughness
    LocMapOcclusion
    LocMapEmission
    LocMapHeight
    LocMapCubemap
    LocMapIrradiance
    LocMapPrefilter
    LocMapBrdf
)

Shader location point type

const (
    // MapDiffuse
    MapAlbedo = iota
    MapMetalness
    MapNormal
    MapRoughness
    MapOcclusion
    MapEmission
    MapHeight
    // NOTE: Uses GL_TEXTURE_CUBE_MAP
    MapCubemap
    // NOTE: Uses GL_TEXTURE_CUBE_MAP
    MapIrradiance
    // NOTE: Uses GL_TEXTURE_CUBE_MAP
    MapPrefilter
    MapBrdf
)

Material map type

const (
    MapDiffuse     = MapAlbedo
    MapSpecular    = MapMetalness
    LocMapDiffuse  = LocMapAlbedo
    LocMapSpecular = LocMapMetalness
)

Material map type

const (
    // Maximum number of predefined locations stored in shader struct
    MaxShaderLocations = 32
    // Maximum number of texture maps stored in shader struct
    MaxMaterialMaps = 12
)

Shader and material limits

const (
    LogInfo = 1 << iota
    LogWarning
    LogError
    LogDebug
    LogOther
)

Log message types

Variables

var (
    // Light Gray
    LightGray = NewColor(200, 200, 200, 255)
    // Gray
    Gray = NewColor(130, 130, 130, 255)
    // Dark Gray
    DarkGray = NewColor(80, 80, 80, 255)
    // Yellow
    Yellow = NewColor(253, 249, 0, 255)
    // Gold
    Gold = NewColor(255, 203, 0, 255)
    // Orange
    Orange = NewColor(255, 161, 0, 255)
    // Pink
    Pink = NewColor(255, 109, 194, 255)
    // Red
    Red = NewColor(230, 41, 55, 255)
    // Maroon
    Maroon = NewColor(190, 33, 55, 255)
    // Green
    Green = NewColor(0, 228, 48, 255)
    // Lime
    Lime = NewColor(0, 158, 47, 255)
    // Dark Green
    DarkGreen = NewColor(0, 117, 44, 255)
    // Sky Blue
    SkyBlue = NewColor(102, 191, 255, 255)
    // Blue
    Blue = NewColor(0, 121, 241, 255)
    // Dark Blue
    DarkBlue = NewColor(0, 82, 172, 255)
    // Purple
    Purple = NewColor(200, 122, 255, 255)
    // Violet
    Violet = NewColor(135, 60, 190, 255)
    // Dark Purple
    DarkPurple = NewColor(112, 31, 126, 255)
    // Beige
    Beige = NewColor(211, 176, 131, 255)
    // Brown
    Brown = NewColor(127, 106, 79, 255)
    // Dark Brown
    DarkBrown = NewColor(76, 63, 47, 255)
    // White
    White = NewColor(255, 255, 255, 255)
    // Black
    Black = NewColor(0, 0, 0, 255)
    // Blank (Transparent)
    Blank = NewColor(0, 0, 0, 0)
    // Magenta
    Magenta = NewColor(255, 0, 255, 255)
    // Ray White (RayLib Logo White)
    RayWhite = NewColor(245, 245, 245, 255)
)

Some Basic Colors NOTE: Custom raylib color palette for amazing visuals on WHITE background

func BeginBlendMode Uses

func BeginBlendMode(mode BlendMode)

BeginBlendMode - Begin blending mode (alpha, additive, multiplied)

func BeginDrawing Uses

func BeginDrawing()

BeginDrawing - Setup drawing canvas to start drawing

func BeginMode2D Uses

func BeginMode2D(camera Camera2D)

BeginMode2D - Initialize 2D mode with custom camera

func BeginMode3D Uses

func BeginMode3D(camera Camera)

BeginMode3D - Initializes 3D mode for drawing (Camera setup)

func BeginShaderMode Uses

func BeginShaderMode(shader Shader)

BeginShaderMode - Begin custom shader drawing

func BeginTextureMode Uses

func BeginTextureMode(target RenderTexture2D)

BeginTextureMode - Initializes render texture for drawing

func BeginVrDrawing Uses

func BeginVrDrawing()

BeginVrDrawing - Begin VR simulator stereo rendering

func CheckCollisionBoxSphere Uses

func CheckCollisionBoxSphere(box BoundingBox, centerSphere Vector3, radiusSphere float32) bool

CheckCollisionBoxSphere - Detect collision between box and sphere

func CheckCollisionBoxes Uses

func CheckCollisionBoxes(box1 BoundingBox, box2 BoundingBox) bool

CheckCollisionBoxes - Detect collision between two bounding boxes

func CheckCollisionCircleRec Uses

func CheckCollisionCircleRec(center Vector2, radius float32, rec Rectangle) bool

CheckCollisionCircleRec - Check collision between circle and rectangle

func CheckCollisionCircles Uses

func CheckCollisionCircles(center1 Vector2, radius1 float32, center2 Vector2, radius2 float32) bool

CheckCollisionCircles - Check collision between two circles

func CheckCollisionPointCircle Uses

func CheckCollisionPointCircle(point Vector2, center Vector2, radius float32) bool

CheckCollisionPointCircle - Check if point is inside circle

func CheckCollisionPointRec Uses

func CheckCollisionPointRec(point Vector2, rec Rectangle) bool

CheckCollisionPointRec - Check if point is inside rectangle

func CheckCollisionPointTriangle Uses

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

CheckCollisionPointTriangle - Check if point is inside a triangle

func CheckCollisionRayBox Uses

func CheckCollisionRayBox(ray Ray, box BoundingBox) bool

CheckCollisionRayBox - Detect collision between ray and box

func CheckCollisionRaySphere Uses

func CheckCollisionRaySphere(ray Ray, spherePosition Vector3, sphereRadius float32) bool

CheckCollisionRaySphere - Detect collision between ray and sphere

func CheckCollisionRaySphereEx Uses

func CheckCollisionRaySphereEx(ray Ray, spherePosition Vector3, sphereRadius float32, collisionPoint Vector3) bool

CheckCollisionRaySphereEx - Detect collision between ray and sphere with extended parameters and collision point detection

func CheckCollisionRecs Uses

func CheckCollisionRecs(rec1, rec2 Rectangle) bool

CheckCollisionRecs - Check collision between two rectangles

func CheckCollisionSpheres Uses

func CheckCollisionSpheres(centerA Vector3, radiusA float32, centerB Vector3, radiusB float32) bool

CheckCollisionSpheres - Detect collision between two spheres

func ClearBackground Uses

func ClearBackground(color Color)

ClearBackground - Sets Background Color

func ClearDroppedFiles Uses

func ClearDroppedFiles()

ClearDroppedFiles - Clear dropped files paths buffer

func CloseAudioDevice Uses

func CloseAudioDevice()

CloseAudioDevice - Close the audio device and context

func CloseAudioStream Uses

func CloseAudioStream(stream AudioStream)

CloseAudioStream - Close audio stream and free memory

func CloseVrSimulator Uses

func CloseVrSimulator()

CloseVrSimulator - Close VR simulator for current device

func CloseWindow Uses

func CloseWindow()

CloseWindow - Close Window and Terminate Context

func ColorToInt Uses

func ColorToInt(color Color) int32

ColorToInt - Returns hexadecimal value for a Color

func DisableCursor Uses

func DisableCursor()

DisableCursor - Disables cursor

func DrawBillboard Uses

func DrawBillboard(camera Camera, texture Texture2D, center Vector3, size float32, tint Color)

DrawBillboard - Draw a billboard texture

func DrawBillboardRec Uses

func DrawBillboardRec(camera Camera, texture Texture2D, sourceRec Rectangle, center Vector3, size float32, tint Color)

DrawBillboardRec - Draw a billboard texture defined by sourceRec

func DrawBoundingBox Uses

func DrawBoundingBox(box BoundingBox, color Color)

DrawBoundingBox - Draw bounding box (wires)

func DrawCircle Uses

func DrawCircle(centerX, centerY int32, radius float32, color Color)

DrawCircle - Draw a color-filled circle

func DrawCircle3D Uses

func DrawCircle3D(center Vector3, radius float32, rotationAxis Vector3, rotationAngle float32, color Color)

DrawCircle3D - Draw a circle in 3D world space

func DrawCircleGradient Uses

func DrawCircleGradient(centerX, centerY int32, radius float32, color1, color2 Color)

DrawCircleGradient - Draw a gradient-filled circle

func DrawCircleLines Uses

func DrawCircleLines(centerX, centerY int32, radius float32, color Color)

DrawCircleLines - Draw circle outline

func DrawCircleV Uses

func DrawCircleV(center Vector2, radius float32, color Color)

DrawCircleV - Draw a color-filled circle (Vector version)

func DrawCube Uses

func DrawCube(position Vector3, width float32, height float32, length float32, color Color)

DrawCube - Draw cube

func DrawCubeTexture Uses

func DrawCubeTexture(texture Texture2D, position Vector3, width float32, height float32, length float32, color Color)

DrawCubeTexture - Draw cube textured

func DrawCubeV Uses

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

DrawCubeV - Draw cube (Vector version)

func DrawCubeWires Uses

func DrawCubeWires(position Vector3, width float32, height float32, length float32, color Color)

DrawCubeWires - Draw cube wires

func DrawCylinder Uses

func DrawCylinder(position Vector3, radiusTop float32, radiusBottom float32, height float32, slices int32, color Color)

DrawCylinder - Draw a cylinder/cone

func DrawCylinderWires Uses

func DrawCylinderWires(position Vector3, radiusTop float32, radiusBottom float32, height float32, slices int32, color Color)

DrawCylinderWires - Draw a cylinder/cone wires

func DrawFPS Uses

func DrawFPS(posX int32, posY int32)

DrawFPS - Shows current FPS

func DrawGizmo Uses

func DrawGizmo(position Vector3)

DrawGizmo - Draw simple gizmo

func DrawGrid Uses

func DrawGrid(slices int32, spacing float32)

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

func DrawLine Uses

func DrawLine(startPosX, startPosY, endPosX, endPosY int32, color Color)

DrawLine - Draw a line

func DrawLine3D Uses

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

DrawLine3D - Draw a line in 3D world space

func DrawLineBezier Uses

func DrawLineBezier(startPos, endPos Vector2, thick float32, color Color)

DrawLineBezier - Draw a line using cubic-bezier curves in-out

func DrawLineEx Uses

func DrawLineEx(startPos, endPos Vector2, thick float32, color Color)

DrawLineEx - Draw a line defining thickness

func DrawLineV Uses

func DrawLineV(startPos, endPos Vector2, color Color)

DrawLineV - Draw a line (Vector version)

func DrawModel Uses

func DrawModel(model Model, position Vector3, scale float32, tint Color)

DrawModel - Draw a model (with texture if set)

func DrawModelEx Uses

func DrawModelEx(model Model, position Vector3, rotationAxis Vector3, rotationAngle float32, scale Vector3, tint Color)

DrawModelEx - Draw a model with extended parameters

func DrawModelWires Uses

func DrawModelWires(model Model, position Vector3, scale float32, tint Color)

DrawModelWires - Draw a model wires (with texture if set)

func DrawModelWiresEx Uses

func DrawModelWiresEx(model Model, position Vector3, rotationAxis Vector3, rotationAngle float32, scale Vector3, tint Color)

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

func DrawPixel Uses

func DrawPixel(posX, posY int32, color Color)

DrawPixel - Draw a pixel

func DrawPixelV Uses

func DrawPixelV(position Vector2, color Color)

DrawPixelV - Draw a pixel (Vector version)

func DrawPlane Uses

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

DrawPlane - Draw a plane XZ

func DrawPoly Uses

func DrawPoly(center Vector2, sides int32, radius, rotation float32, color Color)

DrawPoly - Draw a regular polygon (Vector version)

func DrawPolyEx Uses

func DrawPolyEx(points []Vector2, numPoints int32, color Color)

DrawPolyEx - Draw a closed polygon defined by points

func DrawPolyExLines Uses

func DrawPolyExLines(points []Vector2, numPoints int32, color Color)

DrawPolyExLines - Draw polygon lines

func DrawRay Uses

func DrawRay(ray Ray, color Color)

DrawRay - Draw a ray line

func DrawRectangle Uses

func DrawRectangle(posX, posY, width, height int32, color Color)

DrawRectangle - Draw a color-filled rectangle

func DrawRectangleGradientEx Uses

func DrawRectangleGradientEx(rec Rectangle, color1, color2, color3, color4 Color)

DrawRectangleGradientEx - Draw a gradient-filled rectangle with custom vertex colors

func DrawRectangleGradientH Uses

func DrawRectangleGradientH(posX, posY, width, height int32, color1, color2 Color)

DrawRectangleGradientH - Draw a horizontal-gradient-filled rectangle

func DrawRectangleGradientV Uses

func DrawRectangleGradientV(posX, posY, width, height int32, color1, color2 Color)

DrawRectangleGradientV - Draw a vertical-gradient-filled rectangle

func DrawRectangleLines Uses

func DrawRectangleLines(posX, posY, width, height int32, color Color)

DrawRectangleLines - Draw rectangle outline

func DrawRectangleLinesEx Uses

func DrawRectangleLinesEx(rec Rectangle, lineThick int32, color Color)

DrawRectangleLinesEx - Draw rectangle outline with extended parameters

func DrawRectanglePro Uses

func DrawRectanglePro(rec Rectangle, origin Vector2, rotation float32, colors []Color)

DrawRectanglePro - Draw a color-filled rectangle with pro parameters

func DrawRectangleRec Uses

func DrawRectangleRec(rec Rectangle, color Color)

DrawRectangleRec - Draw a color-filled rectangle

func DrawRectangleV Uses

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

DrawRectangleV - Draw a color-filled rectangle (Vector version)

func DrawSphere Uses

func DrawSphere(centerPos Vector3, radius float32, color Color)

DrawSphere - Draw sphere

func DrawSphereEx Uses

func DrawSphereEx(centerPos Vector3, radius float32, rings int32, slices int32, color Color)

DrawSphereEx - Draw sphere with extended parameters

func DrawSphereWires Uses

func DrawSphereWires(centerPos Vector3, radius float32, rings int32, slices int32, color Color)

DrawSphereWires - Draw sphere wires

func DrawText Uses

func DrawText(text string, posX int32, posY int32, fontSize int32, color Color)

DrawText - Draw text (using default font)

func DrawTextEx Uses

func DrawTextEx(font Font, text string, position Vector2, fontSize float32, spacing float32, tint Color)

DrawTextEx - Draw text using Font and additional parameters

func DrawTexture Uses

func DrawTexture(texture Texture2D, posX int32, posY int32, tint Color)

DrawTexture - Draw a Texture2D

func DrawTextureEx Uses

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

DrawTextureEx - Draw a Texture2D with extended parameters

func DrawTexturePro Uses

func DrawTexturePro(texture Texture2D, sourceRec, destRec Rectangle, origin Vector2, rotation float32, tint Color)

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

func DrawTextureRec Uses

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

DrawTextureRec - Draw a part of a texture defined by a rectangle

func DrawTextureV Uses

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

DrawTextureV - Draw a Texture2D with position defined as Vector2

func DrawTriangle Uses

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

DrawTriangle - Draw a color-filled triangle

func DrawTriangleLines Uses

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

DrawTriangleLines - Draw triangle outline

func EnableCursor Uses

func EnableCursor()

EnableCursor - Enables cursor

func EndBlendMode Uses

func EndBlendMode()

EndBlendMode - End blending mode (reset to default: alpha blending)

func EndDrawing Uses

func EndDrawing()

EndDrawing - End canvas drawing and Swap Buffers (Double Buffering)

func EndMode2D Uses

func EndMode2D()

EndMode2D - Ends 2D mode custom camera usage

func EndMode3D Uses

func EndMode3D()

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

func EndShaderMode Uses

func EndShaderMode()

EndShaderMode - End custom shader drawing (use default shader)

func EndTextureMode Uses

func EndTextureMode()

EndTextureMode - Ends drawing to render texture

func EndVrDrawing Uses

func EndVrDrawing()

EndVrDrawing - End VR simulator stereo rendering

func ExportImage Uses

func ExportImage(image Image, name string)

ExportImage - Export image as a PNG file

func ExportMesh Uses

func ExportMesh(mesh Mesh, fileName string)

ExportMesh - Export mesh as an OBJ file

func ExportWave Uses

func ExportWave(wave Wave, fileName string)

ExportWave - Export wave data to file

func GenTextureMipmaps Uses

func GenTextureMipmaps(texture *Texture2D)

GenTextureMipmaps - Generate GPU mipmaps for a texture

func GetDroppedFiles Uses

func GetDroppedFiles(count *int32) []string

GetDroppedFiles - Retrieve dropped files into window

func GetFPS Uses

func GetFPS() float32

GetFPS - Returns current FPS

func GetFrameTime Uses

func GetFrameTime() float32

GetFrameTime - Returns time in seconds for one frame

func GetGamepadAxisCount Uses

func GetGamepadAxisCount(gamepad int32) int32

GetGamepadAxisCount - Return gamepad axis count for a gamepad

func GetGamepadAxisMovement Uses

func GetGamepadAxisMovement(gamepad, axis int32) float32

GetGamepadAxisMovement - Return axis movement value for a gamepad axis

func GetGamepadButtonPressed Uses

func GetGamepadButtonPressed() int32

GetGamepadButtonPressed - Get the last gamepad button pressed

func GetGamepadName Uses

func GetGamepadName(gamepad int32) string

GetGamepadName - Return gamepad internal name id

func GetGestureDragAngle Uses

func GetGestureDragAngle() float32

GetGestureDragAngle - Get gesture drag angle

func GetGestureHoldDuration Uses

func GetGestureHoldDuration() float32

GetGestureHoldDuration - Get gesture hold time in milliseconds

func GetGesturePinchAngle Uses

func GetGesturePinchAngle() float32

GetGesturePinchAngle - Get gesture pinch angle

func GetKeyPressed Uses

func GetKeyPressed() int32

GetKeyPressed - Get latest key pressed

func GetMonitorCount Uses

func GetMonitorCount() int

GetMonitorCount - Get number of connected monitors

func GetMonitorHeight Uses

func GetMonitorHeight(monitor int) int

GetMonitorHeight - Get primary monitor height

func GetMonitorName Uses

func GetMonitorName(monitor int) string

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

func GetMonitorPhysicalHeight Uses

func GetMonitorPhysicalHeight(monitor int) int

GetMonitorPhysicalHeight - Get primary monitor physical height in millimetres

func GetMonitorPhysicalWidth Uses

func GetMonitorPhysicalWidth(monitor int) int

GetMonitorPhysicalWidth - Get primary monitor physical width in millimetres

func GetMonitorWidth Uses

func GetMonitorWidth(monitor int) int

GetMonitorWidth - Get primary monitor width

func GetMouseWheelMove Uses

func GetMouseWheelMove() int32

GetMouseWheelMove - Returns mouse wheel movement Y

func GetMouseX Uses

func GetMouseX() int32

GetMouseX - Returns mouse position X

func GetMouseY Uses

func GetMouseY() int32

GetMouseY - Returns mouse position Y

func GetMusicTimeLength Uses

func GetMusicTimeLength(music Music) float32

GetMusicTimeLength - Get music time length (in seconds)

func GetMusicTimePlayed Uses

func GetMusicTimePlayed(music Music) float32

GetMusicTimePlayed - Get current music time played (in seconds)

func GetPixelDataSize Uses

func GetPixelDataSize(width, height, format int32) int32

GetPixelDataSize - Get pixel data size in bytes (image or texture)

func GetRandomValue Uses

func GetRandomValue(min, max int32) int32

GetRandomValue - Returns a random value between min and max (both included)

func GetScreenHeight Uses

func GetScreenHeight() int

GetScreenHeight - Get current screen height

func GetScreenWidth Uses

func GetScreenWidth() int

GetScreenWidth - Get current screen width

func GetShaderLocation Uses

func GetShaderLocation(shader Shader, uniformName string) int32

GetShaderLocation - Get shader uniform location

func GetTime Uses

func GetTime() float32

GetTime - Return time in seconds

func GetTouchPointsCount Uses

func GetTouchPointsCount() int32

GetTouchPointsCount - Get touch points count

func GetTouchX Uses

func GetTouchX() int32

GetTouchX - Returns touch position X for touch point 0 (relative to screen size)

func GetTouchY Uses

func GetTouchY() int32

GetTouchY - Returns touch position Y for touch point 0 (relative to screen size)

func GetWaveData Uses

func GetWaveData(wave Wave) []float32

GetWaveData - Get samples data from wave as a floats array

func HideCursor Uses

func HideCursor()

HideCursor - Hides cursor

func HomeDir Uses

func HomeDir() string

HomeDir - Returns user home directory

func ImageAlphaClear Uses

func ImageAlphaClear(image *Image, color Color, threshold float32)

ImageAlphaClear - Apply alpha mask to image

func ImageAlphaCrop Uses

func ImageAlphaCrop(image *Image, threshold float32)

ImageAlphaCrop - Crop image depending on alpha value

func ImageAlphaMask Uses

func ImageAlphaMask(image, alphaMask *Image)

ImageAlphaMask - Apply alpha mask to image

func ImageAlphaPremultiply Uses

func ImageAlphaPremultiply(image *Image)

ImageAlphaPremultiply - Premultiply alpha channel

func ImageColorBrightness Uses

func ImageColorBrightness(image *Image, brightness int32)

ImageColorBrightness - Modify image color: brightness (-255 to 255)

func ImageColorContrast Uses

func ImageColorContrast(image *Image, contrast float32)

ImageColorContrast - Modify image color: contrast (-100 to 100)

func ImageColorGrayscale Uses

func ImageColorGrayscale(image *Image)

ImageColorGrayscale - Modify image color: grayscale

func ImageColorInvert Uses

func ImageColorInvert(image *Image)

ImageColorInvert - Modify image color: invert

func ImageColorReplace Uses

func ImageColorReplace(image *Image, color, replace Color)

ImageColorReplace - Modify image color: replace color

func ImageColorTint Uses

func ImageColorTint(image *Image, color Color)

ImageColorTint - Modify image color: tint

func ImageCrop Uses

func ImageCrop(image *Image, crop Rectangle)

ImageCrop - Crop an image to a defined rectangle

func ImageDither Uses

func ImageDither(image *Image, rBpp, gBpp, bBpp, aBpp int32)

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

func ImageDraw Uses

func ImageDraw(dst, src *Image, srcRec, dstRec Rectangle)

ImageDraw - Draw a source image within a destination image

func ImageDrawRectangle Uses

func ImageDrawRectangle(dst *Image, rec Rectangle, color Color)

ImageDrawRectangle - Draw rectangle within an image

func ImageDrawRectangleLines Uses

func ImageDrawRectangleLines(dst *Image, rec Rectangle, thick int, color Color)

ImageDrawRectangleLines - Draw rectangle lines within an image

func ImageDrawText Uses

func ImageDrawText(dst *Image, position Vector2, text string, fontSize int32, color Color)

ImageDrawText - Draw text (default font) within an image (destination)

func ImageDrawTextEx Uses

func ImageDrawTextEx(dst *Image, position Vector2, font Font, text string, fontSize, spacing float32, color Color)

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

func ImageFlipHorizontal Uses

func ImageFlipHorizontal(image *Image)

ImageFlipHorizontal - Flip image horizontally

func ImageFlipVertical Uses

func ImageFlipVertical(image *Image)

ImageFlipVertical - Flip image vertically

func ImageFormat Uses

func ImageFormat(image *Image, newFormat PixelFormat)

ImageFormat - Convert image data to desired format

func ImageMipmaps Uses

func ImageMipmaps(image *Image)

ImageMipmaps - Generate all mipmap levels for a provided image

func ImageResize Uses

func ImageResize(image *Image, newWidth, newHeight int32)

ImageResize - Resize an image (bilinear filtering)

func ImageResizeCanvas Uses

func ImageResizeCanvas(image *Image, newWidth, newHeight, offsetX, offsetY int32, color Color)

ImageResizeCanvas - Resize canvas and fill with color

func ImageResizeNN Uses

func ImageResizeNN(image *Image, newWidth, newHeight int32)

ImageResizeNN - Resize an image (Nearest-Neighbor scaling algorithm)

func ImageRotateCCW Uses

func ImageRotateCCW(image *Image)

ImageRotateCCW - Rotate image counter-clockwise 90deg

func ImageRotateCW Uses

func ImageRotateCW(image *Image)

ImageRotateCW - Rotate image clockwise 90deg

func ImageToPOT Uses

func ImageToPOT(image *Image, fillColor Color)

ImageToPOT - Convert image to POT (power-of-two)

func InitAudioDevice Uses

func InitAudioDevice()

InitAudioDevice - Initialize audio device and context

func InitVrSimulator Uses

func InitVrSimulator(vrDeviceInfo VrDeviceInfo)

InitVrSimulator - Init VR simulator for selected device

func InitWindow Uses

func InitWindow(width int32, height int32, title string)

InitWindow - Initialize Window and OpenGL Graphics

func IsAudioBufferProcessed Uses

func IsAudioBufferProcessed(stream AudioStream) bool

IsAudioBufferProcessed - Check if any audio stream buffers requires refill

func IsAudioDeviceReady Uses

func IsAudioDeviceReady() bool

IsAudioDeviceReady - Check if audio device has been initialized successfully

func IsCursorHidden Uses

func IsCursorHidden() bool

IsCursorHidden - Returns true if cursor is not visible

func IsFileDropped Uses

func IsFileDropped() bool

IsFileDropped - Check if a file have been dropped into window

func IsGamepadAvailable Uses

func IsGamepadAvailable(gamepad int32) bool

IsGamepadAvailable - Detect if a gamepad is available

func IsGamepadButtonDown Uses

func IsGamepadButtonDown(gamepad, button int32) bool

IsGamepadButtonDown - Detect if a gamepad button is being pressed

func IsGamepadButtonPressed Uses

func IsGamepadButtonPressed(gamepad, button int32) bool

IsGamepadButtonPressed - Detect if a gamepad button has been pressed once

func IsGamepadButtonReleased Uses

func IsGamepadButtonReleased(gamepad, button int32) bool

IsGamepadButtonReleased - Detect if a gamepad button has been released once

func IsGamepadButtonUp Uses

func IsGamepadButtonUp(gamepad, button int32) bool

IsGamepadButtonUp - Detect if a gamepad button is NOT being pressed

func IsGamepadName Uses

func IsGamepadName(gamepad int32, name string) bool

IsGamepadName - Check gamepad name (if available)

func IsGestureDetected Uses

func IsGestureDetected(gesture Gestures) bool

IsGestureDetected - Check if a gesture have been detected

func IsKeyDown Uses

func IsKeyDown(key int32) bool

IsKeyDown - Detect if a key is being pressed

func IsKeyPressed Uses

func IsKeyPressed(key int32) bool

IsKeyPressed - Detect if a key has been pressed once

func IsKeyReleased Uses

func IsKeyReleased(key int32) bool

IsKeyReleased - Detect if a key has been released once

func IsKeyUp Uses

func IsKeyUp(key int32) bool

IsKeyUp - Detect if a key is NOT being pressed

func IsMouseButtonDown Uses

func IsMouseButtonDown(button int32) bool

IsMouseButtonDown - Detect if a mouse button is being pressed

func IsMouseButtonPressed Uses

func IsMouseButtonPressed(button int32) bool

IsMouseButtonPressed - Detect if a mouse button has been pressed once

func IsMouseButtonReleased Uses

func IsMouseButtonReleased(button int32) bool

IsMouseButtonReleased - Detect if a mouse button has been released once

func IsMouseButtonUp Uses

func IsMouseButtonUp(button int32) bool

IsMouseButtonUp - Detect if a mouse button is NOT being pressed

func IsMusicPlaying Uses

func IsMusicPlaying(music Music) bool

IsMusicPlaying - Check if music is playing

func IsSoundPlaying Uses

func IsSoundPlaying(sound Sound) bool

IsSoundPlaying - Check if a sound is currently playing

func IsVrSimulatorReady Uses

func IsVrSimulatorReady() bool

IsVrSimulatorReady - Detect if VR simulator is ready

func IsWindowMinimized Uses

func IsWindowMinimized() bool

IsWindowMinimized - Detect if window has been minimized (or lost focus)

func IsWindowReady Uses

func IsWindowReady() bool

IsWindowReady - Check if window has been initialized successfully

func MatrixToFloat Uses

func MatrixToFloat(mat Matrix) []float32

MatrixToFloat - Converts Matrix to float32 slice

func MeasureText Uses

func MeasureText(text string, fontSize int32) int32

MeasureText - Measure string width for default font

func PauseAudioStream Uses

func PauseAudioStream(stream AudioStream)

PauseAudioStream - Pause audio stream

func PauseMusicStream Uses

func PauseMusicStream(music Music)

PauseMusicStream - Pause music playing

func PauseSound Uses

func PauseSound(sound Sound)

PauseSound - Pause a sound

func PlayAudioStream Uses

func PlayAudioStream(stream AudioStream)

PlayAudioStream - Play audio stream

func PlayMusicStream Uses

func PlayMusicStream(music Music)

PlayMusicStream - Start music playing

func PlaySound Uses

func PlaySound(sound Sound)

PlaySound - Play a sound

func ResumeAudioStream Uses

func ResumeAudioStream(stream AudioStream)

ResumeAudioStream - Resume audio stream

func ResumeMusicStream Uses

func ResumeMusicStream(music Music)

ResumeMusicStream - Resume playing paused music

func ResumeSound Uses

func ResumeSound(sound Sound)

ResumeSound - Resume a paused sound

func SetCallbackFunc Uses

func SetCallbackFunc(func())

SetCallbackFunc - Sets callback function

func SetCameraAltControl Uses

func SetCameraAltControl(altKey int32)

SetCameraAltControl - Set camera alt key to combine with mouse movement (free camera)

func SetCameraMode Uses

func SetCameraMode(camera Camera, mode CameraMode)

SetCameraMode - Set camera mode (multiple camera modes available)

func SetCameraMoveControls Uses

func SetCameraMoveControls(frontKey int32, backKey int32, rightKey int32, leftKey int32, upKey int32, downKey int32)

SetCameraMoveControls - Set camera move controls (1st person and 3rd person cameras)

func SetCameraPanControl Uses

func SetCameraPanControl(panKey int32)

SetCameraPanControl - Set camera pan key to combine with mouse movement (free camera)

func SetCameraSmoothZoomControl Uses

func SetCameraSmoothZoomControl(szKey int32)

SetCameraSmoothZoomControl - Set camera smooth zoom key to combine with mouse (free camera)

func SetConfigFlags Uses

func SetConfigFlags(flags byte)

SetConfigFlags - Setup some window configuration flags

func SetExitKey Uses

func SetExitKey(key int32)

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

func SetGesturesEnabled Uses

func SetGesturesEnabled(gestureFlags uint32)

SetGesturesEnabled - Enable a set of gestures using flags

func SetMasterVolume Uses

func SetMasterVolume(volume float32)

SetMasterVolume - Set master volume (listener)

func SetMatrixModelview Uses

func SetMatrixModelview(view Matrix)

SetMatrixModelview - Set a custom modelview matrix (replaces internal modelview matrix)

func SetMatrixProjection Uses

func SetMatrixProjection(proj Matrix)

SetMatrixProjection - Set a custom projection matrix (replaces internal projection matrix)

func SetMousePosition Uses

func SetMousePosition(position Vector2)

SetMousePosition - Set mouse position XY

func SetMouseScale Uses

func SetMouseScale(scale float32)

SetMouseScale - Set mouse scaling

func SetMusicLoopCount Uses

func SetMusicLoopCount(music Music, count int32)

SetMusicLoopCount - Set music loop count (loop repeats) NOTE: If set to -1, means infinite loop

func SetMusicPitch Uses

func SetMusicPitch(music Music, pitch float32)

SetMusicPitch - Set pitch for a music (1.0 is base level)

func SetMusicVolume Uses

func SetMusicVolume(music Music, volume float32)

SetMusicVolume - Set volume for music (1.0 is max level)

func SetShaderValue Uses

func SetShaderValue(shader Shader, uniformLoc int32, value []float32, size int32)

SetShaderValue - Set shader uniform value (float)

func SetShaderValueMatrix Uses

func SetShaderValueMatrix(shader Shader, uniformLoc int32, mat Matrix)

SetShaderValueMatrix - Set shader uniform value (matrix 4x4)

func SetShaderValuei Uses

func SetShaderValuei(shader Shader, uniformLoc int32, value []int32, size int32)

SetShaderValuei - Set shader uniform value (int)

func SetShapesTexture Uses

func SetShapesTexture(texture Texture2D, source Rectangle)

SetShapesTexture - Define default texture used to draw shapes

func SetSoundPitch Uses

func SetSoundPitch(sound Sound, pitch float32)

SetSoundPitch - Set pitch for a sound (1.0 is base level)

func SetSoundVolume Uses

func SetSoundVolume(sound Sound, volume float32)

SetSoundVolume - Set volume for a sound (1.0 is max level)

func SetTargetFPS Uses

func SetTargetFPS(fps int32)

SetTargetFPS - Set target FPS (maximum)

func SetTextureFilter Uses

func SetTextureFilter(texture Texture2D, filterMode TextureFilterMode)

SetTextureFilter - Set texture scaling filter mode

func SetTextureWrap Uses

func SetTextureWrap(texture Texture2D, wrapMode TextureWrapMode)

SetTextureWrap - Set texture wrapping mode

func SetTraceLog Uses

func SetTraceLog(typeFlags int)

SetTraceLog - Enable trace log message types (bit flags based)

func SetWindowIcon Uses

func SetWindowIcon(image Image)

SetWindowIcon - Set icon for window (only PLATFORM_DESKTOP)

func SetWindowMinSize Uses

func SetWindowMinSize(w, h int)

SetWindowMinSize - Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)

func SetWindowMonitor Uses

func SetWindowMonitor(monitor int)

SetWindowMonitor - Set monitor for the current window (fullscreen mode)

func SetWindowPosition Uses

func SetWindowPosition(x, y int)

SetWindowPosition - Set window position on screen (only PLATFORM_DESKTOP)

func SetWindowSize Uses

func SetWindowSize(w, h int)

SetWindowSize - Set window dimensions

func SetWindowTitle Uses

func SetWindowTitle(title string)

SetWindowTitle - Set title for window (only PLATFORM_DESKTOP)

func ShowCursor Uses

func ShowCursor()

ShowCursor - Shows cursor

func ShowLogo()

ShowLogo - Activates raylib logo at startup (can be done with flags)

func StopAudioStream Uses

func StopAudioStream(stream AudioStream)

StopAudioStream - Stop audio stream

func StopMusicStream Uses

func StopMusicStream(music Music)

StopMusicStream - Stop music playing

func StopSound Uses

func StopSound(sound Sound)

StopSound - Stop playing a sound

func StorageLoadValue Uses

func StorageLoadValue(position int32) int32

StorageLoadValue - Storage load integer value (from defined position)

func StorageSaveValue Uses

func StorageSaveValue(position, value int32)

StorageSaveValue - Storage save integer value (to defined position)

func TakeScreenshot Uses

func TakeScreenshot(name string)

TakeScreenshot - Takes a screenshot of current screen (saved a .png)

func ToggleFullscreen Uses

func ToggleFullscreen()

ToggleFullscreen - Fullscreen toggle (only PLATFORM_DESKTOP)

func ToggleVrMode Uses

func ToggleVrMode()

ToggleVrMode - Enable/Disable VR experience (device or simulator)

func TraceLog Uses

func TraceLog(msgType int, text string, v ...interface{})

TraceLog - Show trace log messages (INFO, WARNING, ERROR, DEBUG)

func UnloadFont Uses

func UnloadFont(font Font)

UnloadFont - Unload Font from GPU memory (VRAM)

func UnloadImage Uses

func UnloadImage(image *Image)

UnloadImage - Unload image from CPU memory (RAM)

func UnloadMaterial Uses

func UnloadMaterial(material Material)

UnloadMaterial - Unload material textures from VRAM

func UnloadMesh Uses

func UnloadMesh(mesh *Mesh)

UnloadMesh - Unload mesh from memory (RAM and/or VRAM)

func UnloadModel Uses

func UnloadModel(model Model)

UnloadModel - Unload model from memory (RAM and/or VRAM)

func UnloadMusicStream Uses

func UnloadMusicStream(music Music)

UnloadMusicStream - Unload music stream

func UnloadRenderTexture Uses

func UnloadRenderTexture(target RenderTexture2D)

UnloadRenderTexture - Unload render texture from GPU memory

func UnloadShader Uses

func UnloadShader(shader Shader)

UnloadShader - Unload a custom shader from memory

func UnloadSound Uses

func UnloadSound(sound Sound)

UnloadSound - Unload sound

func UnloadTexture Uses

func UnloadTexture(texture Texture2D)

UnloadTexture - Unload texture from GPU memory

func UnloadWave Uses

func UnloadWave(wave Wave)

UnloadWave - Unload wave data

func UpdateAudioStream Uses

func UpdateAudioStream(stream AudioStream, data []float32, samplesCount int32)

UpdateAudioStream - Update audio stream buffers with data

func UpdateCamera Uses

func UpdateCamera(camera *Camera)

UpdateCamera - Update camera position for selected mode

func UpdateMusicStream Uses

func UpdateMusicStream(music Music)

UpdateMusicStream - Updates buffers for music streaming

func UpdateSound Uses

func UpdateSound(sound Sound, data []byte, samplesCount int32)

UpdateSound - Update sound buffer with new data

func UpdateTexture Uses

func UpdateTexture(texture Texture2D, pixels []Color)

UpdateTexture - Update GPU texture with new data

func UpdateVrTracking Uses

func UpdateVrTracking(camera *Camera)

UpdateVrTracking - Update VR tracking (position and orientation) and camera

func Vector3ToFloat Uses

func Vector3ToFloat(vec Vector3) []float32

Vector3ToFloat - Converts Vector3 to float32 slice

func WaveCrop Uses

func WaveCrop(wave Wave, initSample int32, finalSample int32)

WaveCrop - Crop a wave to defined samples range

func WaveFormat Uses

func WaveFormat(wave Wave, sampleRate int32, sampleSize int32, channels int32)

WaveFormat - Convert wave data to desired format

func WindowShouldClose Uses

func WindowShouldClose() bool

WindowShouldClose - Detect if KEY_ESCAPE pressed or Close icon pressed

type Asset Uses

type Asset interface {
    io.ReadSeeker
    io.Closer
}

Asset file

func OpenAsset Uses

func OpenAsset(name string) (Asset, error)

OpenAsset - Open asset

type AudioStream Uses

type AudioStream struct {
    // Frequency (samples per second)
    SampleRate uint32
    // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
    SampleSize uint32
    // Number of channels (1-mono, 2-stereo)
    Channels uint32
    // Audio format specifier
    Format int32
    // Audio source id
    Source uint32
    // Audio buffers (double buffering)
    Buffers [2]uint32
}

AudioStream type NOTE: Useful to create custom audio streams not bound to a specific file

func InitAudioStream Uses

func InitAudioStream(sampleRate uint32, sampleSize uint32, channels uint32) AudioStream

InitAudioStream - Init audio stream (to stream raw audio pcm data)

func NewAudioStream Uses

func NewAudioStream(sampleRate, sampleSize, channels uint32, format int32, source uint32, buffers [2]uint32) AudioStream

NewAudioStream - Returns new AudioStream

type BlendMode Uses

type BlendMode int32

BlendMode type

const (
    BlendAlpha BlendMode = iota
    BlendAdditive
    BlendMultiplied
)

Color blending modes (pre-defined)

type BoundingBox Uses

type BoundingBox struct {
    // Minimum vertex box-corner
    Min Vector3
    // Maximum vertex box-corner
    Max Vector3
}

BoundingBox type

func MeshBoundingBox Uses

func MeshBoundingBox(mesh Mesh) BoundingBox

MeshBoundingBox - Compute mesh bounding box limits

func NewBoundingBox Uses

func NewBoundingBox(min, max Vector3) BoundingBox

NewBoundingBox - Returns new BoundingBox

type Camera Uses

type Camera = Camera3D

Camera type fallback, defaults to Camera3D

type Camera2D Uses

type Camera2D struct {
    // Camera offset (displacement from target)
    Offset Vector2
    // Camera target (rotation and zoom origin)
    Target Vector2
    // Camera rotation in degrees
    Rotation float32
    // Camera zoom (scaling), should be 1.0f by default
    Zoom float32
}

Camera2D type, defines a 2d camera

func NewCamera2D Uses

func NewCamera2D(offset, target Vector2, rotation, zoom float32) Camera2D

NewCamera2D - Returns new Camera2D

type Camera3D Uses

type Camera3D struct {
    // Camera position
    Position Vector3
    // Camera target it looks-at
    Target Vector3
    // Camera up vector (rotation over its axis)
    Up  Vector3
    // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
    Fovy float32
    // Camera type, controlling projection type, either CameraPerspective or CameraOrthographic.
    Type CameraType
}

Camera3D type, defines a camera position/orientation in 3d space

func NewCamera3D Uses

func NewCamera3D(pos, target, up Vector3, fovy float32, ct CameraType) Camera3D

NewCamera3D - Returns new Camera3D

type CameraMode Uses

type CameraMode int32

CameraMode type

const (
    CameraCustom CameraMode = iota
    CameraFree
    CameraOrbital
    CameraFirstPerson
    CameraThirdPerson
)

Camera system modes

type CameraType Uses

type CameraType int32

CameraType type

const (
    CameraPerspective CameraType = iota
    CameraOrthographic
)

Camera projection modes

type CharInfo Uses

type CharInfo struct {
    // Character value (Unicode)
    Value int32
    // Character rectangle in sprite font
    Rec Rectangle
    // Character offset X when drawing
    OffsetX int32
    // Character offset Y when drawing
    OffsetY int32
    // Character advance position X
    AdvanceX int32
}

CharInfo - Font character info

func NewCharInfo Uses

func NewCharInfo(value int32, rec Rectangle, offsetX, offsetY, advanceX int32) CharInfo

NewCharInfo - Returns new CharInfo

type Color Uses

type Color struct {
    R   uint8
    G   uint8
    B   uint8
    A   uint8
}

Color type, RGBA (32bit)

func Fade Uses

func Fade(color Color, alpha float32) Color

Fade - Color fade-in or fade-out, alpha goes from 0.0f to 1.0f

func GetColor Uses

func GetColor(hexValue int32) Color

GetColor - Returns a Color struct from hexadecimal value

func GetImageData Uses

func GetImageData(img *Image) []Color

GetImageData - Get pixel data from image as a Color slice

func NewColor Uses

func NewColor(r, g, b, a uint8) Color

NewColor - Returns new Color

type Font Uses

type Font struct {
    // Font texture
    Texture Texture2D
    // Base size (default chars height)
    BaseSize int32
    // Number of characters
    CharsCount int32
    // Characters info data
    Chars *CharInfo
}

Font type, includes texture and charSet array data

func GetFontDefault Uses

func GetFontDefault() Font

GetFontDefault - Get the default Font

func LoadFont Uses

func LoadFont(fileName string) Font

LoadFont - Load a Font image into GPU memory (VRAM)

func LoadFontEx Uses

func LoadFontEx(fileName string, fontSize int32, charsCount int32, fontChars *int32) Font

LoadFontEx - Load Font from file with extended parameters

func NewFont Uses

func NewFont(texture Texture2D, baseSize, charsCount int32, chars *CharInfo) Font

NewFont - Returns new Font

type Gestures Uses

type Gestures int32

Gestures type

const (
    GestureNone       Gestures = 0
    GestureTap        Gestures = 1
    GestureDoubletap  Gestures = 2
    GestureHold       Gestures = 4
    GestureDrag       Gestures = 8
    GestureSwipeRight Gestures = 16
    GestureSwipeLeft  Gestures = 32
    GestureSwipeUp    Gestures = 64
    GestureSwipeDown  Gestures = 128
    GesturePinchIn    Gestures = 256
    GesturePinchOut   Gestures = 512
)

Gestures types NOTE: It could be used as flags to enable only some gestures

func GetGestureDetected Uses

func GetGestureDetected() Gestures

GetGestureDetected - Get latest detected gesture

type Image Uses

type Image struct {

    // Image base width
    Width int32
    // Image base height
    Height int32
    // Mipmap levels, 1 by default
    Mipmaps int32
    // Data format (PixelFormat)
    Format PixelFormat
    // contains filtered or unexported fields
}

Image type, bpp always RGBA (32bit) NOTE: Data stored in CPU memory (RAM)

func GenImageCellular Uses

func GenImageCellular(width, height, tileSize int) *Image

GenImageCellular - Generate image: cellular algorithm. Bigger tileSize means bigger cells

func GenImageChecked Uses

func GenImageChecked(width, height, checksX, checksY int, col1, col2 Color) *Image

GenImageChecked - Generate image: checked

func GenImageColor Uses

func GenImageColor(width, height int, color Color) *Image

GenImageColor - Generate image: plain color

func GenImageGradientH Uses

func GenImageGradientH(width, height int, left, right Color) *Image

GenImageGradientH - Generate image: horizontal gradient

func GenImageGradientRadial Uses

func GenImageGradientRadial(width, height int, density float32, inner, outer Color) *Image

GenImageGradientRadial - Generate image: radial gradient

func GenImageGradientV Uses

func GenImageGradientV(width, height int, top, bottom Color) *Image

GenImageGradientV - Generate image: vertical gradient

func GenImagePerlinNoise Uses

func GenImagePerlinNoise(width, height, offsetX, offsetY int, scale float32) *Image

GenImagePerlinNoise - Generate image: perlin noise

func GenImageWhiteNoise Uses

func GenImageWhiteNoise(width, height int, factor float32) *Image

GenImageWhiteNoise - Generate image: white noise

func GetTextureData Uses

func GetTextureData(texture Texture2D) *Image

GetTextureData - Get pixel data from GPU texture and return an Image

func ImageCopy Uses

func ImageCopy(image *Image) *Image

ImageCopy - Create an image duplicate (useful for transformations)

func ImageText Uses

func ImageText(text string, fontSize int32, color Color) *Image

ImageText - Create an image from text (default font)

func ImageTextEx Uses

func ImageTextEx(font Font, text string, fontSize, spacing float32, tint Color) *Image

ImageTextEx - Create an image from text (custom sprite font)

func LoadImage Uses

func LoadImage(fileName string) *Image

LoadImage - Load an image into CPU memory (RAM)

func LoadImageEx Uses

func LoadImageEx(pixels []Color, width, height int32) *Image

LoadImageEx - Load image data from Color array data (RGBA - 32bit)

func LoadImagePro Uses

func LoadImagePro(data []byte, width, height int32, format PixelFormat) *Image

LoadImagePro - Load image from raw data with parameters

func LoadImageRaw Uses

func LoadImageRaw(fileName string, width, height int32, format PixelFormat, headerSize int32) *Image

LoadImageRaw - Load image data from RAW file

func NewImage Uses

func NewImage(data []byte, width, height, mipmaps int32, format PixelFormat) *Image

NewImage - Returns new Image

func NewImageFromImage Uses

func NewImageFromImage(img image.Image) *Image

NewImageFromImage - Returns new Image from Go image.Image

func (*Image) ToImage Uses

func (i *Image) ToImage() image.Image

ToImage converts a Image to Go image.Image

type Mat2 Uses

type Mat2 struct {
    M00 float32
    M01 float32
    M10 float32
    M11 float32
}

Mat2 type (used for polygon shape rotation matrix)

func NewMat2 Uses

func NewMat2(m0, m1, m10, m11 float32) Mat2

NewMat2 - Returns new Mat2

type Material Uses

type Material struct {
    // Shader
    Shader Shader
    // Maps
    Maps [MaxMaterialMaps]MaterialMap

    // Generic parameters (if required)
    Params *[]float32
    // contains filtered or unexported fields
}

Material type

func LoadMaterial Uses

func LoadMaterial(fileName string) Material

LoadMaterial - Load material data (.MTL)

func LoadMaterialDefault Uses

func LoadMaterialDefault() Material

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

func NewMaterial Uses

func NewMaterial(shader Shader, maps [MaxMaterialMaps]MaterialMap, params *[]float32) Material

NewMaterial - Returns new Material

type MaterialMap Uses

type MaterialMap struct {
    // Texture
    Texture Texture2D
    // Color
    Color Color
    // Value
    Value float32
}

MaterialMap type

type Matrix Uses

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

Matrix type (OpenGL style 4x4 - right handed, column major)

func GetCameraMatrix Uses

func GetCameraMatrix(camera Camera) Matrix

GetCameraMatrix - Returns camera transform matrix (view matrix)

func NewMatrix Uses

func NewMatrix(m0, m4, m8, m12, m1, m5, m9, m13, m2, m6, m10, m14, m3, m7, m11, m15 float32) Matrix

NewMatrix - Returns new Matrix

type Mesh Uses

type Mesh struct {
    // Number of vertices stored in arrays
    VertexCount int32
    // Number of triangles stored (indexed or not)
    TriangleCount int32
    // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
    Vertices *[]float32
    // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
    Texcoords *[]float32
    // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
    Texcoords2 *[]float32
    // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
    Normals *[]float32
    // Vertex tangents (XYZ - 3 components per vertex) (shader-location = 4)
    Tangents *[]float32
    // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
    Colors *[]uint8
    // Vertex indices (in case vertex data comes indexed)
    Indices *[]uint16
    // OpenGL Vertex Array Object id
    VaoID uint32
    // OpenGL Vertex Buffer Objects id (7 types of vertex data)
    VboID [7]uint32
}

Mesh - Vertex data definning a mesh

func GenMeshCube Uses

func GenMeshCube(width, height, length float32) Mesh

GenMeshCube - Generate cuboid mesh

func GenMeshCubicmap Uses

func GenMeshCubicmap(cubicmap Image, size Vector3) Mesh

GenMeshCubicmap - Generate cubes-based map mesh from image data

func GenMeshCylinder Uses

func GenMeshCylinder(radius, height float32, slices int) Mesh

GenMeshCylinder - Generate cylinder mesh

func GenMeshHeightmap Uses

func GenMeshHeightmap(heightmap Image, size Vector3) Mesh

GenMeshHeightmap - Generate heightmap mesh from image data

func GenMeshHemiSphere Uses

func GenMeshHemiSphere(radius float32, rings, slices int) Mesh

GenMeshHemiSphere - Generate half-sphere mesh (no bottom cap)

func GenMeshKnot Uses

func GenMeshKnot(radius, size float32, radSeg, sides int) Mesh

GenMeshKnot - Generate trefoil knot mesh

func GenMeshPlane Uses

func GenMeshPlane(width, length float32, resX, resZ int) Mesh

GenMeshPlane - Generate plane mesh (with subdivisions)

func GenMeshSphere Uses

func GenMeshSphere(radius float32, rings, slices int) Mesh

GenMeshSphere - Generate sphere mesh (standard sphere)

func GenMeshTorus Uses

func GenMeshTorus(radius, size float32, radSeg, sides int) Mesh

GenMeshTorus - Generate torus mesh

func LoadMesh Uses

func LoadMesh(fileName string) Mesh

LoadMesh - Load mesh from file

func NewMesh Uses

func NewMesh(vertexCount, triangleCount int32, vertices, texcoords, texcoords2, normals, tangents *[]float32, colors *[]uint8, indices *[]uint16, vaoID uint32, vboID [7]uint32) Mesh

NewMesh - Returns new Mesh

type Model Uses

type Model struct {
    // Vertex data buffers (RAM and VRAM)
    Mesh Mesh
    // Local transform matrix
    Transform Matrix
    // Shader and textures data
    Material Material
    // contains filtered or unexported fields
}

Model type

func LoadModel Uses

func LoadModel(fileName string) Model

LoadModel - Load model from file

func LoadModelFromMesh Uses

func LoadModelFromMesh(data Mesh) Model

LoadModelFromMesh - Load model from mesh data

func NewModel Uses

func NewModel(mesh Mesh, transform Matrix, material Material) Model

NewModel - Returns new Model

type Music Uses

type Music struct {
    CtxType uint32

    Stream       AudioStream
    LoopCount    int32
    TotalSamples uint32
    SamplesLeft  uint32
    // contains filtered or unexported fields
}

Music type (file streaming from memory) NOTE: Anything longer than ~10 seconds should be streamed

func LoadMusicStream Uses

func LoadMusicStream(fileName string) Music

LoadMusicStream - Load music stream from file

type PixelFormat Uses

type PixelFormat int32

PixelFormat - Texture format

const (
    // 8 bit per pixel (no alpha)
    UncompressedGrayscale PixelFormat = iota + 1
    // 8*2 bpp (2 channels)
    UncompressedGrayAlpha
    // 16 bpp
    UncompressedR5g6b5
    // 24 bpp
    UncompressedR8g8b8
    // 16 bpp (1 bit alpha)
    UncompressedR5g5b5a1
    // 16 bpp (4 bit alpha)
    UncompressedR4g4b4a4
    // 32 bpp
    UncompressedR8g8b8a8
    // 32 bpp (1 channel - float)
    UncompressedR32
    // 32*3 bpp (3 channels - float)
    UncompressedR32g32b32
    // 32*4 bpp (4 channels - float)
    UncompressedR32g32b32a32
    // 4 bpp (no alpha)
    CompressedDxt1Rgb
    // 4 bpp (1 bit alpha)
    CompressedDxt1Rgba
    // 8 bpp
    CompressedDxt3Rgba
    // 8 bpp
    CompressedDxt5Rgba
    // 4 bpp
    CompressedEtc1Rgb
    // 4 bpp
    CompressedEtc2Rgb
    // 8 bpp
    CompressedEtc2EacRgba
    // 4 bpp
    CompressedPvrtRgb
    // 4 bpp
    CompressedPvrtRgba
    // 8 bpp
    CompressedAstc4x4Rgba
    // 2 bpp
    CompressedAstc8x8Rgba
)

Texture formats NOTE: Support depends on OpenGL version and platform

type Quaternion Uses

type Quaternion struct {
    X   float32
    Y   float32
    Z   float32
    W   float32
}

Quaternion type

func NewQuaternion Uses

func NewQuaternion(x, y, z, w float32) Quaternion

NewQuaternion - Returns new Quaternion

type Ray Uses

type Ray struct {
    // Ray position (origin)
    Position Vector3
    // Ray direction
    Direction Vector3
}

Ray type (useful for raycast)

func GetMouseRay Uses

func GetMouseRay(mousePosition Vector2, camera Camera) Ray

GetMouseRay - Returns a ray trace from mouse position

func NewRay Uses

func NewRay(position, direction Vector3) Ray

NewRay - Returns new Ray

type Rectangle Uses

type Rectangle struct {
    X      float32
    Y      float32
    Width  float32
    Height float32
}

Rectangle type

func GetCollisionRec Uses

func GetCollisionRec(rec1, rec2 Rectangle) Rectangle

GetCollisionRec - Get collision rectangle for two rectangles collision

func NewRectangle Uses

func NewRectangle(x, y, width, height float32) Rectangle

NewRectangle - Returns new Rectangle

func (*Rectangle) ToInt32 Uses

func (r *Rectangle) ToInt32() RectangleInt32

ToInt32 converts rectangle to int32 variant

type RectangleInt32 Uses

type RectangleInt32 struct {
    X      int32
    Y      int32
    Width  int32
    Height int32
}

RectangleInt32 type

func (*RectangleInt32) ToFloat32 Uses

func (r *RectangleInt32) ToFloat32() Rectangle

ToFloat32 converts rectangle to float32 variant

type RenderTexture2D Uses

type RenderTexture2D struct {
    // Render texture (fbo) id
    ID  uint32
    // Color buffer attachment texture
    Texture Texture2D
    // Depth buffer attachment texture
    Depth Texture2D
}

RenderTexture2D type, for texture rendering

func LoadRenderTexture Uses

func LoadRenderTexture(width, height int32) RenderTexture2D

LoadRenderTexture - Load a texture to be used for rendering

func NewRenderTexture2D Uses

func NewRenderTexture2D(id uint32, texture, depth Texture2D) RenderTexture2D

NewRenderTexture2D - Returns new RenderTexture2D

type Shader Uses

type Shader struct {
    // Shader program id
    ID  uint32
    // Shader locations array
    Locs [MaxShaderLocations]int32
}

Shader type (generic shader)

func GetShaderDefault Uses

func GetShaderDefault() Shader

GetShaderDefault - Get default shader

func LoadShader Uses

func LoadShader(vsFileName string, fsFileName string) Shader

LoadShader - Load a custom shader and bind default locations

func LoadShaderCode Uses

func LoadShaderCode(vsCode string, fsCode string) Shader

LoadShaderCode - Load shader from code strings and bind default locations

func NewShader Uses

func NewShader(id uint32, locs [MaxShaderLocations]int32) Shader

NewShader - Returns new Shader

type Sound Uses

type Sound struct {
    // Audio source id
    Source uint32
    // Audio buffer id
    Buffer uint32
    // Audio format specifier
    Format int32
}

Sound source type

func LoadSound Uses

func LoadSound(fileName string) Sound

LoadSound - Load sound to memory

func LoadSoundFromWave Uses

func LoadSoundFromWave(wave Wave) Sound

LoadSoundFromWave - Load sound to memory from wave data

func NewSound Uses

func NewSound(source, buffer uint32, format int32) Sound

NewSound - Returns new Sound

type Texture2D Uses

type Texture2D struct {
    // OpenGL texture id
    ID  uint32
    // Texture base width
    Width int32
    // Texture base height
    Height int32
    // Mipmap levels, 1 by default
    Mipmaps int32
    // Data format (PixelFormat)
    Format PixelFormat
}

Texture2D type, bpp always RGBA (32bit) NOTE: Data stored in GPU memory

func GenTextureBRDF Uses

func GenTextureBRDF(shader Shader, cubemap Texture2D, size int) Texture2D

GenTextureBRDF - Generate BRDF texture using cubemap data

func GenTextureCubemap Uses

func GenTextureCubemap(shader Shader, skyHDR Texture2D, size int) Texture2D

GenTextureCubemap - Generate cubemap texture from HDR texture

func GenTextureIrradiance Uses

func GenTextureIrradiance(shader Shader, cubemap Texture2D, size int) Texture2D

GenTextureIrradiance - Generate irradiance texture using cubemap data

func GenTexturePrefilter Uses

func GenTexturePrefilter(shader Shader, cubemap Texture2D, size int) Texture2D

GenTexturePrefilter - Generate prefilter texture using cubemap data

func GetTextureDefault Uses

func GetTextureDefault() *Texture2D

GetTextureDefault - Get default texture

func LoadTexture Uses

func LoadTexture(fileName string) Texture2D

LoadTexture - Load an image as texture into GPU memory

func LoadTextureFromImage Uses

func LoadTextureFromImage(image *Image) Texture2D

LoadTextureFromImage - Load a texture from image data

func NewTexture2D Uses

func NewTexture2D(id uint32, width, height, mipmaps int32, format PixelFormat) Texture2D

NewTexture2D - Returns new Texture2D

type TextureFilterMode Uses

type TextureFilterMode int32

TextureFilterMode - Texture filter mode

const (
    // No filter, just pixel aproximation
    FilterPoint TextureFilterMode = iota
    // Linear filtering
    FilterBilinear
    // Trilinear filtering (linear with mipmaps)
    FilterTrilinear
    // Anisotropic filtering 4x
    FilterAnisotropic4x
    // Anisotropic filtering 8x
    FilterAnisotropic8x
    // Anisotropic filtering 16x
    FilterAnisotropic16x
)

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 TextureWrapMode Uses

type TextureWrapMode int32

TextureWrapMode - Texture wrap mode

const (
    WrapRepeat TextureWrapMode = iota
    WrapClamp
    WrapMirror
)

Texture parameters: wrap mode

type Vector2 Uses

type Vector2 struct {
    X   float32
    Y   float32
}

Vector2 type

func GetGestureDragVector Uses

func GetGestureDragVector() Vector2

GetGestureDragVector - Get gesture drag vector

func GetGesturePinchVector Uses

func GetGesturePinchVector() Vector2

GetGesturePinchVector - Get gesture pinch delta

func GetMousePosition Uses

func GetMousePosition() Vector2

GetMousePosition - Returns mouse position XY

func GetTouchPosition Uses

func GetTouchPosition(index int32) Vector2

GetTouchPosition - Returns touch position XY for a touch point index (relative to screen size)

func GetWorldToScreen Uses

func GetWorldToScreen(position Vector3, camera Camera) Vector2

GetWorldToScreen - Returns the screen space position from a 3d world space position

func MeasureTextEx Uses

func MeasureTextEx(font Font, text string, fontSize float32, spacing float32) Vector2

MeasureTextEx - Measure string size for Font

func NewVector2 Uses

func NewVector2(x, y float32) Vector2

NewVector2 - Returns new Vector2

type Vector3 Uses

type Vector3 struct {
    X   float32
    Y   float32
    Z   float32
}

Vector3 type

func ColorToHSV Uses

func ColorToHSV(color Color) Vector3

ColorToHSV - Returns HSV values for a Color NOTE: Hue is returned as degrees [0..360]

func NewVector3 Uses

func NewVector3(X, Y, Z float32) Vector3

NewVector3 - Returns new Vector3

type Vector4 Uses

type Vector4 struct {
    X   float32
    Y   float32
    Z   float32
    W   float32
}

Vector4 type

func ColorNormalize Uses

func ColorNormalize(color Color) Vector4

ColorNormalize - Returns color normalized as float [0..1]

func GetImageDataNormalized Uses

func GetImageDataNormalized(img *Image) []Vector4

GetImageDataNormalized - Get pixel data from image as Vector4 slice (float normalized)

func NewVector4 Uses

func NewVector4(X, Y, Z, W float32) Vector4

NewVector4 - Returns new Vector4

type VrDevice Uses

type VrDevice int32

VrDevice type

const (
    HmdDefaultDevice VrDevice = iota
    HmdOculusRiftDk2
    HmdOculusRiftCv1
    HmdOculusGo
    HmdValveHtcVive
    HmdSonyPsvr
)

Head Mounted Display devices

type VrDeviceInfo Uses

type VrDeviceInfo struct {
    // HMD horizontal resolution in pixels
    HResolution int
    // HMD vertical resolution in pixels
    VResolution int
    // HMD horizontal size in meters
    HScreenSize float32
    // HMD vertical size in meters
    VScreenSize float32
    // HMD screen center in meters
    VScreenCenter float32
    // HMD distance between eye and display in meters
    EyeToScreenDistance float32
    // HMD lens separation distance in meters
    LensSeparationDistance float32
    // HMD IPD (distance between pupils) in meters
    InterpupillaryDistance float32
    // HMD lens distortion constant parameters
    LensDistortionValues [4]float32
    // HMD chromatic aberration correction parameters
    ChromaAbCorrection [4]float32
}

VrDeviceInfo - Head-Mounted-Display device parameters

func GetVrDeviceInfo Uses

func GetVrDeviceInfo(vrDevice VrDevice) VrDeviceInfo

GetVrDeviceInfo - Get VR device information for some standard devices

func NewVrDeviceInfo Uses

func NewVrDeviceInfo(hResolution, vResolution int, hScreenSize, vScreenSize, vScreenCenter, eyeToScreenDistance,
    lensSeparationDistance, interpupillaryDistance float32, lensDistortionValues, chromaAbCorrection [4]float32) VrDeviceInfo

NewVrDeviceInfo - Returns new VrDeviceInfo

type Wave Uses

type Wave struct {
    // Number of samples
    SampleCount uint32
    // Frequency (samples per second)
    SampleRate uint32
    // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
    SampleSize uint32
    // Number of channels (1-mono, 2-stereo)
    Channels uint32
    // contains filtered or unexported fields
}

Wave type, defines audio wave data

func LoadWave Uses

func LoadWave(fileName string) Wave

LoadWave - Load wave data from file into RAM

func LoadWaveEx Uses

func LoadWaveEx(data []byte, sampleCount int32, sampleRate int32, sampleSize int32, channels int32) Wave

LoadWaveEx - Load wave data from float array data (32bit)

func NewWave Uses

func NewWave(sampleCount, sampleRate, sampleSize, channels uint32, data []byte) Wave

NewWave - Returns new Wave

func WaveCopy Uses

func WaveCopy(wave Wave) Wave

WaveCopy - Copy a wave to a new wave

Package rl imports 8 packages (graph) and is imported by 11 packages. Updated 2018-12-22. Refresh now. Tools for package owners.