raylib

package
v0.0.0-...-7ca39b8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Zlib Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// alphanumeric KeyS
	KeyApostrophe Key = 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

	// 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    = 343
	KeyRightShift   = 344
	KeyRightControl = 345
	KeyRightAlt     = 346
	KeyRightSuper   = 347
	KeyKbMenu       = 348
	KeyLeftBracket  = 91
	KeyBackslash    = 92
	KeyRightBracket = 93
	KeyGrave        = 96

	// KeyPad 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
)
View Source
const (
	FlagShowLogo = 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
)
View Source
const (
	//PI 3.1415
	PI float32 = 3.14159265358979323846

	//Deg2Rad used to convert degrees into radians
	Deg2Rad float32 = PI / 180

	//Rad2Deg used to convert radians into degrees
	Rad2Deg float32 = 180 / PI
)
View Source
const (
	MaxMeshVertices         = 1 << 28
	MaxMeshIndices          = 1 << 28
	MaxMeshTexCoords        = 1 << 28
	MaxMeshAnimatedVertices = 1 << 28
	MaxMeshBones            = 1 << 28
)
View Source
const (
	MaxModelMeshes    = 1 << 28
	MaxModelMaterials = 1 << 28
	MaxModelBones     = 1 << 28
	MaxModelBinds     = 1 << 28
)
View Source
const MaxMaterialMaps = 12
View Source
const MaxMaterialParams = 1 << 28
View Source
const MaxShaderLocations = 32

Variables

View Source
var (
	// LightGray ...
	LightGray = NewColor(200, 200, 200, 255)
	//Gray ...
	Gray = NewColor(130, 130, 130, 255)
	//DarkGray ...
	DarkGray = NewColor(80, 80, 80, 255)
	//Yellow ...
	Yellow = NewColor(253, 249, 0, 255) // Yellow
	//Gold ...
	Gold = NewColor(255, 203, 0, 255) // Gold
	//Orange ...
	Orange = NewColor(255, 161, 0, 255) // Orange
	//Pink ...
	Pink = NewColor(255, 109, 194, 255) // Pink
	//Red ...
	Red = NewColor(230, 41, 55, 255) // Red
	//Maroon ...
	Maroon = NewColor(190, 33, 55, 255) // Maroon
	//Green ...
	Green = NewColor(0, 228, 48, 255) // Green
	//Lime ...
	Lime = NewColor(0, 158, 47, 255) // Lime
	//DarkGreen ...
	DarkGreen = NewColor(0, 117, 44, 255) // Dark Green
	//SkyBlue ...
	SkyBlue = NewColor(102, 191, 255, 255) // Sky Blue
	//Blue ...
	Blue = NewColor(0, 121, 241, 255) // Blue
	//DarkBlue ...
	DarkBlue = NewColor(0, 82, 172, 255) // Dark Blue
	//Purple ...
	Purple = NewColor(200, 122, 255, 255) // Purple
	//Violet ...
	Violet = NewColor(135, 60, 190, 255) // Violet
	//DarkPurple ...
	DarkPurple = NewColor(112, 31, 126, 255) // Dark Purple
	//Beige ...
	Beige = NewColor(211, 176, 131, 255) // Beige
	//Brown ...
	Brown = NewColor(127, 106, 79, 255) // Brown
	//DarkBrown ...
	DarkBrown = NewColor(76, 63, 47, 255) // Dark Brown
	//White ...
	White = NewColor(255, 255, 255, 255) // White
	//Black ...
	Black = NewColor(0, 0, 0, 255) // Black
	//Blank (Transparent)
	Blank = NewColor(0, 0, 0, 0) // Blank (Transparent)
	//Magenta ...
	Magenta = NewColor(255, 0, 255, 255) // Magenta
	//RayWhite - Off White
	RayWhite = NewColor(245, 245, 245, 255) // My own White (raylib logo)
	//Aqua
	Aqua = NewColor(0, 162, 156, 255)
	//Gopher Blue
	GopherBlue = NewColor(1, 173, 216, 255)
	//Transparent
	Transparent = NewColor(0, 0, 0, 0)
)

Functions

func BeginBlendMode

func BeginBlendMode(mode BlendMode)

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

func BeginDrawing

func BeginDrawing()

BeginDrawing : Setup canvas (framebuffer) to start drawing

func BeginMode2D

func BeginMode2D(camera Camera2D)

BeginMode2D : Initialize 2D mode with custom camera (2D)

func BeginMode3D

func BeginMode3D(camera Camera)

BeginMode3D : Initializes 3D mode with custom camera (3D)

func BeginScissorMode

func BeginScissorMode(x int, y int, width int, height int)

BeginScissorMode : Begin scissor mode (define screen area for following drawing)

func BeginShaderMode

func BeginShaderMode(shader Shader)

BeginShaderMode : Begin custom shader drawing

func BeginTextureMode

func BeginTextureMode(target RenderTexture2D)

BeginTextureMode : Initializes render texture for drawing

func BeginVrDrawing

func BeginVrDrawing()

BeginVrDrawing : Begin VR simulator stereo rendering

func CheckCollisionBoxSphere

func CheckCollisionBoxSphere(box BoundingBox, center Vector3, radius float32) bool

CheckCollisionBoxSphere : Detect collision between box and sphere

func CheckCollisionBoxes

func CheckCollisionBoxes(box1 BoundingBox, box2 BoundingBox) bool

CheckCollisionBoxes : Detect collision between two bounding boxes

func CheckCollisionCircleRec

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

CheckCollisionCircleRec : Check collision between circle and rectangle

func CheckCollisionCircles

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

CheckCollisionCircles : Check collision between two circles

func CheckCollisionPointCircle

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

CheckCollisionPointCircle : Check if point is inside circle

func CheckCollisionPointRec

func CheckCollisionPointRec(point Vector2, r Rectangle) bool

CheckCollisionPointRec : Check if point is inside rectangle

func CheckCollisionPointTriangle

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

CheckCollisionPointTriangle : Check if point is inside a triangle

func CheckCollisionRayBox

func CheckCollisionRayBox(ray Ray, box BoundingBox) bool

CheckCollisionRayBox : Detect collision between ray and box

func CheckCollisionRaySphere

func CheckCollisionRaySphere(ray Ray, center Vector3, radius float32) bool

CheckCollisionRaySphere : Detect collision between ray and sphere

func CheckCollisionRecs

func CheckCollisionRecs(r Rectangle, rect Rectangle) bool

CheckCollisionRecs : Check collision between two rectangles Alias of rec1.Overlaps(rect2) instead.

func CheckCollisionSpheres

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

CheckCollisionSpheres : Detect collision between two spheres

func Clamp

func Clamp(v float64, min float64, max float64) float64

Clamp a value between min and max

func Clamp32

func Clamp32(v float32, min float32, max float32) float32

Clamp32 a value between min and max

func ClearBackground

func ClearBackground(color Color)

ClearBackground : Set background color (framebuffer clear color)

func ClearDroppedFiles

func ClearDroppedFiles()

ClearDroppedFiles : Clear dropped files paths buffer (free memory)

func CloseAudioDevice

func CloseAudioDevice()

CloseAudioDevice : Close the audio device and context

func CloseAudioStream

func CloseAudioStream(stream *AudioStream)

CloseAudioStream : Close audio stream and free memory Recommended to use stream.Unload() instead

func CloseVrSimulator

func CloseVrSimulator()

CloseVrSimulator : Close VR simulator for current device

func CloseWindow

func CloseWindow()

CloseWindow : Close window and unload OpenGL context

func ColorToInt

func ColorToInt(color Color) int

ColorToInt : Returns hexadecimal value for a Color

func DisableCursor

func DisableCursor()

DisableCursor : Disables cursor (lock cursor)

func DrawBillboard

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

DrawBillboard : Draw a billboard texture

func DrawBillboardRec

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

DrawBillboardRec : Draw a billboard texture defined by sourceRec

func DrawBoundingBox

func DrawBoundingBox(box BoundingBox, color Color)

DrawBoundingBox : Draw bounding box (wires)

func DrawCircle

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

DrawCircle : Draw a color-filled circle

func DrawCircle3D

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

DrawCircle3D : Draw a circle in 3D world space

func DrawCircleGradient

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

DrawCircleGradient : Draw a gradient-filled circle

func DrawCircleLines

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

DrawCircleLines : Draw circle outline

func DrawCircleSector

func DrawCircleSector(center Vector2, radius float32, startAngle int, endAngle int, segments int, color Color)

DrawCircleSector : Draw a piece of a circle

func DrawCircleSectorLines

func DrawCircleSectorLines(center Vector2, radius float32, startAngle int, endAngle int, segments int, color Color)

DrawCircleSectorLines : Draw circle sector outline

func DrawCircleV

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

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

func DrawCube

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

DrawCube : Draw cube

func DrawCubeTexture

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

DrawCubeTexture : Draw cube textured

func DrawCubeV

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

DrawCubeV : Draw cube (Vector version)

func DrawCubeWires

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

DrawCubeWires : Draw cube wires

func DrawCubeWiresV

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

DrawCubeWiresV : Draw cube wires (Vector version)

func DrawCylinder

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

DrawCylinder : Draw a cylinder/cone

func DrawCylinderWires

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

DrawCylinderWires : Draw a cylinder/cone wires

func DrawFPS

func DrawFPS(posX int, posY int)

DrawFPS : Shows current FPS

func DrawGizmo

func DrawGizmo(position Vector3)

DrawGizmo : Draw simple gizmo

func DrawGrid

func DrawGrid(slices int, spacing float32)

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

func DrawLine

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

DrawLine : Draw a line

func DrawLine3D

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

DrawLine3D : Draw a line in 3D world space

func DrawLineBezier

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

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

func DrawLineEx

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

DrawLineEx : Draw a line defining thickness

func DrawLineV

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

DrawLineV : Draw a line (Vector version)

func DrawModel

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

DrawModel : Draw a model (with texture if set)

func DrawModelEx

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

DrawModelEx : Draw a model with extended parameters

func DrawModelWires

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

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

func DrawModelWiresEx

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

func DrawPixel(posX int, posY int, color Color)

DrawPixel : Draw a pixel

func DrawPixelV

func DrawPixelV(position Vector2, color Color)

DrawPixelV : Draw a pixel (Vector version)

func DrawPlane

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

DrawPlane : Draw a plane XZ

func DrawPoly

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

DrawPoly : Draw a regular polygon (Vector version)

func DrawRay

func DrawRay(ray Ray, color Color)

DrawRay : Draw a ray line

func DrawRectangle

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

DrawRectangle : Draw a color-filled rectangle

func DrawRectangleGradientEx

func DrawRectangleGradientEx(rec Rectangle, col1 Color, col2 Color, col3 Color, col4 Color)

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

func DrawRectangleGradientH

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

DrawRectangleGradientH : Draw a horizontal-gradient-filled rectangle

func DrawRectangleGradientHRec

func DrawRectangleGradientHRec(rect Rectangle, color1 Color, color2 Color)

DrawRectangleGradientH : Draw a horizontal-gradient-filled rectangle

func DrawRectangleGradientV

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

DrawRectangleGradientV : Draw a vertical-gradient-filled rectangle

func DrawRectangleGradientVRec

func DrawRectangleGradientVRec(rect Rectangle, color1 Color, color2 Color)

DrawRectangleGradientV : Draw a vertical-gradient-filled rectangle

func DrawRectangleLines

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

DrawRectangleLines : Draw rectangle outline

func DrawRectangleLinesEx

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

DrawRectangleLinesEx : Draw rectangle outline with extended parameters

func DrawRectanglePro

func DrawRectanglePro(rec Rectangle, origin Vector2, rotation float32, color Color)

DrawRectanglePro : Draw a color-filled rectangle with pro parameters

func DrawRectangleRec

func DrawRectangleRec(rec Rectangle, color Color)

DrawRectangleRec : Draw a color-filled rectangle

func DrawRectangleRounded

func DrawRectangleRounded(rec Rectangle, roundness float32, segments int, color Color)

DrawRectangleRounded : Draw rectangle with rounded edges

func DrawRectangleRoundedLines

func DrawRectangleRoundedLines(rec Rectangle, roundness float32, segments int, lineThick int, color Color)

DrawRectangleRoundedLines : Draw rectangle with rounded edges outline

func DrawRectangleV

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

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

func DrawRing

func DrawRing(center Vector2, innerRadius float32, outerRadius float32, startAngle int, endAngle int, segments int, color Color)

DrawRing : Draw ring

func DrawRingLines

func DrawRingLines(center Vector2, innerRadius float32, outerRadius float32, startAngle int, endAngle int, segments int, color Color)

DrawRingLines : Draw ring outline

func DrawSphere

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

DrawSphere : Draw sphere

func DrawSphereEx

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

DrawSphereEx : Draw sphere with extended parameters

func DrawSphereWires

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

DrawSphereWires : Draw sphere wires

func DrawText

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

DrawText : Draw text (using default font)

func DrawTextEx

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

DrawTextEx : Draw text using font and additional parameters

func DrawTextRec

func DrawTextRec(font Font, text string, rec Rectangle, fontSize float32, spacing float32, wordWrap bool, tint Color)

DrawTextRec : Draw text using font inside rectangle limits

func DrawTextRecEx

func DrawTextRecEx(font Font, text string, rec Rectangle, fontSize float32, spacing float32, wordWrap bool, tint Color, selectStart int, selectLength int, selectText Color, selectBack Color)

DrawTextRecEx : Draw text using font inside rectangle limits with support for text selection

func DrawTexture

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

DrawTexture : Draw a Texture2D

func DrawTextureEx

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

DrawTextureEx : Draw a Texture2D with extended parameters

func DrawTextureNPatch

func DrawTextureNPatch(texture Texture2D, nPatchInfo NPatchInfo, destRec Rectangle, origin Vector2, rotation float32, tint Color)

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

func DrawTexturePro

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

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

func DrawTextureQuad

func DrawTextureQuad(texture Texture2D, tiling Vector2, offset Vector2, quad Rectangle, tint Color)

