Documentation ¶
Index ¶
- Constants
- func BeginBlendMode(mode BlendMode)
- func BeginDrawing()
- func BeginMode2D(camera Camera2D)
- func BeginMode3D(camera Camera3D)
- func BeginScissorMode(x, y, width, height c.Int)
- func BeginShaderMode(shader Shader)
- func ClearBackground(color Color)
- func ClearWindowState(flags c.Int)
- func CloseWindow()
- func DirectoryExists(dirPath *c.Char) bool
- func DisableCursor()
- func DisableEventWaiting()
- func DrawRectangle(posX, posY, width, height c.Int, color Color)
- func DrawText(text *c.Char, posX, posY, fontSize c.Int, color Color)
- func EnableCursor()
- func EnableEventWaiting()
- func EndBlendMode()
- func EndDrawing()
- func EndMode2D()
- func EndMode3D()
- func EndScissorMode()
- func EndShaderMode()
- func EndTextureMode()
- func FileExists(fileName *c.Char) bool
- func GetCharPressed() c.Int
- func GetClipboardText() *c.Char
- func GetCurrentMonitor() c.Int
- func GetFPS() c.Int
- func GetFrameTime() c.Float
- func GetKeyPressed() c.Int
- func GetMonitorCount() c.Int
- func GetMonitorHeight(monitor c.Int) c.Int
- func GetMonitorName(monitor c.Int) *c.Char
- func GetMonitorPhysicalHeight(monitor c.Int) c.Int
- func GetMonitorPhysicalWidth(monitor c.Int) c.Int
- func GetMonitorRefreshRate(monitor c.Int) c.Int
- func GetMonitorWidth(monitor c.Int) c.Int
- func GetRandomValue(min c.Int, max c.Int) c.Int
- func GetRenderHeight() c.Int
- func GetRenderWidth() c.Int
- func GetScreenHeight() c.Int
- func GetScreenWidth() c.Int
- func GetTime() c.Double
- func GetWindowHandle() c.Pointer
- func HideCursor()
- func InitWindow(width, height c.Int, title *c.Char)
- func IsCursorHidden() bool
- func IsCursorOnScreen() bool
- func IsFileExtension(fileName *c.Char, ext *c.Char) bool
- func IsKeyDown(key c.Int) bool
- func IsKeyPressed(key c.Int) bool
- func IsKeyPressedRepeat(key c.Int) bool
- func IsKeyReleased(key c.Int) bool
- func IsKeyUp(key c.Int) bool
- func IsWindowFocused() bool
- func IsWindowFullscreen() bool
- func IsWindowHidden() bool
- func IsWindowMaximized() bool
- func IsWindowMinimized() bool
- func IsWindowReady() bool
- func IsWindowResized() bool
- func IsWindowState(flag c.Int) bool
- func MaximizeWindow()
- func MinimizeWindow()
- func RestoreWindow()
- func SetClipboardText(text *c.Char)
- func SetExitKey(key c.Int)
- func SetRandomSeed(seed c.Uint)
- func SetTargetFPS(fps c.Int)
- func SetTraceLogLevel(logLevel int)
- func SetWindowFocused()
- func SetWindowIcon(icon Image)
- func SetWindowIcons(icons *Image, count c.Int)
- func SetWindowMinSize(width, height c.Int)
- func SetWindowMonitor(monitor c.Int)
- func SetWindowOpacity(opacity c.Float)
- func SetWindowPosition(x, y c.Int)
- func SetWindowSize(width, height c.Int)
- func SetWindowState(flags c.Int)
- func SetWindowTitle(title *c.Char)
- func ShowCursor()
- func ToggleFullscreen()
- func TraceLog(logLevel int, text *c.Char, __llgo_va_list ...any)
- func UpdateCamera(camera *Camera, mode c.Int)
- func UpdateCameraPro(camera *Camera, movement, rotation Vector3, zoom float32)
- func WindowShouldClose() bool
- type BlendMode
- type Camera
- type Camera2D
- type Camera3D
- type Color
- type Image
- type Quaternion
- type Shader
- type Vector2
- type Vector3
- type Vector4
Constants ¶
const ( KEY_NULL = 0 // Key: NULL, used for no key pressed // Alphanumeric keys KEY_APOSTROPHE = 39 // Key: ' KEY_COMMA = 44 // Key: , KEY_MINUS = 45 // Key: - KEY_PERIOD = 46 // Key: . KEY_SLASH = 47 // Key: / KEY_ZERO = 48 // Key: 0 KEY_ONE = 49 // Key: 1 KEY_TWO = 50 // Key: 2 KEY_THREE = 51 // Key: 3 KEY_FOUR = 52 // Key: 4 KEY_FIVE = 53 // Key: 5 KEY_SIX = 54 // Key: 6 KEY_SEVEN = 55 // Key: 7 KEY_EIGHT = 56 // Key: 8 KEY_NINE = 57 // Key: 9 KEY_SEMICOLON = 59 // Key: ; KEY_EQUAL = 61 // Key: = KEY_A = 65 // Key: A | a KEY_B = 66 // Key: B | b KEY_C = 67 // Key: C | c KEY_D = 68 // Key: D | d KEY_E = 69 // Key: E | e KEY_F = 70 // Key: F | f KEY_G = 71 // Key: G | g KEY_H = 72 // Key: H | h KEY_I = 73 // Key: I | i KEY_J = 74 // Key: J | j KEY_K = 75 // Key: K | k KEY_L = 76 // Key: L | l KEY_M = 77 // Key: M | m KEY_N = 78 // Key: N | n KEY_O = 79 // Key: O | o KEY_P = 80 // Key: P | p KEY_Q = 81 // Key: Q | q KEY_R = 82 // Key: R | r KEY_S = 83 // Key: S | s KEY_T = 84 // Key: T | t KEY_U = 85 // Key: U | u KEY_V = 86 // Key: V | v KEY_W = 87 // Key: W | w KEY_X = 88 // Key: X | x KEY_Y = 89 // Key: Y | y KEY_Z = 90 // Key: Z | z KEY_LEFT_BRACKET = 91 // Key: [ KEY_BACKSLASH = 92 // Key: '\' KEY_RIGHT_BRACKET = 93 // Key: ] KEY_GRAVE = 96 // Key: ` // Function keys KEY_SPACE = 32 // Key: Space KEY_ESCAPE = 256 // Key: Esc KEY_ENTER = 257 // Key: Enter KEY_TAB = 258 // Key: Tab KEY_BACKSPACE = 259 // Key: Backspace KEY_INSERT = 260 // Key: Ins KEY_DELETE = 261 // Key: Del KEY_RIGHT = 262 // Key: Cursor right KEY_LEFT = 263 // Key: Cursor left KEY_DOWN = 264 // Key: Cursor down KEY_UP = 265 // Key: Cursor up KEY_PAGE_UP = 266 // Key: Page up KEY_PAGE_DOWN = 267 // Key: Page down KEY_HOME = 268 // Key: Home KEY_END = 269 // Key: End KEY_CAPS_LOCK = 280 // Key: Caps lock KEY_SCROLL_LOCK = 281 // Key: Scroll down KEY_NUM_LOCK = 282 // Key: Num lock KEY_PRINT_SCREEN = 283 // Key: Print screen KEY_PAUSE = 284 // Key: Pause KEY_F1 = 290 // Key: F1 KEY_F2 = 291 // Key: F2 KEY_F3 = 292 // Key: F3 KEY_F4 = 293 // Key: F4 KEY_F5 = 294 // Key: F5 KEY_F6 = 295 // Key: F6 KEY_F7 = 296 // Key: F7 KEY_F8 = 297 // Key: F8 KEY_F9 = 298 // Key: F9 KEY_F10 = 299 // Key: F10 KEY_F11 = 300 // Key: F11 KEY_F12 = 301 // Key: F12 KEY_LEFT_SHIFT = 340 // Key: Shift left KEY_LEFT_CONTROL = 341 // Key: Control left KEY_LEFT_ALT = 342 // Key: Alt left KEY_LEFT_SUPER = 343 // Key: Super left KEY_RIGHT_SHIFT = 344 // Key: Shift right KEY_RIGHT_CONTROL = 345 // Key: Control right KEY_RIGHT_ALT = 346 // Key: Alt right KEY_RIGHT_SUPER = 347 // Key: Super right KEY_KB_MENU = 348 // Key: KB menu // Keypad keys KEY_KP_0 = 320 // Key: Keypad 0 KEY_KP_1 = 321 // Key: Keypad 1 KEY_KP_2 = 322 // Key: Keypad 2 KEY_KP_3 = 323 // Key: Keypad 3 KEY_KP_4 = 324 // Key: Keypad 4 KEY_KP_5 = 325 // Key: Keypad 5 KEY_KP_6 = 326 // Key: Keypad 6 KEY_KP_7 = 327 // Key: Keypad 7 KEY_KP_8 = 328 // Key: Keypad 8 KEY_KP_9 = 329 // Key: Keypad 9 KEY_KP_DECIMAL = 330 // Key: Keypad . KEY_KP_DIVIDE = 331 // Key: Keypad / KEY_KP_MULTIPLY = 332 // Key: Keypad * KEY_KP_SUBTRACT = 333 // Key: Keypad - KEY_KP_ADD = 334 // Key: Keypad + KEY_KP_ENTER = 335 // Key: Keypad Enter KEY_KP_EQUAL = 336 // Key: Keypad = // Android key buttons KEY_BACK = 4 // Key: Android back button KEY_MENU = 82 // Key: Android menu button KEY_VOLUME_UP = 24 // Key: Android volume up button KEY_VOLUME_DOWN = 25 // Key: Android volume down button )
Keyboard keys (US keyboard layout) required keys for alternative layouts
const ( LIGHTGRAY = Color(200 | 200<<8 | 200<<16 | 255<<24) // Light Gray GRAY = Color(130 | 130<<8 | 130<<16 | 255<<24) // Gray DARKGRAY = Color(80 | 80<<8 | 80<<16 | 255<<24) // Dark Gray YELLOW = Color(253 | 249<<8 | 0<<16 | 255<<24) // Yellow GOLD = Color(255 | 203<<8 | 0<<16 | 255<<24) // Gold ORANGE = Color(255 | 161<<8 | 0<<16 | 255<<24) // Orange PINK = Color(255 | 109<<8 | 194<<16 | 255<<24) // Pink RED = Color(230 | 41<<8 | 55<<16 | 255<<24) // Red MAROON = Color(190 | 33<<8 | 55<<16 | 255<<24) // Maroon GREEN = Color(0 | 228<<8 | 48<<16 | 255<<24) // Green LIME = Color(0 | 158<<8 | 47<<16 | 255<<24) // Lime DARKGREEN = Color(0 | 117<<8 | 44<<16 | 255<<24) // Dark Green SKYBLUE = Color(102 | 191<<8 | 255<<16 | 255<<24) // Sky Blue BLUE = Color(0 | 121<<8 | 241<<16 | 255<<24) // Blue DARKBLUE = Color(0 | 82<<8 | 172<<16 | 255<<24) // Dark Blue PURPLE = Color(200 | 122<<8 | 255<<16 | 255<<24) // Purple VIOLET = Color(135 | 60<<8 | 190<<16 | 255<<24) // Violet DARKPURPLE = Color(112 | 31<<8 | 126<<16 | 255<<24) // Dark Purple BEIGE = Color(211 | 176<<8 | 131<<16 | 255<<24) // Beige BROWN = Color(127 | 106<<8 | 79<<16 | 255<<24) // Brown DARKBROWN = Color(76 | 63<<8 | 47<<16 | 255<<24) // Dark Brown WHITE = Color(255 | 255<<8 | 255<<16 | 255<<24) // White BLACK = Color(0 | 0<<8 | 0<<16 | 255<<24) // Black BLANK = Color(0 | 0<<8 | 0<<16 | 0<<24) // Blank (Transparent) MAGENTA = Color(255 | 0<<8 | 255<<16 | 255<<24) // Magenta RAYWHITE = Color(245 | 245<<8 | 245<<16 | 255<<24) // My own White (raylib logo) )
const (
LLGoPackage = "link: $(pkg-config --libs raylib); -lraylib"
)
Variables ¶
This section is empty.
Functions ¶
func BeginBlendMode ¶
func BeginBlendMode(mode BlendMode)
Begin blending mode (alpha, additive, multiplied, subtract, custom)
func BeginScissorMode ¶
Begin scissor mode (define screen area for following drawing)
func ClearBackground ¶
func ClearBackground(color Color)
Set background color (framebuffer clear color)
func ClearWindowState ¶
func CloseWindow ¶
func CloseWindow()
func DisableCursor ¶
func DisableCursor()
func DisableEventWaiting ¶
func DisableEventWaiting()
Disable waiting for events on EndDrawing(), automatic events polling
func DrawRectangle ¶
Draw a color-filled rectangle
func EnableCursor ¶
func EnableCursor()
func EnableEventWaiting ¶
func EnableEventWaiting()
Enable waiting for events on EndDrawing(), no automatic event polling
func GetCharPressed ¶
func GetClipboardText ¶
func GetFrameTime ¶
Returns time in seconds for last frame drawn (delta time)
func GetKeyPressed ¶
func GetScreenHeight ¶
func GetScreenWidth ¶
func GetWindowHandle ¶
func HideCursor ¶
func HideCursor()
func IsCursorHidden ¶
func IsCursorHidden() bool
func IsCursorOnScreen ¶
func IsCursorOnScreen() bool
func IsFileExtension ¶
Check file extension (including point: .png, .wav)
func IsKeyPressed ¶
func IsKeyPressedRepeat ¶
func IsKeyReleased ¶
func IsWindowFocused ¶
func IsWindowFocused() bool
func IsWindowFullscreen ¶
func IsWindowFullscreen() bool
func IsWindowHidden ¶
func IsWindowHidden() bool
func IsWindowMaximized ¶
func IsWindowMaximized() bool
func IsWindowMinimized ¶
func IsWindowMinimized() bool
func IsWindowReady ¶
func IsWindowReady() bool
func IsWindowResized ¶
func IsWindowResized() bool
func IsWindowState ¶
func MaximizeWindow ¶
func MaximizeWindow()
func MinimizeWindow ¶
func MinimizeWindow()
func RestoreWindow ¶
func RestoreWindow()
func SetClipboardText ¶
func SetExitKey ¶
func SetRandomSeed ¶
func SetTraceLogLevel ¶
func SetTraceLogLevel(logLevel int)
Set the current threshold (minimum) log level
func SetWindowFocused ¶
func SetWindowFocused()
func SetWindowIcon ¶
func SetWindowIcon(icon Image)
func SetWindowIcons ¶
func SetWindowMinSize ¶
func SetWindowMonitor ¶
func SetWindowOpacity ¶
func SetWindowPosition ¶
func SetWindowSize ¶
func SetWindowState ¶
func SetWindowTitle ¶
func ShowCursor ¶
func ShowCursor()
func ToggleFullscreen ¶
func ToggleFullscreen()
func UpdateCamera ¶
Update camera position for selected mode
func UpdateCameraPro ¶
Update camera movement/rotation
func WindowShouldClose ¶
func WindowShouldClose() bool
Types ¶
type BlendMode ¶
Color blending modes (pre-defined)
const ( BLEND_ALPHA BlendMode = iota // Blend textures considering alpha (default) BLEND_ADDITIVE // Blend textures adding colors BLEND_MULTIPLIED // Blend textures multiplying colors BLEND_ADD_COLORS // Blend textures adding colors (alternative) BLEND_SUBTRACT_COLORS // Blend textures subtracting colors (alternative) BLEND_ALPHA_PREMULTIPLY // Blend premultiplied textures considering alpha BLEND_CUSTOM // Blend textures using custom src/dst factors (use rlSetBlendFactors()) BLEND_CUSTOM_SEPARATE // Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate()) )
type Camera2D ¶
type Camera2D struct { Offset Vector2 // Camera offset (displacement from target) Target Vector2 // Camera target (rotation and zoom origin) Rotation float32 // Camera rotation in degrees Zoom float32 // Camera zoom (scaling), should be 1.0f by default }
Camera2D, defines position/orientation in 2d space
type Camera3D ¶
type Camera3D struct { Position Vector3 // Camera position Target Vector3 // Camera target it looks-at Up Vector3 // Camera up vector (rotation over its axis) Fovy float32 // Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic Projection c.Int // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC }
Camera, defines position/orientation in 3d space
type Image ¶
type Image struct { Data c.Pointer // Image raw data Width c.Int // Image base width Height c.Int // Image base height Mipmaps c.Int // Mipmap levels, 1 by default Format c.Int // Data format (PixelFormat type) }
Image, pixel data stored in CPU memory (RAM)
type Shader ¶
type Shader struct { Id c.Uint // Shader program id Locs *c.Int // Shader locations array (RL_MAX_SHADER_LOCATIONS) }
Shader
type Vector2 ¶
Vector2, 2 components
func GetMonitorPosition ¶
Get specified monitor position
func GetWindowPosition ¶
func GetWindowPosition() Vector2
func GetWindowScaleDPI ¶
func GetWindowScaleDPI() Vector2