DrawTextureQuad : Draw texture quad with tiling and offset parameters

func DrawTextureRec

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

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

func DrawTextureV

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

DrawTextureV : Draw a Texture2D with position defined as Vector2

func DrawTriangle

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

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

func DrawTriangleLines

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

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

func EnableCursor

func EnableCursor()

EnableCursor : Enables cursor (unlock cursor)

func EndBlendMode

func EndBlendMode()

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

func EndDrawing

func EndDrawing()

EndDrawing : End canvas drawing and swap buffers (double buffering)

func EndMode2D

func EndMode2D()

EndMode2D : Ends 2D mode with custom camera

func EndMode3D

func EndMode3D()

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

func EndScissorMode

func EndScissorMode()

EndScissorMode : End scissor mode

func EndShaderMode

func EndShaderMode()

EndShaderMode : End custom shader drawing (use default shader)

func EndTextureMode

func EndTextureMode()

EndTextureMode : Ends drawing to render texture

func EndVrDrawing

func EndVrDrawing()

EndVrDrawing : End VR simulator stereo rendering

func ExportImage

func ExportImage(image *Image, fileName string)

ExportImage : Export image data to file Recommended to use image.Export(fileName) instead

func ExportImageAsCode

func ExportImageAsCode(image *Image, fileName string)

ExportImageAsCode : Export image as code file defining an array of bytes Recommended to use image.ExportAsCode(fileName) instead

func ExportMesh

func ExportMesh(mesh *Mesh, fileName string)

ExportMesh : Export mesh data to file Recommended to use mesh.Export(fileName) instead

func ExportWave

func ExportWave(wave *Wave, fileName string)

ExportWave : Export wave data to file Recommended to use wave.Export(fileName) instead

func ExportWaveAsCode

func ExportWaveAsCode(wave *Wave, fileName string)

ExportWaveAsCode : Export wave sample data to code (.h) Recommended to use wave.ExportAsCode(fileName) instead

func Float32frombits

func Float32frombits(b uint32) float32

Float32frombits returns the floating point number corresponding to the IEEE 754 binary representation b.

func GenTextureMipmaps

func GenTextureMipmaps(texture Texture2D)

GenTextureMipmaps : Generate GPU mipmaps for a texture Recommended to use texture.GenTextureMipmaps() instead

func GetClipboardText

func GetClipboardText() string

GetClipboardText : Get clipboard text content

func GetDroppedFiles

func GetDroppedFiles() []string

GetDroppedFiles : Get dropped files names (memory should be freed)

func GetFPS

func GetFPS() int

GetFPS : Returns current FPS

func GetFrameTime

func GetFrameTime() float32

GetFrameTime : Returns time in seconds for last frame drawn

func GetGamepadAxisCount

func GetGamepadAxisCount(gamepad GamepadNumber) int

GetGamepadAxisCount : Return gamepad axis count for a gamepad

func GetGamepadAxisMovement

func GetGamepadAxisMovement(gamepad GamepadNumber, axis GamepadAxis) float32

GetGamepadAxisMovement : Return axis movement value for a gamepad axis

func GetGamepadButtonPressed

func GetGamepadButtonPressed() int

GetGamepadButtonPressed : Get the last gamepad button pressed

func GetGamepadName

func GetGamepadName(gamepad GamepadNumber) string

GetGamepadName : Return gamepad internal name id

func GetGestureDragAngle

func GetGestureDragAngle() float32

GetGestureDragAngle : Get gesture drag angle

func GetGestureHoldDuration

func GetGestureHoldDuration() float32

GetGestureHoldDuration : Get gesture hold time in milliseconds

func GetGesturePinchAngle

func GetGesturePinchAngle() float32

GetGesturePinchAngle : Get gesture pinch angle

func GetGlyphIndex

func GetGlyphIndex(font Font, character int) int

GetGlyphIndex : Get index position for a unicode character on font

func GetMonitorCount

func GetMonitorCount() int

GetMonitorCount : Get number of connected monitors

func GetMonitorHeight

func GetMonitorHeight(monitor int) int

GetMonitorHeight : Get primary monitor height

func GetMonitorName

func GetMonitorName(monitor int) string

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

func GetMonitorPhysicalHeight

func GetMonitorPhysicalHeight(monitor int) int

GetMonitorPhysicalHeight : Get primary monitor physical height in millimetres

func GetMonitorPhysicalWidth

func GetMonitorPhysicalWidth(monitor int) int

GetMonitorPhysicalWidth : Get primary monitor physical width in millimetres

func GetMonitorWidth

func GetMonitorWidth(monitor int) int

GetMonitorWidth : Get primary monitor width

func GetMouseWheelMove

func GetMouseWheelMove() int

GetMouseWheelMove : Returns mouse wheel movement Y

func GetMouseX

func GetMouseX() int

GetMouseX : Returns mouse position X

func GetMouseY

func GetMouseY() int

GetMouseY : Returns mouse position Y

func GetMusicTimeLength

func GetMusicTimeLength(music *Music) float32

GetMusicTimeLength : Get music time length (in seconds) Recommended to use music.GetTimeLength() instead

func GetMusicTimePlayed

func GetMusicTimePlayed(music *Music) float32

GetMusicTimePlayed : Get current music time played (in seconds) Recommended to use music.GetTimePlayed() instead

func GetPixelDataSize

func GetPixelDataSize(width int, height int, format PixelFormat) int

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

func GetRandomValue

func GetRandomValue(min int, max int) int

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

func GetScreenHeight

func GetScreenHeight() int

GetScreenHeight : Get current screen height

func GetScreenWidth

func GetScreenWidth() int

GetScreenWidth : Get current screen width

func GetShaderLocation

func GetShaderLocation(shader Shader, uniformName string) int

GetShaderLocation : Get shader uniform location Recommended to use shader.GetLocation(uniformName) instead

func GetSoundsPlaying

func GetSoundsPlaying() int

GetSoundsPlaying : Get number of sounds playing in the multichannel

func GetTime

func GetTime() float64

GetTime : Returns elapsed time in seconds since InitWindow()

func GetTouchPointsCount

func GetTouchPointsCount() int

GetTouchPointsCount : Get touch points count

func GetTouchX

func GetTouchX() int

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

func GetTouchY

func GetTouchY() int

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

func GetWaveData

func GetWaveData(wave Wave) []float32

GetWaveData : Get samples data from wave as a floats array

func GetWindowHandle

func GetWindowHandle()

GetWindowHandle : Get native window handle

func GuiButton

func GuiButton(bounds Rectangle, text string) bool

GuiButton : Button control, returns true when clicked

func GuiCheckBox

func GuiCheckBox(bounds Rectangle, text string, checked bool) bool

GuiCheckBox : Check Box control, returns true when active

func GuiComboBox

func GuiComboBox(bounds Rectangle, text string, active int) int

GuiComboBox : Combo Box control, returns selected item index

func GuiDisable

func GuiDisable()

GuiDisable : Disable gui controls (global state)

func GuiDropdownBox

func GuiDropdownBox(bounds Rectangle, text string, active int, editMode bool) (bool, int)

GuiDropdownBox : Dropdown Box control, returns selected item

func GuiDummyRec

func GuiDummyRec(bounds Rectangle, text string)

GuiDummyRec : Dummy control for placeholders

func GuiEnable

func GuiEnable()

GuiEnable : Enable gui controls (global state)

func GuiEnabled

func GuiEnabled() bool

GuiEnabled returns if the gui is currently enabled.

func GuiFade

func GuiFade(alpha float32)

GuiFade : Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f

func GuiGetState

func GuiGetState() int

GuiGetState : Get gui state (global state)

func GuiGetStyle

func GuiGetStyle(control GuiControl, property GuiProperty) int

GuiGetStyle : Get one style property

func GuiGroupBox

func GuiGroupBox(bounds Rectangle, text string)

GuiGroupBox : Group Box control with text name

func GuiIconText

func GuiIconText(iconId int, text string) string

GuiIconText : Get text with icon id prepended

func GuiImageButton

func GuiImageButton(bounds Rectangle, text string, texture Texture2D) bool

GuiImageButton : Image button control, returns true when clicked

func GuiImageButtonEx

func GuiImageButtonEx(bounds Rectangle, text string, texture Texture2D, texSource Rectangle) bool

GuiImageButtonEx : Image button extended control, returns true when clicked

func GuiLabel

func GuiLabel(bounds Rectangle, text string)

GuiLabel : Label control, shows text

func GuiLabelButton

func GuiLabelButton(bounds Rectangle, text string) bool

GuiLabelButton : Label button control, show true when clicked

func GuiLine

func GuiLine(bounds Rectangle, text string)

GuiLine : Line separator control, could contain text

func GuiListView

func GuiListView(bounds Rectangle, text string, scrollIndex int, active int) (int, int)

GuiListView : List View control, returns selected list item index

func GuiListViewEx

func GuiListViewEx(bounds Rectangle, text []string, count int, focus int, scrollIndex int, active int) (int, int, int)

GuiListViewEx : List View with extended parameters

func GuiLoadStyle

func GuiLoadStyle(fileName string)

GuiLoadStyle : Load style file (.rgs)

func GuiLoadStyleDefault

func GuiLoadStyleDefault()

GuiLoadStyleDefault : Load style default over global style

func GuiLock

func GuiLock()

GuiLock : Lock gui controls (global state)

func GuiLocked

func GuiLocked() bool

GuiLocked returns if the gui is currently locked.

func GuiMessageBox

func GuiMessageBox(bounds Rectangle, title string, message string, buttons string) int

GuiMessageBox : Message Box control, displays a message

func GuiPanel

func GuiPanel(bounds Rectangle)

GuiPanel : Panel control, useful to group controls

func GuiProgressBar

func GuiProgressBar(bounds Rectangle, textLeft string, textRight string, value float32, minValue float32, maxValue float32) float32

GuiProgressBar : Progress Bar control, shows current progress value

func GuiScrollBar

func GuiScrollBar(bounds Rectangle, value int, minValue int, maxValue int) int

GuiScrollBar : Scroll Bar control

func GuiScrollPanel

func GuiScrollPanel(bounds Rectangle, content Rectangle, scroll Vector2) (Rectangle, Vector2)

GuiScrollPanel : Scroll Panel control

func GuiSetFont

func GuiSetFont(font Font)

GuiSetFont : Set gui custom font (global state)

func GuiSetState

func GuiSetState(state int)

GuiSetState : Set gui state (global state)

func GuiSetStyle

func GuiSetStyle(control GuiControl, property GuiProperty, value int)

GuiSetStyle : Set one style property

func GuiSlider

func GuiSlider(bounds Rectangle, textLeft string, textRight string, value float32, minValue float32, maxValue float32) float32

GuiSlider : Slider control, returns selected value

func GuiSliderBar

func GuiSliderBar(bounds Rectangle, textLeft string, textRight string, value float32, minValue float32, maxValue float32) float32

GuiSliderBar : Slider Bar control, returns selected value

func GuiSpinner

func GuiSpinner(bounds Rectangle, text string, value int, minValue int, maxValue int, editMode bool) (bool, int)

GuiSpinner : Spinner control, returns selected value

func GuiStatusBar

func GuiStatusBar(bounds Rectangle, text string)

GuiStatusBar : Status Bar control, shows info text

func GuiTextBox

func GuiTextBox(bounds Rectangle, text string, maxCharacters int, editMode bool) (bool, string)

GuiTextBox : Text Box control, updates input text

func GuiTextBoxCopy

func GuiTextBoxCopy(text string)

GuiTextBoxCopy : Copy selected text to clipboard from the active textbox (same as pressing `CTRL` + `C`)

func GuiTextBoxCut

func GuiTextBoxCut(text string) string

GuiTextBoxCut : Cut selected text in the active textbox and copy it to clipboard (same as pressing `CTRL` + `X`)

func GuiTextBoxDelete

func GuiTextBoxDelete(text string, length int, before bool) (int, string)

GuiTextBoxDelete : Deletes a character or selection before from the active textbox (depending on `before`). Returns bytes deleted.

func GuiTextBoxGetByteIndex

func GuiTextBoxGetByteIndex(text string, start int, from int, to int) int

GuiTextBoxGetByteIndex : Get the byte index for a character starting at position `from` with index `start` until position `to`.

func GuiTextBoxGetCursor

func GuiTextBoxGetCursor() int

GuiTextBoxGetCursor : Get cursor position of active textbox

func GuiTextBoxIsActive

func GuiTextBoxIsActive(bounds Rectangle) bool

GuiTextBoxIsActive : Returns true if a textbox control with specified `bounds` is the active textbox

func GuiTextBoxMulti

func GuiTextBoxMulti(bounds Rectangle, text string, maxCharacters int, editMode bool) (bool, string)

GuiTextBox : Text Box control, updates input text

func GuiTextBoxPaste

func GuiTextBoxPaste(text string, textSize int) string

GuiTextBoxPaste : Paste text from clipboard into the textbox (same as pressing `CTRL` + `V`)

func GuiTextBoxSelectAll

func GuiTextBoxSelectAll(text string)

GuiTextBoxSelectAll : Select all characters in the active textbox (same as pressing `CTRL` + `A`)

func GuiTextBoxSetActive

func GuiTextBoxSetActive(bounds Rectangle)

GuiTextBoxSetActive : Sets the active textbox

func GuiTextBoxSetCursor

func GuiTextBoxSetCursor(cursor int)

GuiTextBoxSetCursor : Set cursor position of active textbox

func GuiTextBoxSetSelection

func GuiTextBoxSetSelection(start int, length int)

GuiTextBoxSetSelection : Set selection of active textbox

func GuiTextBoxSetState

func GuiTextBoxSetState(state GuiTextBoxState)

GuiTextBoxSetState : Set state for the active textbox (state must be valid else things will break)

func GuiTextInputBox

func GuiTextInputBox(bounds Rectangle, title string, message string, buttons string, text string) (int, string)

GuiTextInputBox : Text Input Box control, ask for text

func GuiToggle

func GuiToggle(bounds Rectangle, text string, active bool) bool

GuiToggle : Toggle Button control, returns true when active

func GuiToggleGroup

func GuiToggleGroup(bounds Rectangle, text string, active int) int

GuiToggleGroup : Toggle Group control, returns active toggle index

func GuiUnlock

func GuiUnlock()

GuiUnlock : Unlock gui controls (global state)

func GuiValueBox

func GuiValueBox(bounds Rectangle, text string, value int, minValue int, maxValue int, editMode bool) (bool, int)

GuiValueBox : Value Box control, updates input text with numbers

func GuiWindowBox

func GuiWindowBox(bounds Rectangle, title string) bool

GuiWindowBox : Window Box control, shows a window that can be closed

func HideCursor

func HideCursor()

HideCursor : Hides cursor

func HideWindow

func HideWindow()

HideWindow : Hide the window

func ImageAlphaClear

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

ImageAlphaClear : Clear alpha channel to desired color Recommended to use image.AlphaClear(color, threshold) instead

func ImageAlphaCrop

func ImageAlphaCrop(image *Image, threshold float32)

ImageAlphaCrop : Crop image depending on alpha value Recommended to use image.AlphaCrop(threshold) instead

func ImageAlphaMask

func ImageAlphaMask(image *Image, alphaMask *Image)

ImageAlphaMask : Apply alpha mask to image Recommended to use image.AlphaMask(alphaMask) instead

func ImageAlphaPremultiply

func ImageAlphaPremultiply(image *Image)

ImageAlphaPremultiply : Premultiply alpha channel Recommended to use image.AlphaPremultiply() instead

func ImageColorBrightness

func ImageColorBrightness(image *Image, brightness int)

ImageColorBrightness : Modify image color: brightness (-255 to 255) Recommended to use image.ColorBrightness(brightness) instead

func ImageColorContrast

func ImageColorContrast(image *Image, contrast float32)

ImageColorContrast : Modify image color: contrast (-100 to 100) Recommended to use image.ColorContrast(contrast) instead

func ImageColorGrayscale

func ImageColorGrayscale(image *Image)

ImageColorGrayscale : Modify image color: grayscale Recommended to use image.ColorGrayscale() instead

func ImageColorInvert

func ImageColorInvert(image *Image)

ImageColorInvert : Modify image color: invert Recommended to use image.ColorInvert() instead

func ImageColorReplace

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

ImageColorReplace : Modify image color: replace color Recommended to use image.ColorReplace(color, replace) instead

func ImageColorTint

func ImageColorTint(image *Image, color Color)

ImageColorTint : Modify image color: tint Recommended to use image.ColorTint(color) instead

func ImageCrop

func ImageCrop(image *Image, crop Rectangle)

ImageCrop : Crop an image to a defined rectangle Recommended to use image.Crop(crop) instead

func ImageDither

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

ImageDither : Dither image data to 16bpp or lower (Floyd-Steinberg dithering) Recommended to use image.Dither(rBpp, gBpp, bBpp, aBpp) instead

func ImageDraw

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

ImageDraw : Draw a source image within a destination image (tint applied to source) Recommended to use dst.Draw(src, srcRec, dstRec, tint) instead

func ImageDrawRectangle

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

ImageDrawRectangle : Draw rectangle within an image Recommended to use dst.DrawRectangle(rec, color) instead

func ImageDrawRectangleLines

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

ImageDrawRectangleLines : Draw rectangle lines within an image Recommended to use dst.DrawRectangleLines(rec, thick, color) instead

func ImageDrawText

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

ImageDrawText : Draw text (default font) within an image (destination) Recommended to use dst.DrawText(position, text, fontSize, color) instead

func ImageDrawTextEx

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

ImageDrawTextEx : Draw text (custom sprite font) within an image (destination) Recommended to use dst.DrawTextEx(position, font, text, fontSize, spacing, color) instead

func ImageFlipHorizontal

func ImageFlipHorizontal(image *Image)

ImageFlipHorizontal : Flip image horizontally Recommended to use image.FlipHorizontal() instead

func ImageFlipVertical

func ImageFlipVertical(image *Image)

ImageFlipVertical : Flip image vertically Recommended to use image.FlipVertical() instead

func ImageFormat

func ImageFormat(image *Image, newFormat PixelFormat)

ImageFormat : Convert image data to desired format Recommended to use image.SetFormat(newFormat) instead

func ImageMipmaps

func ImageMipmaps(image *Image)

ImageMipmaps : Generate all mipmap levels for a provided image Recommended to use image.CreateMipmaps() instead

func ImageResize

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

ImageResize : Resize image (Bicubic scaling algorithm) Recommended to use image.Resize(newWidth, newHeight) instead

func ImageResizeCanvas

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

ImageResizeCanvas : Resize canvas and fill with color Recommended to use image.ResizeCanvas(newWidth, newHeight, offsetX, offsetY, color) instead

func ImageResizeNN

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

ImageResizeNN : Resize image (Nearest-Neighbor scaling algorithm) Recommended to use image.ResizeNN(newWidth, newHeight) instead

func ImageRotateCCW

func ImageRotateCCW(image *Image)

ImageRotateCCW : Rotate image counter-clockwise 90deg Recommended to use image.RotateCCW() instead

func ImageRotateCW

func ImageRotateCW(image *Image)

ImageRotateCW : Rotate image clockwise 90deg Recommended to use image.RotateCW() instead

func ImageToPOT

func ImageToPOT(image *Image, fillColor Color)

ImageToPOT : Convert image to POT (power-of-two) Recommended to use image.ToPOT(fillColor) instead

func Inf

func Inf(sign int) float32

Inf returns positive infinity if sign >= 0, negative infinity if sign < 0.

func InitAudioDevice

func InitAudioDevice()

InitAudioDevice : Initialize audio device and context

func InitVrSimulator

func InitVrSimulator()

InitVrSimulator : Init VR simulator for selected device parameters

func InitWindow

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

InitWindow : Initialize window and OpenGL context

func IsAudioDeviceReady

func IsAudioDeviceReady() bool

IsAudioDeviceReady : Check if audio device has been initialized successfully

func IsAudioStreamPlaying

func IsAudioStreamPlaying(stream *AudioStream) bool

IsAudioStreamPlaying : Check if audio stream is playing Recommended to use stream.IsPlaying() instead

func IsAudioStreamProcessed

func IsAudioStreamProcessed(stream *AudioStream) bool

IsAudioStreamProcessed : Check if any audio stream buffers requires refill Recommended to use stream.IsProcessed() instead

func IsCursorHidden

func IsCursorHidden() bool

IsCursorHidden : Check if cursor is not visible

func IsFileDropped

func IsFileDropped() bool

IsFileDropped : Check if a file has been dropped into window

func IsGamepadAvailable

func IsGamepadAvailable(gamepad GamepadNumber) bool

IsGamepadAvailable : Detect if a gamepad is available

func IsGamepadButtonDown

func IsGamepadButtonDown(gamepad GamepadNumber, button GamepadButton) bool

IsGamepadButtonDown : Detect if a gamepad button is being pressed

func IsGamepadButtonPressed

func IsGamepadButtonPressed(gamepad GamepadNumber, button GamepadButton) bool

IsGamepadButtonPressed : Detect if a gamepad button has been pressed once

func IsGamepadButtonReleased

func IsGamepadButtonReleased(gamepad GamepadNumber, button GamepadButton) bool

IsGamepadButtonReleased : Detect if a gamepad button has been released once

func IsGamepadButtonUp

func IsGamepadButtonUp(gamepad GamepadNumber, button GamepadButton) bool

IsGamepadButtonUp : Detect if a gamepad button is NOT being pressed

func IsGamepadName

func IsGamepadName(gamepad GamepadNumber, name string) bool

IsGamepadName : Check gamepad name (if available)

func IsGestureDetected

func IsGestureDetected(gesture GestureType) bool

IsGestureDetected : Check if a gesture have been detected

func IsKeyDown

func IsKeyDown(key Key) bool

IsKeyDown : Detect if a key is being pressed

func IsKeyPressed

func IsKeyPressed(key Key) bool

IsKeyPressed : Detect if a key has been pressed once

func IsKeyReleased

func IsKeyReleased(key Key) bool

IsKeyReleased : Detect if a key has been released once

func IsKeyUp

func IsKeyUp(key Key) bool

IsKeyUp : Detect if a key is NOT being pressed

func IsModelAnimationValid

func IsModelAnimationValid(model *Model, anim *ModelAnimation) bool

IsModelAnimationValid : Check model animation skeleton match Recommended to use model.IsAnimationValid(anim) instead

func IsMouseButtonDown

func IsMouseButtonDown(button MouseButton) bool

IsMouseButtonDown : Detect if a mouse button is being pressed

func IsMouseButtonPressed

func IsMouseButtonPressed(button MouseButton) bool

IsMouseButtonPressed : Detect if a mouse button has been pressed once

func IsMouseButtonReleased

func IsMouseButtonReleased(button MouseButton) bool

IsMouseButtonReleased : Detect if a mouse button has been released once

func IsMouseButtonUp

func IsMouseButtonUp(button MouseButton) bool

IsMouseButtonUp : Detect if a mouse button is NOT being pressed

func IsMusicPlaying

func IsMusicPlaying(music *Music) bool

IsMusicPlaying : Check if music is playing Recommended to use music.IsPlaying() instead

func IsSoundPlaying

func IsSoundPlaying(sound *Sound) bool

IsSoundPlaying : Check if a sound is currently playing Recommended to use sound.IsPlaying() instead

func IsVrSimulatorReady

func IsVrSimulatorReady() bool

IsVrSimulatorReady : Detect if VR simulator is ready

func IsWindowHidden

func IsWindowHidden() bool

IsWindowHidden : Check if window is currently hidden

func IsWindowMinimized

func IsWindowMinimized() bool

IsWindowMinimized : Check if window has been minimized (or lost focus)

func IsWindowReady

func IsWindowReady() bool

IsWindowReady : Check if window has been initialized successfully

func IsWindowResized

func IsWindowResized() bool

IsWindowResized : Check if window has been resized

func MeasureText

func MeasureText(text string, fontSize int) int

MeasureText : Measure string width for default font

func MeshBinormals

func MeshBinormals(mesh *Mesh)

MeshBinormals : Compute mesh binormals Recommended to use mesh.ComputeBinormals() instead

func MeshTangents

func MeshTangents(mesh *Mesh)

MeshTangents : Compute mesh tangents Recommended to use mesh.ComputeTangents() instead

func NaN32

func NaN32() float32

NaN32 returns an IEEE 754 “not-a-number” value. Source: https://github.com/chewxy/math32/blob/9a000fcb79dff2019bd78fc28bd676198ff3a616/bits.go

func OpenURL

func OpenURL(url string) error

OpenURL opens a URL in the system browser.

func PauseAudioStream

func PauseAudioStream(stream *AudioStream)

PauseAudioStream : Pause audio stream Recommended to use stream.Pause() instead

func PauseMusicStream

func PauseMusicStream(music *Music)

PauseMusicStream : Pause music playing Recommended to use music.PauseStream() instead

func PauseSound

func PauseSound(sound *Sound)

PauseSound : Pause a sound Recommended to use sound.Pause() instead

func PlayAudioStream

func PlayAudioStream(stream *AudioStream)

PlayAudioStream : Play audio stream Recommended to use stream.Play() instead

func PlayMusicStream

func PlayMusicStream(music *Music)

PlayMusicStream : Start music playing Recommended to use music.PlayStream() instead

func PlaySound

func PlaySound(sound *Sound)

PlaySound : Play a sound Recommended to use sound.Play() instead

func PlaySoundMulti

func PlaySoundMulti(sound *Sound)

PlaySoundMulti : Play a sound (using multichannel buffer pool) Recommended to use sound.PlayMulti() instead

func RegisterUnloadable

func RegisterUnloadable(unloadable Unloadable)

RegisterUnloadable registers an unloadable to the slice This is called on Load functions

func ReportGlErrors

func ReportGlErrors()

func ResumeAudioStream

func ResumeAudioStream(stream *AudioStream)

ResumeAudioStream : Resume audio stream Recommended to use stream.Resume() instead

func ResumeMusicStream

func ResumeMusicStream(music *Music)

ResumeMusicStream : Resume playing paused music Recommended to use music.ResumeStream() instead

func ResumeSound

func ResumeSound(sound *Sound)

ResumeSound : Resume a paused sound Recommended to use sound.Resume() instead

func SetAudioStreamPitch

func SetAudioStreamPitch(stream *AudioStream, pitch float32)

SetAudioStreamPitch : Set pitch for audio stream (1.0 is base level) Recommended to use stream.SetPitch(pitch) instead

func SetAudioStreamVolume

func SetAudioStreamVolume(stream *AudioStream, volume float32)

SetAudioStreamVolume : Set volume for audio stream (1.0 is max level) Recommended to use stream.SetVolume(volume) instead

func SetCameraAltControl

func SetCameraAltControl(altKey Key)

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

func SetCameraMode

func SetCameraMode(camera *Camera, mode CameraMode)

SetCameraMode : Set camera mode (multiple camera modes available) Recommended to use camera.SetMode(mode) instead

func SetCameraMoveControls

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

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

func SetCameraPanControl

func SetCameraPanControl(panKey Key)

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

func SetCameraSmoothZoomControl

func SetCameraSmoothZoomControl(szKey Key)

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

func SetClipboardText

func SetClipboardText(text string)

SetClipboardText : Set clipboard text content

func SetConfigFlags

func SetConfigFlags(flags uint32)

SetConfigFlags : Setup window configuration flags (view FLAGS)

func SetExitKey

func SetExitKey(key Key)

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

func SetGesturesEnabled

func SetGesturesEnabled(gestureFlags uint32)

SetGesturesEnabled : Enable a set of gestures using flags

func SetMasterVolume

func SetMasterVolume(volume float32)

SetMasterVolume : Set master volume (listener)

func SetMaterialTexture

func SetMaterialTexture(material *Material, mapType MaterialMapType, texture Texture2D)

SetMaterialTexture : Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) Recommended to use material.SetTexture(mapType, texture) instead

func SetMatrixModelview

func SetMatrixModelview(view Matrix)

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

func SetMatrixProjection

func SetMatrixProjection(proj Matrix)

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

func SetModelMeshMaterial

func SetModelMeshMaterial(model *Model, meshId int, materialId int)

SetModelMeshMaterial : Set material for a mesh Recommended to use model.SetMeshMaterial(meshId, materialId) instead

func SetMouseOffset

func SetMouseOffset(offsetX int, offsetY int)

SetMouseOffset : Set mouse offset

func SetMousePosition

func SetMousePosition(x int, y int)

SetMousePosition : Set mouse position XY

func SetMouseScale

func SetMouseScale(scaleX float32, scaleY float32)

SetMouseScale : Set mouse scaling

func SetMusicLoopCount

func SetMusicLoopCount(music *Music, count int)

SetMusicLoopCount : Set music loop count (loop repeats) Recommended to use music.SetLoopCount(count) instead

func SetMusicPitch

func SetMusicPitch(music *Music, pitch float32)

SetMusicPitch : Set pitch for a music (1.0 is base level) Recommended to use music.SetPitch(pitch) instead

func SetMusicVolume

func SetMusicVolume(music *Music, volume float32)

SetMusicVolume : Set volume for music (1.0 is max level) Recommended to use music.SetVolume(volume) instead

func SetShaderValueFloat32

func SetShaderValueFloat32(shader *Shader, uniformLoc int, value []float32, uniformType ShaderUniformDataType)

SetShaderValueFloat32 : Set shader uniform value Recommended to use shader.SetValueFloat32(uniformLoc, value, uniformType) instead

func SetShaderValueFloat32V

func SetShaderValueFloat32V(shader *Shader, uniformLoc int, values []float32, uniformType ShaderUniformDataType)

SetShaderValueFloat32V : Sets a float vector (array) of uniform values Recommended to use shader.SetValueFloat32V(uniformLoc, value, uniformType) instead

func SetShaderValueInt32

func SetShaderValueInt32(shader *Shader, uniformLoc int, value []int32, uniformType ShaderUniformDataType)

SetShaderValueInt32 : Set shader uniform value Recommended to use shader.SetValueInt32(uniformLoc, value, uniformType) instead

func SetShaderValueInt32V

func SetShaderValueInt32V(shader *Shader, uniformLoc int, values []int32, uniformType ShaderUniformDataType)

SetShaderValueInt32V : Sets a vector (array) of uniform values Recommended to use shader.SetValueInt32V(uniformLoc, value, uniformType) instead

func SetShaderValueMatrix

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

SetShaderValueMatrix : Set shader uniform value (matrix 4x4) Recommended to use shader.SetValueMatrix(uniformLoc, mat) instead

func SetShaderValueTexture

func SetShaderValueTexture(shader Shader, uniformLoc int, texture Texture2D)

SetShaderValueTexture : Set shader uniform value for texture Recommended to use shader.SetValueTexture(uniformLoc, texture) instead

func SetShapesTexture

func SetShapesTexture(texture Texture2D, source Rectangle)

SetShapesTexture : Define default texture used to draw shapes

func SetSoundPitch

func SetSoundPitch(sound *Sound, pitch float32)

SetSoundPitch : Set pitch for a sound (1.0 is base level) Recommended to use sound.SetPitch(pitch) instead

func SetSoundVolume

func SetSoundVolume(sound *Sound, volume float32)

SetSoundVolume : Set volume for a sound (1.0 is max level) Recommended to use sound.SetVolume(volume) instead

func SetTargetFPS

func SetTargetFPS(fps int)

SetTargetFPS : Set target FPS (maximum)

func SetTextureFilter

func SetTextureFilter(texture Texture2D, filterMode TextureFilterMode)

SetTextureFilter : Set texture scaling filter mode Recommended to use texture.SetTextureFilter(filterMode) instead

func SetTextureWrap

func SetTextureWrap(texture *Texture2D, wrapMode TextureWrapMode)

SetTextureWrap : Set texture wrapping mode Recommended to use texture.SetWrap(wrapMode) instead

func SetTraceLogCallback

func SetTraceLogCallback(callback func(logType TraceLogType, text string))

SetTraceLogCallback : Set the callback for custom logging.

func SetTraceLogExit

func SetTraceLogExit(logType TraceLogType)

SetTraceLogExit : Set the exit threshold (minimum) log level Set to NONE to disable this. (none is above all log levels).

func SetTraceLogLevel

func SetTraceLogLevel(logType TraceLogType)

SetTraceLogLevel : Set the current threshold (minimum) log level

func SetVrConfiguration

func SetVrConfiguration(info VrDeviceInfo, distortion Shader)

SetVrConfiguration : Set stereo rendering configuration parameters

func SetWindowIcon

func SetWindowIcon(image Image)

SetWindowIcon : Set icon for window (only PLATFORM_DESKTOP)

func SetWindowMinSize

func SetWindowMinSize(width int, height int)

SetWindowMinSize : Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)

func SetWindowMonitor

func SetWindowMonitor(monitor int)

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

func SetWindowPosition

func SetWindowPosition(x int, y int)

SetWindowPosition : Set window position on screen (only PLATFORM_DESKTOP)

func SetWindowSize

func SetWindowSize(width int, height int)

SetWindowSize : Set window dimensions

func SetWindowTitle

func SetWindowTitle(title string)

SetWindowTitle : Set title for window (only PLATFORM_DESKTOP)

func ShowCursor

func ShowCursor()

ShowCursor : Shows cursor

func StopAudioStream

func StopAudioStream(stream *AudioStream)

StopAudioStream : Stop audio stream Recommended to use stream.Stop() instead

func StopMusicStream

func StopMusicStream(music *Music)

StopMusicStream : Stop music playing Recommended to use music.StopStream() instead

func StopSound

func StopSound(sound *Sound)

StopSound : Stop playing a sound Recommended to use sound.Stop() instead

func StopSoundMulti

func StopSoundMulti()

StopSoundMulti : Stop any sound playing (using multichannel buffer pool)

func StorageLoadValue

func StorageLoadValue(position int) int

StorageLoadValue : Load integer value from storage file (from defined position)

func StorageSaveValue

func StorageSaveValue(position int, value int)

StorageSaveValue : Save integer value to storage file (to defined position)

func TakeScreenshot

func TakeScreenshot(fileName string)

SetTraceLogCallback is in trace.go TakeScreenshot : Takes a screenshot of current screen (saved a .png)

func ToggleFullscreen

func ToggleFullscreen()

ToggleFullscreen : Toggle fullscreen mode (only PLATFORM_DESKTOP)

func ToggleVrMode

func ToggleVrMode()

ToggleVrMode : Enable/Disable VR experience

func Trace

func Trace(a ...interface{})

Trace creates a trace log

func TraceError

func TraceError(a ...interface{})

TraceError creates an error log

func TraceFatal

func TraceFatal(a ...interface{})

TraceFatal creates an error log

func TraceInfo

func TraceInfo(a ...interface{})

TraceInfo creates a info log

func TraceLog

func TraceLog(logType TraceLogType, a ...interface{})

TraceLog creates a new log with a particular type. If a custom callback for logs is set, then it will directly invoke it, avoiding the raylib function.

func TraceWarning

func TraceWarning(a ...interface{})

TraceWarning creates a warning log

func UnhideWindow

func UnhideWindow()

UnhideWindow : Show the window

func UnloadAll

func UnloadAll()

UnloadAll clears all unloadables that have been recorded. NOTE: Not everything maybe included in this list and it is experimental feature.

Please unload these objects when you are not using them anyways.

func UnloadFont

func UnloadFont(font *Font)

UnloadFont : Unload Font from GPU memory (VRAM) Recommended to use font.Unload() instead

func UnloadImage

func UnloadImage(image *Image)

UnloadImage : Unload image from CPU memory (RAM) Recommended to use image.Unload() instead

func UnloadMaterial

func UnloadMaterial(material *Material)

UnloadMaterial : Unload material from GPU memory (VRAM) Recommended to use material.Unload() instead

func UnloadMesh

func UnloadMesh(mesh *Mesh)

UnloadMesh : Unload mesh from memory (RAM and/or VRAM) Recommended to use mesh.Unload() instead

func UnloadModel

func UnloadModel(model *Model)

UnloadModel : Unload model from memory (RAM and/or VRAM) Recommended to use model.Unload() instead

func UnloadModelAnimation

func UnloadModelAnimation(anim *ModelAnimation)

UnloadModelAnimation : Unload animation data Recommended to use anim.Unload() instead

func UnloadMusicStream

func UnloadMusicStream(music *Music)

UnloadMusicStream : Unload music stream

func UnloadRenderTexture

func UnloadRenderTexture(target RenderTexture2D)

UnloadRenderTexture : Unload render texture from GPU memory (VRAM) Recommended to use target.Unload() instead

func UnloadShader

func UnloadShader(shader Shader)

UnloadShader : Unload shader from GPU memory (VRAM) Recommended to use shader.Unload() instead

func UnloadSound

func UnloadSound(sound *Sound)

UnloadSound : Unload sound Recommended to use sound.Unload() instead

func UnloadTexture

func UnloadTexture(texture Texture2D)

UnloadTexture : Unload texture from GPU memory (VRAM) Recommended to use texture.Unload() instead

func UnloadWave

func UnloadWave(wave *Wave)

UnloadWave : Unload wave data Recommended to use wave.Unload() instead

func UnregisterUnloadable

func UnregisterUnloadable(unloadable Unloadable)

UnregisterUnloadable unregisters an unloadable to the slice This is called on Unload functions This does not remove from the slice if unloadingAll is true (as that will clear post)

func UpdateAudioStream

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

UpdateSound : Update audio stream buffers with data Recommended to use stream.Update(data, samplesCount) instead

func UpdateCamera

func UpdateCamera(camera *Camera)

UpdateCamera : Update camera position for selected mode Recommended to use camera.Update() instead

func UpdateModelAnimation

func UpdateModelAnimation(model *Model, anim *ModelAnimation, frame int)

UpdateModelAnimation : Update model animation pose Recommended to use model.UpdateAnimation(anim, frame) instead

func UpdateMusicStream

func UpdateMusicStream(music *Music)

UpdateMusicStream : Updates buffers for music streaming Recommended to use music.UpdateStream() instead

func UpdateSound

func UpdateSound(sound *Sound, data unsafe.Pointer, samplesCount int)

UpdateSound : Update sound buffer with new data Recommended to use sound.Update(data, samplesCount) instead

func UpdateTexture

func UpdateTexture(texture *Texture2D, pixels []Color)

UpdateTexture : Update GPU texture with new data Recommended to use texture.UpdateTexture(pixels) instead

func UpdateVrTracking

func UpdateVrTracking(camera *Camera)

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

func WaveCrop

func WaveCrop(wave *Wave, initSample int, finalSample int)

WaveCrop : Crop a wave to defined samples range Recommended to use wave.Crop(initSample, finalSample) instead

func WaveFormat

func WaveFormat(wave *Wave, sampleRate int, sampleSize int, channels int)

WaveFormat : Convert wave data to desired format Recommended to use wave.Format(sampleRate, sampleSize, channels) instead

func WindowShouldClose

func WindowShouldClose() bool

WindowShouldClose : Check if KEY_ESCAPE pressed or Close icon pressed

Types

type AudioStream

type AudioStream struct {
	SampleRate uint32
	SampleSize uint32
	Channels   uint32
	Buffer     unsafe.Pointer
}

AudioStream can be used to create custom audio streams. Note that Buffer is an unsafe.Pointer and is a C stream.

func InitAudioStream

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

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

func (*AudioStream) IsPlaying

func (stream *AudioStream) IsPlaying() bool

IsPlaying : Check if audio stream is playing

func (*AudioStream) IsProcessed

func (stream *AudioStream) IsProcessed() bool

IsProcessed : Check if any audio stream buffers requires refill

func (*AudioStream) IsValid

func (as *AudioStream) IsValid() bool

IsValid returns true the audio has channels

func (*AudioStream) Pause

func (stream *AudioStream) Pause()

Pause : Pause audio stream

func (*AudioStream) Play

func (stream *AudioStream) Play()

Play : Play audio stream

func (*AudioStream) Resume

func (stream *AudioStream) Resume()

Resume : Resume audio stream

func (*AudioStream) SetPitch

func (stream *AudioStream) SetPitch(pitch float32)

SetPitch : Set pitch for audio stream (1.0 is base level)

func (*AudioStream) SetVolume

func (stream *AudioStream) SetVolume(volume float32)

SetVolume : Set volume for audio stream (1.0 is max level)

func (*AudioStream) Stop

func (stream *AudioStream) Stop()

Stop : Stop audio stream

func (*AudioStream) Unload

func (stream *AudioStream) Unload()

Unload : Close audio stream and free memory

func (*AudioStream) Update

func (stream *AudioStream) Update(data []float32, samplesCount int)

Update : Update audio stream buffers with data

type BlendMode

type BlendMode int32

BlendMode type

const (
	BlendAlpha BlendMode = iota
	BlendAdditive
	BlendMultiplied
)

type BoneInfo

type BoneInfo struct {
	Name   [32]byte
	Parent int32
}

type BoundingBox

type BoundingBox struct {
	Min Vector3
	Max Vector3
}

func MeshBoundingBox

func MeshBoundingBox(mesh *Mesh) BoundingBox

MeshBoundingBox : Compute mesh bounding box limits Recommended to use mesh.BoundingBox() instead

func NewBoundingBox

func NewBoundingBox(min, max Vector3) BoundingBox

NewBoundingBox - Returns new BoundingBox

func (BoundingBox) Center

func (bb BoundingBox) Center() Vector3

Center gets the center position of the bounding box

func (BoundingBox) Size

func (bb BoundingBox) Size() Vector3

Size gets the size of the bounding box

type Camera

type Camera Camera3D

Camera is a fallback, defaults to Camera3D

func NewCamera

func NewCamera(position, target, up Vector3, fovy float32, cameraType CameraType) Camera

NewCamera creates a new camera

func NewCameraIdentity

func NewCameraIdentity() Camera

Creates a new empty camera

func (*Camera) SetMode

func (camera *Camera) SetMode(mode CameraMode)

SetMode : Set camera mode (multiple camera modes available)

func (*Camera) ToCamera3D

func (c *Camera) ToCamera3D() *Camera3D

func (*Camera) Update

func (camera *Camera) Update()

Update : Update camera position for selected mode

type Camera2D

type Camera2D struct {
	Offset   Vector2
	Target   Vector2
	Rotation float32
	Zoom     float32
}

type Camera3D

type Camera3D struct {
	Position Vector3
	Target   Vector3
	Up       Vector3
	FOVY     float32
	Type     CameraType
}

Camera3D defines a camera in 3D space

func (*Camera3D) ToCamera

func (c *Camera3D) ToCamera() *Camera

type CameraMode

type CameraMode int32
const (
	CameraCustom CameraMode = iota
	CameraFree
	CameraOrbital
	CameraFirstPerson
	CameraThirdPerson
)

type CameraType

type CameraType int32
const (
	CameraTypePerspective CameraType = iota
	CameraTypeOrthographic
)

type CharInfo

type CharInfo struct {
	Value    uint32
	OffsetX  uint32
	OffsetY  uint32
	AdvanceX uint32
	Image    Image
}

func LoadFontData

func LoadFontData(fileName string, fontSize, charsCount int, fontType FontType) []CharInfo

LoadFontData : Load font data and copy into a new Go Slice. Original is then freed.

type Color

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

Color type, RGBA (32bit)

func ColorFromHSV

func ColorFromHSV(hsv Vector3) Color

ColorFromHSV : Returns a Color from HSV values

func Fade

func Fade(color Color, alpha float32) Color

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

func GetColor

func GetColor(hexValue int) Color

GetColor : Returns a Color struct from hexadecimal value

func GetImageData

func GetImageData(image *Image) []Color

GetImageData : Get pixel data from image as a Color slice Recommended to use image.GetPixels instead.

func GuiColorPicker

func GuiColorPicker(bounds Rectangle, color Color) Color

GuiColorPicker : Color Picker control

func ImageExtractPalette

func ImageExtractPalette(image *Image, maxPaletteSize int) ([]Color, int)

ImageExtractPalette : Extract color palette from image to maximum size (memory should be freed) Recommended to use image.ExtractPalette(maxPaletteSize) instead

func NewColor

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

NewColor creates a new colour

func NewColorFromHSV

func NewColorFromHSV(hsv Vector3) Color

NewColorFromHSV turns a HSV to a colour

func NewColorFromNormalized

func NewColorFromNormalized(normalized Vector4) Color

NewColorFromNormalized creates a colour from the normalized value [0..1]

func NewColorInt

func NewColorInt(hexValue int) Color

NewColorInt creates a colour from a hexadecimal int

func (Color) Fade

func (c Color) Fade(alpha float32) Color

Fade a colour

func (Color) Lerp

func (c Color) Lerp(target Color, amount float32) Color

Lerp a color towards another color

func (Color) LerpHSV

func (c Color) LerpHSV(target Color, amount float32) Color

LerpHSV will lerp the color towards another, using their calculated HSV to do so. Note it is more efficient to store the calculated HSV of each and lerp between them

func (Color) Normalize

func (c Color) Normalize() Vector4

Normalize returns the normalized colour as floats [0..1]

func (Color) ToHSV

func (c Color) ToHSV() Vector3

func (Color) ToInt

func (c Color) ToInt() int

ToInt converts the colour into a hexadecimal int

type CubemapLayoutType

type CubemapLayoutType int32
const (
	//CubmapAutoDetect automatically detect layout type
	CubmapAutoDetect CubemapLayoutType = iota
	//CubemapLineVertical Layout is defined by a vertical line with faces
	CubemapLineVertical
	//CubemapLineHorizontal Layout is defined by an horizontal line with faces
	CubemapLineHorizontal
	//CubemapCrossThreeByFour Layout is defined by a 3x4 cross with cubemap faces
	CubemapCrossThreeByFour
	//CubemapCrossFourByThree Layout is defined by a 4x3 cross with cubemap faces
	CubemapCrossFourByThree
	//CubemapPanorama Layout is defined by a panorama image (equirectangular map)
	CubemapPanorama
)

type Font

type Font struct {
	BaseSize  int32
	CharCount int32
	Texture   Texture2D
	Chars     []CharInfo
	Recs      *Rectangle
}

func GetFontDefault

func GetFontDefault() *Font

GetFontDefault : Get the default Font

func GuiGetFont

func GuiGetFont() *Font

GuiGetFont : Get gui custom font (global state)

func LoadFont

func LoadFont(fileName string) *Font

LoadFont : Load font from file into GPU memory (VRAM)

func LoadFontEx

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

LoadFontEx : Load font from file with extended parameters

func LoadFontFromImage

func LoadFontFromImage(image *Image, key Color, firstChar int) *Font

LoadFontFromImage : Load font from Image (XNA style)

func (*Font) Unload

func (font *Font) Unload()

Unload : Unload Font from GPU memory (VRAM)

type FontType

type FontType int32

FontType defines generation method of the font

const (
	//FontTypeDefault Default font generation, anti-aliased
	FontTypeDefault FontType = iota
	//FontTypeBitmap Bitmap font generation, no anti-aliasing
	FontTypeBitmap
	//FontTypeSDF SDF font generation, requires external shader
	FontTypeSDF
)

type GamepadAxis

type GamepadAxis int32
const (
	GamepadAxisUnkown GamepadAxis = iota
	GamepadAxisLeftX
	GamepadAxisLeftY
	GamepadAxisRightX
	GamepadAxisRightY
	GamepadAxisLeftTrigger
	GamepadAxisRightTrigger
)

type GamepadButton

type GamepadButton int32
const (
	GamepadButtonUnkown GamepadButton = iota

	GamepadButtonLeftFaceUp
	GamepadButtonLeftFaceRight
	GamepadButtonLeftFaceDown
	GamepadButtonLeftFaceLeft

	GamepadButtonRightFaceUp
	GamepadButtonRightFaceRight
	GamepadButtonRightFaceDown
	GamepadButtonRightFaceLeft

	GamepadButtonLeftTrigger1
	GamepadButtonLeftTrigger2
	GamepadButtonRightTrigger1
	GamepadButtonRightTrigger2

	GamepadButtonMiddleLeft
	GamepadButtonMiddle
	GamepadButtonMiddleRight

	GamepadButtonLeftThumb
	GamepadButtonRightThumb
)

type GamepadNumber

type GamepadNumber int32
const (
	GamepadPlayer1 GamepadNumber = iota
	GamepadPlayer2
	GamepadPlayer3
	GamepadPlayer4
)

type GestureType

type GestureType int32
const (
	GestureNone GestureType = 1 << iota
	GestureTap
	GestureDoubleTap
	GestureHold
	GestureDrag
	GestureSwipeRight
	GestureSwipeLeft
	GestureSwipeUp
	GestureSwipeDown
	GesturePinchIn
	GesturePinchOut
)

func GetGestureDetected

func GetGestureDetected() GestureType

GetGestureDetected : Get latest detected gesture

type GuiControl

type GuiControl int32

GuiControl the ID of a control

const (
	GuiControlDefault GuiControl = iota
	GuiControlLabel
	GuiControlButton
	GuiControlToggle
	GuiControlSlider
	GuiControlProgressBar
	GuiControlCheckBox
	GuiControlComboBox
	GuiControlDropDownBox
	GuiControlTextBox
	GuiControlValueBox
	GuiControlSpinner
	GuiControlListView
	GuiControlColorPicker
	GuiControlScrollBar
	GuiControlStatusBar
)

type GuiProperty

type GuiProperty int32

GuiProperty the property of a control

const (
	GuiPropertyBorderColorNormal GuiProperty = iota
	GuiPropertyBaseColorNormal
	GuiPropertyTextColorNormal
	GuiPropertyBorderColorFocused
	GuiPropertyTextSize    = 16
	GuiPropertyTextSpacing = 17
)

type GuiState

type GuiState int32

GuiState the state of the GUI

const (
	GuiStateNormal GuiState = iota
	GuiStateFocused
	GuiStatePressed
	GuiStateDisabled
)

type GuiTextBoxState

type GuiTextBoxState struct {
	Cursor int32
	Start  int32
	Index  int32
	Select int32
}

GuiTextBoxState keeps the state of active textboxes

func GuiTextBoxGetState

func GuiTextBoxGetState() GuiTextBoxState

GuiTextBoxGetState : Get state for the active textbox

type Image

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) Source: https://github.com/gen2brain/raylib-go/blob/master/raylib/raylib.go

func GenImageCellular

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

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

func GenImageChecked

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

GenImageChecked : Generate image: checked

func GenImageColor

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

GenImageColor : Generate image: plain color

func GenImageGradientH

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

GenImageGradientH : Generate image: horizontal gradient

func GenImageGradientRadial

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

GenImageGradientRadial : Generate image: radial gradient

func GenImageGradientV

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

GenImageGradientV : Generate image: vertical gradient

func GenImagePerlinNoise

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

GenImagePerlinNoise : Generate image: perlin noise

func GenImageWhiteNoise

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

GenImageWhiteNoise : Generate image: white noise

func GetScreenData

func GetScreenData() *Image

GetScreenData : Get pixel data from screen buffer and return an Image (screenshot)

func GetTextureData

func GetTextureData(texture Texture2D) *Image

GetTextureData : Get pixel data from GPU texture and return an Image Recommended to use texture.GetTextureData() instead

func ImageCopy

func ImageCopy(image *Image) *Image

ImageCopy : Create an image duplicate (useful for transformations) Recommended to use image.Copy() instead

func ImageFromImage

func ImageFromImage(image *Image, rec Rectangle) *Image

ImageFromImage : Create an image from another image piece Recommended to use image.(rec) instead

func ImageText

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

ImageText : Create an image from text (default font)

func ImageTextEx

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

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

func LoadImage

func LoadImage(fileName string) *Image

LoadImage : Load image from file into CPU memory (RAM)

func LoadImageEx

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

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

func LoadImageFromGo

func LoadImageFromGo(img image.Image) *Image

LoadImageFromGo Creates a new image from a Go Image

func LoadImagePro

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

LoadImagePro loads raw data wtih parameters

func LoadImageRaw

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

LoadImageRaw : Load image from RAW file data

func (*Image) AlphaClear

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

AlphaClear : Clear alpha channel to desired color

func (*Image) AlphaCrop

func (image *Image) AlphaCrop(threshold float32)

AlphaCrop : Crop image depending on alpha value

func (*Image) AlphaMask

func (image *Image) AlphaMask(alphaMask *Image)

AlphaMask : Apply alpha mask to image

func (*Image) AlphaPremultiply

func (image *Image) AlphaPremultiply()

AlphaPremultiply : Premultiply alpha channel

func (*Image) ColorBrightness

func (image *Image) ColorBrightness(brightness int)

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

func (*Image) ColorContrast

func (image *Image) ColorContrast(contrast float32)

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

func (*Image) ColorGrayscale

func (image *Image) ColorGrayscale()

ColorGrayscale : Modify image color: grayscale

func (*Image) ColorInvert

func (image *Image) ColorInvert()

ColorInvert : Modify image color: invert

func (*Image) ColorReplace

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

ColorReplace : Modify image color: replace color

func (*Image) ColorTint

func (image *Image) ColorTint(color Color)

ColorTint : Modify image color: tint

func (*Image) Copy

func (image *Image) Copy() *Image

Copy : Create an image duplicate (useful for transformations)

func (*Image) CreateMipmaps

func (image *Image) CreateMipmaps()

CreateMipmaps : Generate all mipmap levels for a provided image

func (*Image) Crop

func (image *Image) Crop(crop Rectangle)

Crop : Crop an image to a defined rectangle

func (*Image) Dither

func (image *Image) Dither(rBpp int, gBpp int, bBpp int, aBpp int)

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

func (*Image) Draw

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

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

func (*Image) DrawRectangle

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

DrawRectangle : Draw rectangle within an image

func (*Image) DrawRectangleLines

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

DrawRectangleLines : Draw rectangle lines within an image

func (*Image) DrawText

func (dst *Image) DrawText(position Vector2, text string, fontSize int, color Color)

DrawText : Draw text (default font) within an image (destination)

func (*Image) DrawTextEx

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

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

func (*Image) Export

func (image *Image) Export(fileName string)

Export : Export image data to file

func (*Image) ExportAsCode

func (image *Image) ExportAsCode(fileName string)

ExportAsCode : Export image as code file defining an array of bytes

func (*Image) ExtractPalette

func (image *Image) ExtractPalette(maxPaletteSize int) ([]Color, int)

ExtractPalette : Extract color palette from image to maximum size

func (*Image) FlipHorizontal

func (image *Image) FlipHorizontal()

FlipHorizontal : Flip image horizontally

func (*Image) FlipVertical

func (image *Image) FlipVertical()

FlipVertical : Flip image vertically

func (*Image) FromImage

func (image *Image) FromImage(rec Rectangle) *Image

FromImage : Create an image from another image piece

func (*Image) GenMeshCubicmap

func (cubicmap *Image) GenMeshCubicmap(cubeSize Vector3) *Mesh

GenMeshCubicmap : Generate cubes-based map mesh from image data

func (*Image) GenMeshHeightmap

func (heightmap *Image) GenMeshHeightmap(size Vector3) *Mesh

GenMeshHeightmap : Generate heightmap mesh from image data

func (*Image) GetAlphaBorder

func (image *Image) GetAlphaBorder(threshold float32) Rectangle

GetAlphaBorder : Get image alpha border rectangle

func (*Image) GetPixels

func (image *Image) GetPixels() []Color

GetPixels returns the pixel data from an image as a colour slice.

func (*Image) GetPixelsNormalized

func (image *Image) GetPixelsNormalized() []Vector4

GetPixelsNormalized returns the pixel data from an image as a colour slice.

func (*Image) Resize

func (image *Image) Resize(newWidth int, newHeight int)

Resize : Resize image (Bicubic scaling algorithm)

func (*Image) ResizeCanvas

func (image *Image) ResizeCanvas(newWidth int, newHeight int, offsetX int, offsetY int, color Color)

ResizeCanvas : Resize canvas and fill with color

func (*Image) ResizeNN

func (image *Image) ResizeNN(newWidth int, newHeight int)

ResizeNN : Resize image (Nearest-Neighbor scaling algorithm)

func (*Image) RotateCCW

func (image *Image) RotateCCW()

RotateCCW : Rotate image counter-clockwise 90deg

func (*Image) RotateCW

func (image *Image) RotateCW()

RotateCW : Rotate image clockwise 90deg

func (*Image) SetFormat

func (image *Image) SetFormat(newFormat PixelFormat)

Format : Convert image data to desired format

func (*Image) ToPOT

func (image *Image) ToPOT(fillColor Color)

ToPOT : Convert image to POT (power-of-two)

func (*Image) Unload

func (image *Image) Unload()

Unload : Unload image from CPU memory (RAM)

type Key

type Key uint32

func GetKeyPressed

func GetKeyPressed() Key

GetKeyPressed : Get latest key pressed

type Material

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

	Params *[MaxMaterialParams]float32
}

func LoadMaterialDefault

func LoadMaterialDefault() *Material

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

func (*Material) SetTexture

func (material *Material) SetTexture(mapType MaterialMapType, texture Texture2D)

SetTexture : Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...)

func (*Material) Unload

func (material *Material) Unload()

Unload : Unload material from GPU memory (VRAM)

type MaterialMap

type MaterialMap struct {
	Texture Texture2D
	Color   Color
	Value   float32
}

type MaterialMapType

type MaterialMapType int32
const (
	MapAlbedo MaterialMapType = iota
	MapMetalness
	MapNormal
	MapRoughness
	MapOcclusion
	MapEmission
	MapHeight
	MapCubemap
	MapIrradiance
	MapPrefilter
	MapBRDF
)

type Matrix

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

Matrix A representation of a 4 x 4 matrix

func GetCameraMatrix

func GetCameraMatrix(camera Camera) Matrix

GetCameraMatrix : Returns camera transform matrix (view matrix)

func GetCameraMatrix2D

func GetCameraMatrix2D(camera Camera2D) Matrix

GetCameraMatrix2D : Returns camera 2d transform matrix

func GetMatrixModelview

func GetMatrixModelview() Matrix

GetMatrixModelview : Get internal modelview matrix

func GetMatrixProjection

func GetMatrixProjection() Matrix

GetMatrixProjection : Get internal projection matrix

func NewMatrixFromQuaternion

func NewMatrixFromQuaternion(q Quaternion) Matrix

NewMatrixFromQuaternion creates a new rotation matrix from a quaternion

func NewMatrixFrustum

func NewMatrixFrustum(left, right, bottom, top, near, far float64) Matrix

NewMatrixFrustum creates a new perspective projection matrix

func NewMatrixIdentity

func NewMatrixIdentity() Matrix

NewMatrixIdentity creates a identity

func NewMatrixLookAt

func NewMatrixLookAt(eye, target, up Vector3) Matrix

NewMatrixLookAt creates a matrix to look at a target

func NewMatrixOrtho

func NewMatrixOrtho(left, right, bottom, top, near, far float64) Matrix

NewMatrixOrtho creates a orthographic projection

func NewMatrixPerspective

func NewMatrixPerspective(fovy, aspect, near, far float64) Matrix

NewMatrixPerspective creates a perspective projection matrix. Angles should be provided in radians

func NewMatrixRotate

func NewMatrixRotate(axis Vector3, radians float32) Matrix

NewMatrixRotate creates a rotation matrix based of the acis and radians

func NewMatrixRotateX

func NewMatrixRotateX(radians float32) Matrix

NewMatrixRotateX creates a new matrix that is rotated

func NewMatrixRotateXYZ

func NewMatrixRotateXYZ(radians Vector3) Matrix

NewMatrixRotateXYZ new xyz-rotation matrix (in radians)

func NewMatrixRotateY

func NewMatrixRotateY(radians float32) Matrix

NewMatrixRotateY creates a new matrix that is rotated

func NewMatrixRotateZ

func NewMatrixRotateZ(radians float32) Matrix

NewMatrixRotateZ creates a new matrix that is rotated

func NewMatrixScale

func NewMatrixScale(scale Vector3) Matrix

NewMatrixScale creates a new scalling matrix

func NewMatrixTranslate

func NewMatrixTranslate(x, y, z float32) Matrix

NewMatrixTranslate creates a blank translation matrix

func (Matrix) Add

func (m Matrix) Add(right Matrix) Matrix

Add two matrices

func (Matrix) Decompose

func (m Matrix) Decompose() []float32

Decompose turns a matrix into an slice of floats

func (Matrix) Detrimant

func (m Matrix) Detrimant() float32

Detrimant of the matrix

func (Matrix) Invert

func (m Matrix) Invert() Matrix

Invert the matrix

func (Matrix) Multiply

func (m Matrix) Multiply(right Matrix) Matrix

Multiply two matrix together. Note that order matters.

func (Matrix) Normalize

func (m Matrix) Normalize() Matrix

Normalize calcuates the normal of the matrix

func (Matrix) Subtract

func (m Matrix) Subtract(right Matrix) Matrix

Subtract two matrices

func (Matrix) ToQuaternion

func (m Matrix) ToQuaternion() Quaternion

ToQuaternion turns the rotation matrix into a Quaternion. Alias of newQuaternionFromMatrix

func (Matrix) Trace

func (m Matrix) Trace() float32

Trace of the matrix (sum of values along diagonal)

func (Matrix) Transpose

func (m Matrix) Transpose() Matrix

Transpose the matrix

type Mesh

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 *[MaxMeshVertices]Vector3

	// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
	Texcoords *[MaxMeshTexCoords]Vector2

	// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
	Texcoords2 *[MaxMeshTexCoords]Vector2

	// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
	Normals *[MaxMeshVertices]Vector3

	// Vertex tangents (XYZ - 3 components per vertex) (shader-location = 4)
	Tangents *[MaxMeshVertices]Vector3

	// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
	Colors *[MaxMeshVertices]Color

	// Vertex indices (in case vertex data comes indexed)
	Indices *[MaxMeshIndices]uint16

	AnimVertices *[MaxMeshAnimatedVertices]Vector3
	AnimNormals  *[MaxMeshAnimatedVertices]Vector3
	BoneIds      *[MaxMeshBones]int32
	BoneWeights  *[MaxMeshBones]float32

	// OpenGL Vertex Array Object id
	VaoID uint32

	// OpenGL Vertex Buffer Objects id (7 types of vertex data)
	VboID unsafe.Pointer
}

Mesh is vertex data that is stored in CPU and GPU memory. Note that the values are pointing to C memory

func GenMeshCube

func GenMeshCube(width float32, height float32, length float32) *Mesh

GenMeshCube : Generate cuboid mesh

func GenMeshCubicmap

func GenMeshCubicmap(cubicmap *Image, cubeSize Vector3) *Mesh

GenMeshCubicmap : Generate cubes-based map mesh from image data Recommended to use cubicmap.GenMeshCubicmap(cubeSize) instead

func GenMeshCylinder

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

GenMeshCylinder : Generate cylinder mesh

func GenMeshHeightmap

func GenMeshHeightmap(heightmap *Image, size Vector3) *Mesh

GenMeshHeightmap : Generate heightmap mesh from image data Recommended to use heightmap.GenMeshHeightmap(size) instead

func GenMeshHemiSphere

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

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

func GenMeshKnot

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

GenMeshKnot : Generate trefoil knot mesh

func GenMeshPlane

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

GenMeshPlane : Generate plane mesh (with subdivisions)

func GenMeshPoly

func GenMeshPoly(sides int, radius float32) *Mesh

GenMeshPoly : Generate polygonal mesh

func GenMeshSphere

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

GenMeshSphere : Generate sphere mesh (standard sphere)

func GenMeshTorus

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

GenMeshTorus : Generate torus mesh

func (*Mesh) BoundingBox

func (mesh *Mesh) BoundingBox() BoundingBox

BoundingBox : Compute mesh bounding box limits

func (*Mesh) ComputeBinormals

func (mesh *Mesh) ComputeBinormals()

ComputeBinormals : Compute mesh binormals

func (*Mesh) ComputeTangents

func (mesh *Mesh) ComputeTangents()

ComputeTangents : Compute mesh tangents

func (*Mesh) Export

func (mesh *Mesh) Export(fileName string)

Export : Export mesh data to file

func (*Mesh) Unload

func (mesh *Mesh) Unload()

Unload : Unload mesh from memory (RAM and/or VRAM)

type Model

type Model struct {
	Transform Matrix
	MeshCount int32
	Meshes    *[MaxModelMeshes]Mesh

	MaterialCount int32
	Materials     *[MaxModelMaterials]Material
	MeshMaterial  *int32

	BoneCount int32
	Bones     *[MaxModelBones]BoneInfo
	BindPos   *[MaxModelBinds]Transform
}

func LoadModel

func LoadModel(fileName string) *Model

LoadModel : Load model from files (meshes and materials)

func LoadModelFromMesh

func LoadModelFromMesh(mesh *Mesh) *Model

LoadModelFromMesh : Load model from generated mesh (default material)

func (*Model) IsAnimationValid

func (model *Model) IsAnimationValid(anim *ModelAnimation) bool

IsAnimationValid : Check model animation skeleton match

func (*Model) SetMeshMaterial

func (model *Model) SetMeshMaterial(meshId int, materialId int)

SetMeshMaterial : Set material for a mesh

func (*Model) Unload

func (model *Model) Unload()

Unload : Unload model from memory (RAM and/or VRAM)

func (*Model) UpdateAnimation

func (model *Model) UpdateAnimation(anim *ModelAnimation, frame int)

UpdateAnimation : Update model animation pose

type ModelAnimation

type ModelAnimation struct {
	BoneCount  int32
	Bones      *[]BoneInfo
	FrameCount int32
	FramePoses *[](*[]Transform)
}

func LoadModelAnimations

func LoadModelAnimations(fileName string) ([]ModelAnimation, int32)

LoadModelAnimations : Load model animations from file

func (*ModelAnimation) Unload

func (anim *ModelAnimation) Unload()

Unload : Unload animation data

type MouseButton

type MouseButton int32
const (
	MouseLeftButton MouseButton = iota
	MouseRightButton
	MouseMiddleButton
)

type Music

type Music struct {
	CtxType     int32
	CtxData     unsafe.Pointer
	SampleCount uint32
	LoopCount   uint32
	Stream      AudioStream
}

Music stream type. Anything longer than ~10 seconds should be streamed.

func LoadMusicStream

func LoadMusicStream(fileName string) *Music

LoadMusicStream : Load music stream from file

func (*Music) GetTimeLength

func (music *Music) GetTimeLength() float32

GetTimeLength : Get music time length (in seconds)

func (*Music) GetTimePlayed

func (music *Music) GetTimePlayed() float32

GetTimePlayed : Get current music time played (in seconds)

func (*Music) IsPlaying

func (music *Music) IsPlaying() bool

IsPlaying : Check if music is playing

func (*Music) IsValid

func (music *Music) IsValid() bool

IsValid returns true if the underlying stream has a valid buffer pointer.

func (*Music) PauseStream

func (music *Music) PauseStream()

PauseStream : Pause music playing

func (*Music) PlayStream

func (music *Music) PlayStream()

PlayStream : Start music playing

func (*Music) ResumeStream

func (music *Music) ResumeStream()

ResumeStream : Resume playing paused music

func (*Music) SetLoopCount

func (music *Music) SetLoopCount(count int)

SetLoopCount : Set music loop count (loop repeats)

func (*Music) SetPitch

func (music *Music) SetPitch(pitch float32)

SetPitch : Set pitch for a music (1.0 is base level)

func (*Music) SetVolume

func (music *Music) SetVolume(volume float32)

SetVolume : Set volume for music (1.0 is max level)

func (*Music) StopStream

func (music *Music) StopStream()

StopStream : Stop music playing

func (*Music) Unload

func (music *Music) Unload()

UnloadStream : Unload music stream

func (*Music) UpdateStream

func (music *Music) UpdateStream()

UpdateStream : Updates buffers for music streaming

type NPatchInfo

type NPatchInfo struct {
	SourceRectangle Rectangle
	Left            int32
	Top             int32
	Right           int32
	Bottom          int32
	Type            NPatchType
}

NPatchInfo is the N-Patch layout information

type NPatchType

type NPatchType int32
const (
	NPT9Patch NPatchType = iota
	NPT3PatchVertical
	NPT3PatchHorizontal
)

type PixelFormat

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

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

Quaternion A represntation of rotations that does not suffer from gimbal lock

func NewQuaternionFromAxisAngle

func NewQuaternionFromAxisAngle(axis Vector3, angle float32) Quaternion

NewQuaternionFromAxisAngle creates a quaternion from an axis and its rotation

func NewQuaternionFromEuler

func NewQuaternionFromEuler(euler Vector3) Quaternion

NewQuaternionFromEuler creates a quaternion from euler angles (roll, yaw, pitch)

func NewQuaternionFromMatrix

func NewQuaternionFromMatrix(mat Matrix) Quaternion

NewQuaternionFromMatrix creates a Quaternion from a rotation matrix

func NewQuaternionIdentity

func NewQuaternionIdentity() Quaternion

NewQuaternionIdentity creates a Quaternion Identity (a blank quaternion)

func NewQuaternionVector3ToVector3

func NewQuaternionVector3ToVector3(from, too Vector3) Quaternion

NewQuaternionVector3ToVector3 creates a quaternion that is the angle between 2 vectors

func (Quaternion) Decompose

func (q Quaternion) Decompose() []float32

Decompose the quaternion into a slice of floats

func (Quaternion) Invert

func (q Quaternion) Invert() Quaternion

Invert a quaternions components

func (Quaternion) Length

func (q Quaternion) Length() float32

Length of the quaternion

func (Quaternion) Lerp

func (q Quaternion) Lerp(target Quaternion, amount float32) Quaternion

Lerp a vector towards another vector

func (Quaternion) Multiply

func (q Quaternion) Multiply(q2 Quaternion) Quaternion

Multiply two Quaternion together, doing queraternion mathmatics

func (Quaternion) Nlerp

func (q Quaternion) Nlerp(target Quaternion, amount float32) Quaternion

Nlerp slerp-optimized interpolation between two quaternions

func (Quaternion) Normalize

func (q Quaternion) Normalize() Quaternion

Normalize a quaternion

func (Quaternion) Scale

func (q Quaternion) Scale(scale float32) Quaternion

Scale the quaternion (v * scale)

func (Quaternion) Slerp

func (q Quaternion) Slerp(q2 Quaternion, amount float32) Quaternion

Slerp Spherically Lerped

func (Quaternion) SqrLength

func (q Quaternion) SqrLength() float32

SqrLength is the squared length of the quaternion

func (Quaternion) ToAxisAngle

func (q Quaternion) ToAxisAngle() (Vector3, float32)

ToAxisAngle returns the rotation angle and axis for a given quaternion

func (Quaternion) ToEuler

func (q Quaternion) ToEuler() Vector3

ToEuler turns the quaternion into equivalent euler angles (roll, putch, yaw). Values are returned in Degrees

func (Quaternion) ToMatrix

func (q Quaternion) ToMatrix() Matrix

ToMatrix converts the quaternion into a rotation matrix

func (Quaternion) Transform

func (q Quaternion) Transform(mat Matrix) Quaternion

Transform a quaternion, given a transformation matrix

type Ray

type Ray struct {
	Position  Vector3
	Direction Vector3
}

func GetMouseRay

func GetMouseRay(mousePosition Vector2, camera Camera) Ray

GetMouseRay : Returns a ray trace from mouse position

func NewRay

func NewRay(position, direction Vector3) Ray

type RayHitInfo

type RayHitInfo struct {
	Hit      bool
	Distance float32
	Position Vector3
	Normal   Vector3
}

func GetCollisionRayGround

func GetCollisionRayGround(ray Ray, groundHeight float32) RayHitInfo

GetCollisionRayGround : Get collision info between ray and ground plane (Y-normal plane)

func GetCollisionRayModel

func GetCollisionRayModel(ray Ray, model Model) RayHitInfo

GetCollisionRayModel : Get collision info between ray and model

func GetCollisionRayTriangle

func GetCollisionRayTriangle(ray Ray, p1 Vector3, p2 Vector3, p3 Vector3) RayHitInfo

GetCollisionRayTriangle : Get collision info between ray and triangle

type Rectangle

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

func GetCollisionRec

func GetCollisionRec(rec1 Rectangle, rec2 Rectangle) Rectangle

GetCollisionRec : Get collision rectangle for two rectangles collision

func GetImageAlphaBorder

func GetImageAlphaBorder(image *Image, threshold float32) Rectangle

GetImageAlphaBorder : Get image alpha border rectangle Recommended to use image.GetAlphaBorder(threshold) instead

func GuiTextBoxGetActive

func GuiTextBoxGetActive() Rectangle

GuiTextBoxGetActive : Get bounds of active textbox

func NewRectangle

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

NewRectangle creates a new rect

func NewRectangleFromPositionSize

func NewRectangleFromPositionSize(position, size Vector2) Rectangle

NewRectangleFromPositionSize creates a rectangle out of a position and size

func NewRectangleFromVector4

func NewRectangleFromVector4(vector Vector4) Rectangle

NewRectangleFromVector4 creates a rectangle out of a vector4

func (Rectangle) Center

func (r Rectangle) Center() Vector2

Center gets the center position of the rectangle

func (Rectangle) Contains

func (r Rectangle) Contains(point Vector2) bool

Contains checks if the rectangle contains a point

func (Rectangle) GetOverlapRec

func (rec1 Rectangle) GetOverlapRec(rec2 Rectangle) Rectangle

GetOverlapRec : Get collision rectangle for two rectangles collision Alias of GetCollisionRec

func (Rectangle) Grow

func (r Rectangle) Grow(x, y float32) Rectangle

Grow adds the vector to the width and height of the rectangle.

func (Rectangle) GrowV

func (r Rectangle) GrowV(v Vector2) Rectangle

GrowV adds the vector to the width and height of the rectangle.

func (Rectangle) Lerp

func (r Rectangle) Lerp(target Rectangle, amount float32) Rectangle

Lerp a rectangle to a target rectangle

func (Rectangle) LerpPosition

func (r Rectangle) LerpPosition(pos Vector2, amount float32) Rectangle

LerpPosition a rectangle to a target position

func (Rectangle) MaxPosition

func (r Rectangle) MaxPosition() Vector2

MaxPosition gets the maximum position within the bounds

func (Rectangle) MinPosition

func (r Rectangle) MinPosition() Vector2

MinPosition gets the smallest position the rectangle can be. Alias of Position().

func (Rectangle) Move

func (r Rectangle) Move(x, y float32) Rectangle

Move shifts the rectangle by a value

func (Rectangle) MoveV

func (r Rectangle) MoveV(v Vector2) Rectangle

MoveV shifts the rectangle by a vector

func (Rectangle) Overlaps

func (r Rectangle) Overlaps(rect Rectangle) bool

Overlaps checks if a rectangle overlaps another.

func (Rectangle) Position

func (r Rectangle) Position() Vector2

Position gets the position of the rectangle. Alias of MinPosition().

func (Rectangle) Scale

func (r Rectangle) Scale(scale float32) Rectangle

Scale the width and height of the rectangle

func (Rectangle) SetPosition

func (r Rectangle) SetPosition(v Vector2) Rectangle

SetPosition sets the position of the rectangle

func (Rectangle) SetSize

func (r Rectangle) SetSize(v Vector2) Rectangle

SetSize sets the size of the rectangle

func (Rectangle) Size

func (r Rectangle) Size() Vector2

Size gets the size of the rectangle

func (Rectangle) ToVector4

func (r Rectangle) ToVector4() Vector4

ToVector4 creates a Vector4 out of the rectangle components

type RenderTexture2D

type RenderTexture2D struct {
	Id           uint32
	Texture      Texture2D
	Depth        Texture2D
	DepthTexture bool
}

RenderTexture2D is a texture used for rendering

func LoadRenderTexture

func LoadRenderTexture(width int, height int) RenderTexture2D

LoadRenderTexture : Load texture for rendering (framebuffer)

func (RenderTexture2D) Unload

func (target RenderTexture2D) Unload()

Unload : Unload render texture from GPU memory (VRAM)

type Shader

type Shader struct {
	Id   uint32
	Locs *[MaxShaderLocations]int32
}

func GetShaderDefault

func GetShaderDefault() Shader

GetShaderDefault : Get default shader

func LoadShader

func LoadShader(vsFileName string, fsFileName string) Shader

//The following function has been ommitted because it is only available in OpenGL 1.1 and otherwise useless // It was not worth the effort to write functionality as raylib-convert is unable to parse this function (pointer return)

//LoadText load chars array from text file func LoadText(fileName string) string { return "" }

LoadShader : Load shader from files and bind default locations

func LoadShaderCode

func LoadShaderCode(vsCode string, fsCode string) Shader

LoadShaderCode : Load shader from code strings and bind default locations

func (Shader) GetLocation

func (shader Shader) GetLocation(uniformName string) int

GetLocation : Get shader uniform location

func (*Shader) SetValueFloat32

func (shader *Shader) SetValueFloat32(uniformLoc int, value []float32, uniformType ShaderUniformDataType)

SetValueFloat32 : Set shader uniform value

func (*Shader) SetValueFloat32V

func (shader *Shader) SetValueFloat32V(uniformLoc int, values []float32, uniformType ShaderUniformDataType)

SetValueFloat32V : Sets a vector (array) of uniform values

func (*Shader) SetValueInt32

func (shader *Shader) SetValueInt32(uniformLoc int, value []int32, uniformType ShaderUniformDataType)

SetValueInt32 : Set shader uniform value

func (*Shader) SetValueInt32V

func (shader *Shader) SetValueInt32V(uniformLoc int, values []int32, uniformType ShaderUniformDataType)

SetValueInt32V : Sets a integer vector (array) of uniform values

func (Shader) SetValueMatrix

func (shader Shader) SetValueMatrix(uniformLoc int, mat Matrix)

SetValueMatrix : Set shader uniform value (matrix 4x4)

func (Shader) SetValueTexture

func (shader Shader) SetValueTexture(uniformLoc int, texture Texture2D)

SetValueTexture : Set shader uniform value for texture

func (Shader) Unload

func (shader Shader) Unload()

Unload : Unload shader from GPU memory (VRAM)

type ShaderLocationIndex

type ShaderLocationIndex int32

Shader location point type

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

type ShaderUniformDataType

type ShaderUniformDataType int32
const (
	UniformFloat ShaderUniformDataType = iota
	UniformVec2
	UniformVec3
	UniformVec4
	UniformInt
	UniformIVec2
	UniformIVec3
	UniformIVec4
	UniformSampler2D
)

type Sound

type Sound struct {
	SampleCount uint32
	Stream      AudioStream
}

Sound source type

func LoadSound

func LoadSound(fileName string) *Sound

LoadSound : Load sound from file

func LoadSoundFromWave

func LoadSoundFromWave(wave *Wave) *Sound

LoadSoundFromWave : Load sound from wave data

func (*Sound) IsPlaying

func (sound *Sound) IsPlaying() bool

IsPlaying : Check if a sound is currently playing

func (*Sound) IsValid

func (s *Sound) IsValid() bool

IsValid returns true if the underlying stream has a valid buffer pointer.

func (*Sound) Pause

func (sound *Sound) Pause()

Pause : Pause a sound

func (*Sound) Play

func (sound *Sound) Play()

Play : Play a sound

func (*Sound) PlayMulti

func (sound *Sound) PlayMulti()

PlayMulti : Play a sound (using multichannel buffer pool)

func (*Sound) Resume

func (sound *Sound) Resume()

Resume : Resume a paused sound

func (*Sound) SetPitch

func (sound *Sound) SetPitch(pitch float32)

SetPitch : Set pitch for a sound (1.0 is base level)

func (*Sound) SetVolume

func (sound *Sound) SetVolume(volume float32)

SetVolume : Set volume for a sound (1.0 is max level)

func (*Sound) Stop

func (sound *Sound) Stop()

Stop : Stop playing a sound

func (*Sound) Unload

func (sound *Sound) Unload()

Unload : Unload sound

func (*Sound) Update

func (sound *Sound) Update(data unsafe.Pointer, samplesCount int)

Update : Update sound buffer with new data

type Texture2D

type Texture2D struct {
	Id      uint32
	Width   int32
	Height  int32
	Mipmaps int32
	Format  int32
}

Texture2D stores GPU based textures.

func GenTextureBRDF

func GenTextureBRDF(shader Shader, size int) Texture2D

GenTextureBRDF : Generate BRDF texture

func GenTextureCubemap

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

GenTextureCubemap : Generate cubemap texture from HDR texture

func GenTextureIrradiance

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

GenTextureIrradiance : Generate irradiance texture using cubemap data

func GenTexturePrefilter

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

GenTexturePrefilter : Generate prefilter texture using cubemap data

func GetTextureDefault

func GetTextureDefault() Texture2D

GetTextureDefault : Get default texture

func LoadTexture

func LoadTexture(fileName string) Texture2D

LoadTexture : Load texture from file into GPU memory (VRAM)

func LoadTextureFromGo

func LoadTextureFromGo(image image.Image) Texture2D

LoadTextureFromGo loads image data from image.Image. Uses NewImageFromGoImage.

func LoadTextureFromImage

func LoadTextureFromImage(image *Image) Texture2D

LoadTextureFromImage : Load texture from image data

func (Texture2D) GenTextureMipmaps

func (texture Texture2D) GenTextureMipmaps()

GenTextureMipmaps : Generate GPU mipmaps for a texture

func (Texture2D) GetTextureData

func (texture Texture2D) GetTextureData() *Image

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

func (Texture2D) SetTextureFilter

func (texture Texture2D) SetTextureFilter(filterMode TextureFilterMode)

SetTextureFilter : Set texture scaling filter mode

func (*Texture2D) SetWrap

func (texture *Texture2D) SetWrap(wrapMode TextureWrapMode)

SetWrap : Set texture wrapping mode

func (Texture2D) Unload

func (texture Texture2D) Unload()

Unload : Unload texture from GPU memory (VRAM)

func (*Texture2D) UpdateTexture

func (texture *Texture2D) UpdateTexture(pixels []Color)

UpdateTexture : Update GPU texture with new data

type TextureCubemap

type TextureCubemap Texture2D

TextureCubemap type, actuall the same as a Texture2D

func LoadTextureCubemap

func LoadTextureCubemap(image *Image, layoutType CubemapLayoutType) *TextureCubemap

LoadTextureCubemap : Load cubemap from image, multiple image cubemap layouts supported

func (*TextureCubemap) Unload

func (texture *TextureCubemap) Unload()

Unload : Unload texture from GPU memory (VRAM)

type TextureFilterMode

type TextureFilterMode int32
const (
	FilterPoint TextureFilterMode = iota
	FilterBilinear
	FilterTrilinear
	FilterAnisotropic4x
	FilterAnisotropic8x
	FilterAnisotropic16x
)

type TextureWrapMode

type TextureWrapMode int32
const (
	WrapRepeat TextureWrapMode = iota
	WrapClamp
	WrapMirrorRepeat
	WrapMirrorClamp
)

type TraceLogType

type TraceLogType int32
const (
	LogAll TraceLogType = iota
	LogTrace
	LogDebug
	LogInfo
	LogWarning
	LogError
	LogFatal
	LogNone
)

func (TraceLogType) ToString

func (v TraceLogType) ToString() string

ToString converts the TraceLogType to a string. This can be useful for custom loggers. seealso: ToUniformedString for a uniformed formatting.

func (TraceLogType) ToUniformedString

func (v TraceLogType) ToUniformedString() string

ToUniformedString converts the trace log type to a string of fixed length (5) and all captials.

type Transform

type Transform struct {
	Translation Vector3
	Rotation    Quaternion
	Scale       Vector3
}

Transformation properties

func NewTransform

func NewTransform(translation Vector3, rotation Quaternion, scale Vector3) Transform

NewTransform creates a new transform

type Unloadable

type Unloadable interface {
	Unload()
}

Unloadable is any object that has a Unload function and needs to be freed when it has finished being used.

type Vector

type Vector interface {
	Decompose() []float32
}

Vector a interface for any vector

type Vector2

type Vector2 struct {
	X float32
	Y float32
}

Vector2 a 2 dimensional vector

func DrawLineStrip

func DrawLineStrip(points Vector2, numPoints int, color Color) Vector2

DrawLineStrip : Draw lines sequence

func DrawTriangleFan

func DrawTriangleFan(points Vector2, numPoints int, color Color) Vector2

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

func DrawTriangleStrip

func DrawTriangleStrip(points Vector2, pointsCount int, color Color) Vector2

DrawTriangleStrip : Draw a triangle strip defined by points

func GetGestureDragVector

func GetGestureDragVector() Vector2

GetGestureDragVector : Get gesture drag vector

func GetGesturePinchVector

func GetGesturePinchVector() Vector2

GetGesturePinchVector : Get gesture pinch delta

func GetMousePosition

func GetMousePosition() Vector2

GetMousePosition : Returns mouse position XY

func GetScreenToWorld2D

func GetScreenToWorld2D(position Vector2, camera Camera2D) Vector2

GetScreenToWorld2D : Returns the world space position for a 2d camera screen space position

func GetTouchPosition

func GetTouchPosition(index int) Vector2

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

func GetWindowPosition

func GetWindowPosition() Vector2

GetWindowPosition : Get window position XY on monitor

func GetWorldToScreen

func GetWorldToScreen(position Vector3, camera Camera) Vector2

GetWorldToScreen : Returns the screen space position for a 3d world space position

func GetWorldToScreen2D

func GetWorldToScreen2D(position Vector2, camera Camera2D) Vector2

GetWorldToScreen2D : Returns the screen space position for a 2d camera world space position

func GuiGrid

func GuiGrid(bounds Rectangle, spacing float32, subdivs int) Vector2

GuiGrid : Grid control

func GuiTextBoxGetSelection

func GuiTextBoxGetSelection() Vector2

GuiTextBoxGetSelection : Get selection of active textbox (x - selection start y - selection length)

func MeasureTextEx

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

MeasureTextEx : Measure string size for Font

func NewVector2

func NewVector2(x, y float32) Vector2

NewVector2 creates a new vector with defined components

func NewVector2Right

func NewVector2Right() Vector2

NewVector2Right creates a normalized vector pointing right

func NewVector2Up

func NewVector2Up() Vector2

NewVector2Up creates a normalized vector pointing up

func NewVector2Zero

func NewVector2Zero() Vector2

NewVector2Zero creates a vector with all components equaling 0

func (Vector2) Add

func (v Vector2) Add(v2 Vector2) Vector2

Add two vectors (v1 + v2)

func (Vector2) Angle

func (v Vector2) Angle(v2 Vector2) float32

Angle the vector creates with another vector

func (Vector2) Decompose

func (v Vector2) Decompose() []float32

Decompose the vector into a slice of floats

func (Vector2) Distance

func (v Vector2) Distance(v2 Vector2) float32

Distance between two vectors

func (Vector2) Divide

func (v Vector2) Divide(d float32) Vector2

Divide a vector by a value (v / d)

func (Vector2) DivideV

func (v Vector2) DivideV(v2 Vector2) Vector2

DivideV a vector by another vecotr (v / v2)

func (Vector2) DotProduct

func (v Vector2) DotProduct(v2 Vector2) float32

DotProduct of the vector

func (Vector2) Length

func (v Vector2) Length() float32

Length of the vector

func (Vector2) Lerp

func (v Vector2) Lerp(target Vector2, amount float32) Vector2

Lerp a vector towards another vector

func (Vector2) Max

func (v Vector2) Max(v2 Vector2) Vector2

Max value for each pair of components

func (Vector2) Min

func (v Vector2) Min(v2 Vector2) Vector2

Min value for each pair of components

func (Vector2) Multiply

func (v Vector2) Multiply(v2 Vector2) Vector2

Multiply a vector by another vector

func (Vector2) Negate

func (v Vector2) Negate() Vector2

Negate or Inverts a vector

func (Vector2) Normalize

func (v Vector2) Normalize() Vector2

Normalize a vector

func (Vector2) Perpendicular

func (v Vector2) Perpendicular() Vector2

Perpendicular to this vector

func (Vector2) Reflect

func (v Vector2) Reflect(mirrorNormal Vector2) Vector2

Reflect a vector. The mirror normal can be invisioned as a mirror perpendicular to the surface that is hit.

func (Vector2) RotateByRadians

func (v Vector2) RotateByRadians(radians float32) Vector2

RotateByRadians rotates the vector in radians. Use Deg2Rad to convert degress into radians.

func (Vector2) Scale

func (v Vector2) Scale(scale float32) Vector2

Scale the vector (v * scale)

func (Vector2) SqrLength

func (v Vector2) SqrLength() float32

SqrLength is the squared length of the vector

func (Vector2) Subtract

func (v Vector2) Subtract(v2 Vector2) Vector2

Subtract two vectors (v1 - v2)

func (Vector2) ToVector3

func (v Vector2) ToVector3() Vector3

ToVector3 converts this vector2 into a vector3

type Vector3

type Vector3 struct {
	X float32
	Y float32
	Z float32
}

Vector3 a 3 dimensional vector

func CheckCollisionRaySphereEx

func CheckCollisionRaySphereEx(ray Ray, center Vector3, radius float32, collisionPoint Vector3) (bool, Vector3)

CheckCollisionRaySphereEx : Detect collision between ray and sphere, returns collision point

func ColorToHSV

func ColorToHSV(color Color) Vector3

ColorToHSV : Returns HSV values for a Color

func NewVector3

func NewVector3(x, y, z float32) Vector3

NewVector3 creates a new vector with defined components

func NewVector3Forward

func NewVector3Forward() Vector3

NewVector3Forward creates a normalized vector pointing forwards

func NewVector3Right

func NewVector3Right() Vector3

NewVector3Right creates a normalized vector pointing right

func NewVector3Up

func NewVector3Up() Vector3

NewVector3Up creates a normalized vector pointing up

func NewVector3Zero

func NewVector3Zero() Vector3

NewVector3Zero creates a vector with all components equaling 0

func (Vector3) Add

func (v Vector3) Add(v2 Vector3) Vector3

Add two vectors (v1 + v2)

func (Vector3) Angle

func (v Vector3) Angle(v2 Vector3) float32

Angle the vector creates with another vector

func (Vector3) Barycenter

func (v Vector3) Barycenter(a, b, c Vector3) Vector3

Barycenter computers the coordinates (u, v, w) for the vector with respect to triangle (a, b, c). Assumes vector is on plane with triangle

func (Vector3) CrossProduct

func (v Vector3) CrossProduct(v2 Vector3) Vector3

CrossProduct of the vector

func (Vector3) Decompose

func (v Vector3) Decompose() []float32

Decompose the vector into a slice of floats

func (Vector3) Distance

func (v Vector3) Distance(v2 Vector3) float32

Distance between two vectors

func (Vector3) Divide

func (v Vector3) Divide(d float32) Vector3

Divide a vector by a value (v / d)

func (Vector3) DivideV

func (v Vector3) DivideV(v2 Vector3) Vector3

DivideV a vector by another vecotr (v / v2)

func (Vector3) DotProduct

func (v Vector3) DotProduct(v2 Vector3) float32

DotProduct of the vector

func (Vector3) Length

func (v Vector3) Length() float32

Length of the vector

func (Vector3) Lerp

func (v Vector3) Lerp(target Vector3, amount float32) Vector3

Lerp a vector towards another vector

func (Vector3) Max

func (v Vector3) Max(v2 Vector3) Vector3

Max value for each pair of components

func (Vector3) Min

func (v Vector3) Min(v2 Vector3) Vector3

Min value for each pair of components

func (Vector3) Multiply

func (v Vector3) Multiply(v2 Vector3) Vector3

Multiply a vector by another vector

func (Vector3) Negate

func (v Vector3) Negate() Vector3

Negate or Inverts a vector

func (Vector3) Normalize

func (v Vector3) Normalize() Vector3

Normalize a vector

func (*Vector3) OrthoNormalize

func (v *Vector3) OrthoNormalize(v2 *Vector3)

OrthoNormalize makes two vectors normalized and orthogonal to each other

func (Vector3) Perpendicular

func (v Vector3) Perpendicular() Vector3

Perpendicular to this vector

func (Vector3) QuaternionToo

func (v Vector3) QuaternionToo(v2 Vector3) Quaternion

QuaternionToo calculates the Quaternion between the current vector and the next

func (Vector3) Reflect

func (v Vector3) Reflect(mirrorNormal Vector3) Vector3

Reflect a vector. The mirror normal can be invisioned as a mirror perpendicular to the surface that is hit.

func (Vector3) RotateByQuaternion

func (v Vector3) RotateByQuaternion(q Quaternion) Vector3

RotateByQuaternion rotates the vector

func (Vector3) Scale

func (v Vector3) Scale(scale float32) Vector3

Scale the vector (v * scale)

func (Vector3) SqrLength

func (v Vector3) SqrLength() float32

SqrLength is the squared length of the vector

func (Vector3) Subtract

func (v Vector3) Subtract(v2 Vector3) Vector3

Subtract two vectors (v1 - v2)

func (Vector3) ToVector4

func (v Vector3) ToVector4() Vector4

ToVector4 coverts the vector3 into a vector4

func (Vector3) Transform

func (v Vector3) Transform(m Matrix) Vector3

Transform a vector by a given matrix

type Vector4

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

Vector4 A 4 dimensional vector

func ColorNormalize

func ColorNormalize(color Color) Vector4

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

func GetImageDataNormalized

func GetImageDataNormalized(image *Image) []Vector4

GetImageDataNormalized : Get pixel data from image as a Color slice Recommended to use image.GetPixelsNormalized instead.

func NewVector4

func NewVector4(x, y, z, w float32) Vector4

NewVector4 creates a new vector with defined components

func NewVector4Zero

func NewVector4Zero() Vector4

NewVector4Zero creates a vector with all components equaling 0

func (Vector4) Add

func (v Vector4) Add(v2 Vector4) Vector4

Add two vectors (v1 + v2)

func (Vector4) Decompose

func (v Vector4) Decompose() []float32

Decompose the vector into a slice of floats

func (Vector4) Distance

func (v Vector4) Distance(v2 Vector4) float32

Distance between two vectors

func (Vector4) Divide

func (v Vector4) Divide(d float32) Vector4

Divide a vector by a value (v / d)

func (Vector4) DivideV

func (v Vector4) DivideV(v2 Vector4) Vector4

DivideV a vector by another vecotr (v / v2)

func (Vector4) DotProduct

func (v Vector4) DotProduct(v2 Vector4) float32

DotProduct of the vector

func (Vector4) Length

func (v Vector4) Length() float32

Length of the vector

func (Vector4) Lerp

func (v Vector4) Lerp(target Vector4, amount float32) Vector4

Lerp a vector towards another vector

func (Vector4) Max

func (v Vector4) Max(v2 Vector4) Vector4

Max value for each pair of components

func (Vector4) Min

func (v Vector4) Min(v2 Vector4) Vector4

Min value for each pair of components

func (Vector4) Multiply

func (v Vector4) Multiply(v2 Vector4) Vector4

Multiply a vector by another vector

func (Vector4) Negate

func (v Vector4) Negate() Vector4

Negate or Inverts a vector

func (Vector4) Normalize

func (v Vector4) Normalize() Vector4

Normalize a vector

func (Vector4) Scale

func (v Vector4) Scale(scale float32) Vector4

Scale the vector (v * scale)

func (Vector4) SqrLength

func (v Vector4) SqrLength() float32

SqrLength is the squared length of the vector

func (Vector4) Subtract

func (v Vector4) Subtract(v2 Vector4) Vector4

Subtract two vectors (v1 - v2)

type VrDeviceInfo

type VrDeviceInfo struct {
	HorizontalResolution       int32
	VerticalResolution         int32
	HorizontalScreenSize       float32
	VerticalScreenSize         float32
	VerticalScreenCenter       float32
	EyeToScreenDistance        float32
	LensSeperationDistance     float32
	InterpupillaryDistance     float32
	LensDistortionValues       [4]float32
	ChromaAberrationCorrection [4]float32
}

type Wave

type Wave struct {
	SampleCount uint32
	SampleRate  uint32
	SampleSize  uint32
	Channels    uint32
	// contains filtered or unexported fields
}

Wave defines audio wave data

func LoadWave

func LoadWave(fileName string) *Wave

LoadWave : Load wave data from file

func WaveCopy

func WaveCopy(wave *Wave) *Wave

WaveCopy : Copy a wave to a new wave Recommended to use wave.Copy() instead

func (*Wave) Copy

func (wave *Wave) Copy() *Wave

Copy : Copy a wave to a new wave

func (*Wave) Crop

func (wave *Wave) Crop(initSample int, finalSample int)

Crop : Crop a wave to defined samples range

func (*Wave) Export

func (wave *Wave) Export(fileName string)

Export : Export wave data to file

func (*Wave) ExportAsCode

func (wave *Wave) ExportAsCode(fileName string)

ExportAsCode : Export wave sample data to code (.h)

func (*Wave) Format

func (wave *Wave) Format(sampleRate int, sampleSize int, channels int)

Format : Convert wave data to desired format

func (*Wave) Unload

func (wave *Wave) Unload()

Unload : Unload wave data

Jump to

Keyboard shortcuts

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