id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
listlengths
21
1.41k
docstring
stringlengths
6
2.61k
docstring_tokens
listlengths
3
215
sha
stringlengths
40
40
url
stringlengths
85
252
150,900
labstack/gommon
color/color.go
Printf
func (c *Color) Printf(format string, args ...interface{}) { fmt.Fprintf(c.output, format, args...) }
go
func (c *Color) Printf(format string, args ...interface{}) { fmt.Fprintf(c.output, format, args...) }
[ "func", "(", "c", "*", "Color", ")", "Printf", "(", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "fmt", ".", "Fprintf", "(", "c", ".", "output", ",", "format", ",", "args", "...", ")", "\n", "}" ]
// Printf is analogous to `fmt.Printf` with termial detection.
[ "Printf", "is", "analogous", "to", "fmt", ".", "Printf", "with", "termial", "detection", "." ]
82ef680aef5189b68682876cf70d09daa4ac0f51
https://github.com/labstack/gommon/blob/82ef680aef5189b68682876cf70d09daa4ac0f51/color/color.go#L172-L174
150,901
caarlos0/env
env.go
ParseWithFuncs
func ParseWithFuncs(v interface{}, funcMap CustomParsers) error { ptrRef := reflect.ValueOf(v) if ptrRef.Kind() != reflect.Ptr { return ErrNotAStructPtr } ref := ptrRef.Elem() if ref.Kind() != reflect.Struct { return ErrNotAStructPtr } var parsers = defaultCustomParsers() for k, v := range funcMap { parse...
go
func ParseWithFuncs(v interface{}, funcMap CustomParsers) error { ptrRef := reflect.ValueOf(v) if ptrRef.Kind() != reflect.Ptr { return ErrNotAStructPtr } ref := ptrRef.Elem() if ref.Kind() != reflect.Struct { return ErrNotAStructPtr } var parsers = defaultCustomParsers() for k, v := range funcMap { parse...
[ "func", "ParseWithFuncs", "(", "v", "interface", "{", "}", ",", "funcMap", "CustomParsers", ")", "error", "{", "ptrRef", ":=", "reflect", ".", "ValueOf", "(", "v", ")", "\n", "if", "ptrRef", ".", "Kind", "(", ")", "!=", "reflect", ".", "Ptr", "{", "r...
// ParseWithFuncs is the same as `Parse` except it also allows the user to pass // in custom parsers.
[ "ParseWithFuncs", "is", "the", "same", "as", "Parse", "except", "it", "also", "allows", "the", "user", "to", "pass", "in", "custom", "parsers", "." ]
2ae6b6e118789b55aae151656169a4a07d4bff42
https://github.com/caarlos0/env/blob/2ae6b6e118789b55aae151656169a4a07d4bff42/env.go#L98-L112
150,902
caarlos0/env
env.go
parseKeyForOption
func parseKeyForOption(key string) (string, []string) { opts := strings.Split(key, ",") return opts[0], opts[1:] }
go
func parseKeyForOption(key string) (string, []string) { opts := strings.Split(key, ",") return opts[0], opts[1:] }
[ "func", "parseKeyForOption", "(", "key", "string", ")", "(", "string", ",", "[", "]", "string", ")", "{", "opts", ":=", "strings", ".", "Split", "(", "key", ",", "\"", "\"", ")", "\n", "return", "opts", "[", "0", "]", ",", "opts", "[", "1", ":", ...
// split the env tag's key into the expected key and desired option, if any.
[ "split", "the", "env", "tag", "s", "key", "into", "the", "expected", "key", "and", "desired", "option", "if", "any", "." ]
2ae6b6e118789b55aae151656169a4a07d4bff42
https://github.com/caarlos0/env/blob/2ae6b6e118789b55aae151656169a4a07d4bff42/env.go#L183-L186
150,903
go-gl/glfw
v3.2/glfw/native_windows.go
GetWin32Adapter
func (m *Monitor) GetWin32Adapter() string { ret := C.glfwGetWin32Adapter(m.data) panicError() return C.GoString(ret) }
go
func (m *Monitor) GetWin32Adapter() string { ret := C.glfwGetWin32Adapter(m.data) panicError() return C.GoString(ret) }
[ "func", "(", "m", "*", "Monitor", ")", "GetWin32Adapter", "(", ")", "string", "{", "ret", ":=", "C", ".", "glfwGetWin32Adapter", "(", "m", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "C", ".", "GoString", "(", "ret", ")", "\n", ...
// GetWin32Adapter returns the adapter device name of the monitor.
[ "GetWin32Adapter", "returns", "the", "adapter", "device", "name", "of", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_windows.go#L11-L15
150,904
go-gl/glfw
v3.2/glfw/native_windows.go
GetWin32Monitor
func (m *Monitor) GetWin32Monitor() string { ret := C.glfwGetWin32Monitor(m.data) panicError() return C.GoString(ret) }
go
func (m *Monitor) GetWin32Monitor() string { ret := C.glfwGetWin32Monitor(m.data) panicError() return C.GoString(ret) }
[ "func", "(", "m", "*", "Monitor", ")", "GetWin32Monitor", "(", ")", "string", "{", "ret", ":=", "C", ".", "glfwGetWin32Monitor", "(", "m", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "C", ".", "GoString", "(", "ret", ")", "\n", ...
// GetWin32Monitor returns the display device name of the monitor.
[ "GetWin32Monitor", "returns", "the", "display", "device", "name", "of", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_windows.go#L18-L22
150,905
go-gl/glfw
v3.2/glfw/native_windows.go
GetWin32Window
func (w *Window) GetWin32Window() C.HWND { ret := C.glfwGetWin32Window(w.data) panicError() return ret }
go
func (w *Window) GetWin32Window() C.HWND { ret := C.glfwGetWin32Window(w.data) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetWin32Window", "(", ")", "C", ".", "HWND", "{", "ret", ":=", "C", ".", "glfwGetWin32Window", "(", "w", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetWin32Window returns the HWND of the window.
[ "GetWin32Window", "returns", "the", "HWND", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_windows.go#L25-L29
150,906
go-gl/glfw
v3.2/glfw/native_windows.go
GetWGLContext
func (w *Window) GetWGLContext() C.HGLRC { ret := C.glfwGetWGLContext(w.data) panicError() return ret }
go
func (w *Window) GetWGLContext() C.HGLRC { ret := C.glfwGetWGLContext(w.data) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetWGLContext", "(", ")", "C", ".", "HGLRC", "{", "ret", ":=", "C", ".", "glfwGetWGLContext", "(", "w", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetWGLContext returns the HGLRC of the window.
[ "GetWGLContext", "returns", "the", "HGLRC", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_windows.go#L32-L36
150,907
go-gl/glfw
v3.0/glfw/monitor.go
GetPosition
func (m *Monitor) GetPosition() (x, y int) { var xpos, ypos C.int C.glfwGetMonitorPos(m.data, &xpos, &ypos) return int(xpos), int(ypos) }
go
func (m *Monitor) GetPosition() (x, y int) { var xpos, ypos C.int C.glfwGetMonitorPos(m.data, &xpos, &ypos) return int(xpos), int(ypos) }
[ "func", "(", "m", "*", "Monitor", ")", "GetPosition", "(", ")", "(", "x", ",", "y", "int", ")", "{", "var", "xpos", ",", "ypos", "C", ".", "int", "\n\n", "C", ".", "glfwGetMonitorPos", "(", "m", ".", "data", ",", "&", "xpos", ",", "&", "ypos", ...
//GetPosition returns the position, in screen coordinates, of the upper-left //corner of the monitor.
[ "GetPosition", "returns", "the", "position", "in", "screen", "coordinates", "of", "the", "upper", "-", "left", "corner", "of", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/monitor.go#L86-L91
150,908
go-gl/glfw
v3.0/glfw/monitor.go
SetGamma
func (m *Monitor) SetGamma(gamma float32) { C.glfwSetGamma(m.data, C.float(gamma)) }
go
func (m *Monitor) SetGamma(gamma float32) { C.glfwSetGamma(m.data, C.float(gamma)) }
[ "func", "(", "m", "*", "Monitor", ")", "SetGamma", "(", "gamma", "float32", ")", "{", "C", ".", "glfwSetGamma", "(", "m", ".", "data", ",", "C", ".", "float", "(", "gamma", ")", ")", "\n", "}" ]
//SetGamma generates a 256-element gamma ramp from the specified exponent and then calls //SetGamma with it.
[ "SetGamma", "generates", "a", "256", "-", "element", "gamma", "ramp", "from", "the", "specified", "exponent", "and", "then", "calls", "SetGamma", "with", "it", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/monitor.go#L164-L166
150,909
go-gl/glfw
v3.0/glfw/monitor.go
GetGammaRamp
func (m *Monitor) GetGammaRamp() (*GammaRamp, error) { var ramp GammaRamp rampC := C.glfwGetGammaRamp(m.data) if rampC == nil { return nil, errors.New("Can't get the gamma ramp.") } length := int(rampC.size) ramp.Red = make([]uint16, length) ramp.Green = make([]uint16, length) ramp.Blue = make([]uint16, len...
go
func (m *Monitor) GetGammaRamp() (*GammaRamp, error) { var ramp GammaRamp rampC := C.glfwGetGammaRamp(m.data) if rampC == nil { return nil, errors.New("Can't get the gamma ramp.") } length := int(rampC.size) ramp.Red = make([]uint16, length) ramp.Green = make([]uint16, length) ramp.Blue = make([]uint16, len...
[ "func", "(", "m", "*", "Monitor", ")", "GetGammaRamp", "(", ")", "(", "*", "GammaRamp", ",", "error", ")", "{", "var", "ramp", "GammaRamp", "\n\n", "rampC", ":=", "C", ".", "glfwGetGammaRamp", "(", "m", ".", "data", ")", "\n", "if", "rampC", "==", ...
//GetGammaRamp retrieves the current gamma ramp of the monitor.
[ "GetGammaRamp", "retrieves", "the", "current", "gamma", "ramp", "of", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/monitor.go#L169-L189
150,910
go-gl/glfw
v3.0/glfw/monitor.go
SetGammaRamp
func (m *Monitor) SetGammaRamp(ramp *GammaRamp) { var rampC C.GLFWgammaramp length := len(ramp.Red) for i := 0; i < length; i++ { C.SetGammaAtIndex(rampC.red, C.int(i), C.ushort(ramp.Red[i])) C.SetGammaAtIndex(rampC.green, C.int(i), C.ushort(ramp.Green[i])) C.SetGammaAtIndex(rampC.blue, C.int(i), C.ushort(ra...
go
func (m *Monitor) SetGammaRamp(ramp *GammaRamp) { var rampC C.GLFWgammaramp length := len(ramp.Red) for i := 0; i < length; i++ { C.SetGammaAtIndex(rampC.red, C.int(i), C.ushort(ramp.Red[i])) C.SetGammaAtIndex(rampC.green, C.int(i), C.ushort(ramp.Green[i])) C.SetGammaAtIndex(rampC.blue, C.int(i), C.ushort(ra...
[ "func", "(", "m", "*", "Monitor", ")", "SetGammaRamp", "(", "ramp", "*", "GammaRamp", ")", "{", "var", "rampC", "C", ".", "GLFWgammaramp", "\n\n", "length", ":=", "len", "(", "ramp", ".", "Red", ")", "\n\n", "for", "i", ":=", "0", ";", "i", "<", ...
//SetGammaRamp sets the current gamma ramp for the monitor.
[ "SetGammaRamp", "sets", "the", "current", "gamma", "ramp", "for", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/monitor.go#L192-L204
150,911
go-gl/glfw
v3.2/glfw/input.go
GetInputMode
func (w *Window) GetInputMode(mode InputMode) int { ret := int(C.glfwGetInputMode(w.data, C.int(mode))) panicError() return ret }
go
func (w *Window) GetInputMode(mode InputMode) int { ret := int(C.glfwGetInputMode(w.data, C.int(mode))) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetInputMode", "(", "mode", "InputMode", ")", "int", "{", "ret", ":=", "int", "(", "C", ".", "glfwGetInputMode", "(", "w", ".", "data", ",", "C", ".", "int", "(", "mode", ")", ")", ")", "\n", "panicError", "...
// GetInputMode returns the value of an input option of the window.
[ "GetInputMode", "returns", "the", "value", "of", "an", "input", "option", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L317-L321
150,912
go-gl/glfw
v3.2/glfw/input.go
SetInputMode
func (w *Window) SetInputMode(mode InputMode, value int) { C.glfwSetInputMode(w.data, C.int(mode), C.int(value)) panicError() }
go
func (w *Window) SetInputMode(mode InputMode, value int) { C.glfwSetInputMode(w.data, C.int(mode), C.int(value)) panicError() }
[ "func", "(", "w", "*", "Window", ")", "SetInputMode", "(", "mode", "InputMode", ",", "value", "int", ")", "{", "C", ".", "glfwSetInputMode", "(", "w", ".", "data", ",", "C", ".", "int", "(", "mode", ")", ",", "C", ".", "int", "(", "value", ")", ...
// SetInputMode sets an input option for the window.
[ "SetInputMode", "sets", "an", "input", "option", "for", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L324-L327
150,913
go-gl/glfw
v3.2/glfw/input.go
GetKeyName
func GetKeyName(key Key, scancode int) string { ret := C.glfwGetKeyName(C.int(key), C.int(scancode)) panicError() return C.GoString(ret) }
go
func GetKeyName(key Key, scancode int) string { ret := C.glfwGetKeyName(C.int(key), C.int(scancode)) panicError() return C.GoString(ret) }
[ "func", "GetKeyName", "(", "key", "Key", ",", "scancode", "int", ")", "string", "{", "ret", ":=", "C", ".", "glfwGetKeyName", "(", "C", ".", "int", "(", "key", ")", ",", "C", ".", "int", "(", "scancode", ")", ")", "\n", "panicError", "(", ")", "\...
// GetKeyName returns the localized name of the specified printable key. // // If the key is glfw.KeyUnknown, the scancode is used, otherwise the scancode is ignored.
[ "GetKeyName", "returns", "the", "localized", "name", "of", "the", "specified", "printable", "key", ".", "If", "the", "key", "is", "glfw", ".", "KeyUnknown", "the", "scancode", "is", "used", "otherwise", "the", "scancode", "is", "ignored", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L349-L353
150,914
go-gl/glfw
v3.2/glfw/input.go
SetCursor
func (w *Window) SetCursor(c *Cursor) { if c == nil { C.glfwSetCursor(w.data, nil) } else { C.glfwSetCursor(w.data, c.data) } panicError() }
go
func (w *Window) SetCursor(c *Cursor) { if c == nil { C.glfwSetCursor(w.data, nil) } else { C.glfwSetCursor(w.data, c.data) } panicError() }
[ "func", "(", "w", "*", "Window", ")", "SetCursor", "(", "c", "*", "Cursor", ")", "{", "if", "c", "==", "nil", "{", "C", ".", "glfwSetCursor", "(", "w", ".", "data", ",", "nil", ")", "\n", "}", "else", "{", "C", ".", "glfwSetCursor", "(", "w", ...
// SetCursor sets the cursor image to be used when the cursor is over the client area // of the specified window. The set cursor will only be visible when the cursor mode of the // window is CursorNormal. // // On some platforms, the set cursor may not be visible unless the window also has input focus.
[ "SetCursor", "sets", "the", "cursor", "image", "to", "be", "used", "when", "the", "cursor", "is", "over", "the", "client", "area", "of", "the", "specified", "window", ".", "The", "set", "cursor", "will", "only", "be", "visible", "when", "the", "cursor", ...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L451-L458
150,915
go-gl/glfw
v3.2/glfw/input.go
SetJoystickCallback
func SetJoystickCallback(cbfun JoystickCallback) (previous JoystickCallback) { previous = fJoystickHolder fJoystickHolder = cbfun if cbfun == nil { C.glfwSetJoystickCallback(nil) } else { C.glfwSetJoystickCallbackCB() } panicError() return previous }
go
func SetJoystickCallback(cbfun JoystickCallback) (previous JoystickCallback) { previous = fJoystickHolder fJoystickHolder = cbfun if cbfun == nil { C.glfwSetJoystickCallback(nil) } else { C.glfwSetJoystickCallbackCB() } panicError() return previous }
[ "func", "SetJoystickCallback", "(", "cbfun", "JoystickCallback", ")", "(", "previous", "JoystickCallback", ")", "{", "previous", "=", "fJoystickHolder", "\n", "fJoystickHolder", "=", "cbfun", "\n", "if", "cbfun", "==", "nil", "{", "C", ".", "glfwSetJoystickCallbac...
// SetJoystickCallback sets the joystick configuration callback, or removes the // currently set callback. This is called when a joystick is connected to or // disconnected from the system.
[ "SetJoystickCallback", "sets", "the", "joystick", "configuration", "callback", "or", "removes", "the", "currently", "set", "callback", ".", "This", "is", "called", "when", "a", "joystick", "is", "connected", "to", "or", "disconnected", "from", "the", "system", "...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L466-L476
150,916
go-gl/glfw
v3.2/glfw/input.go
SetCursorPosCallback
func (w *Window) SetCursorPosCallback(cbfun CursorPosCallback) (previous CursorPosCallback) { previous = w.fCursorPosHolder w.fCursorPosHolder = cbfun if cbfun == nil { C.glfwSetCursorPosCallback(w.data, nil) } else { C.glfwSetCursorPosCallbackCB(w.data) } panicError() return previous }
go
func (w *Window) SetCursorPosCallback(cbfun CursorPosCallback) (previous CursorPosCallback) { previous = w.fCursorPosHolder w.fCursorPosHolder = cbfun if cbfun == nil { C.glfwSetCursorPosCallback(w.data, nil) } else { C.glfwSetCursorPosCallbackCB(w.data) } panicError() return previous }
[ "func", "(", "w", "*", "Window", ")", "SetCursorPosCallback", "(", "cbfun", "CursorPosCallback", ")", "(", "previous", "CursorPosCallback", ")", "{", "previous", "=", "w", ".", "fCursorPosHolder", "\n", "w", ".", "fCursorPosHolder", "=", "cbfun", "\n", "if", ...
// SetCursorPosCallback sets the cursor position callback which is called // when the cursor is moved. The callback is provided with the position relative // to the upper-left corner of the client area of the window.
[ "SetCursorPosCallback", "sets", "the", "cursor", "position", "callback", "which", "is", "called", "when", "the", "cursor", "is", "moved", ".", "The", "callback", "is", "provided", "with", "the", "position", "relative", "to", "the", "upper", "-", "left", "corne...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L588-L598
150,917
go-gl/glfw
v3.2/glfw/input.go
SetDropCallback
func (w *Window) SetDropCallback(cbfun DropCallback) (previous DropCallback) { previous = w.fDropHolder w.fDropHolder = cbfun if cbfun == nil { C.glfwSetDropCallback(w.data, nil) } else { C.glfwSetDropCallbackCB(w.data) } panicError() return previous }
go
func (w *Window) SetDropCallback(cbfun DropCallback) (previous DropCallback) { previous = w.fDropHolder w.fDropHolder = cbfun if cbfun == nil { C.glfwSetDropCallback(w.data, nil) } else { C.glfwSetDropCallbackCB(w.data) } panicError() return previous }
[ "func", "(", "w", "*", "Window", ")", "SetDropCallback", "(", "cbfun", "DropCallback", ")", "(", "previous", "DropCallback", ")", "{", "previous", "=", "w", ".", "fDropHolder", "\n", "w", ".", "fDropHolder", "=", "cbfun", "\n", "if", "cbfun", "==", "nil"...
// SetDropCallback sets the drop callback which is called when an object // is dropped over the window.
[ "SetDropCallback", "sets", "the", "drop", "callback", "which", "is", "called", "when", "an", "object", "is", "dropped", "over", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L639-L649
150,918
go-gl/glfw
v3.2/glfw/input.go
JoystickPresent
func JoystickPresent(joy Joystick) bool { ret := glfwbool(C.glfwJoystickPresent(C.int(joy))) panicError() return ret }
go
func JoystickPresent(joy Joystick) bool { ret := glfwbool(C.glfwJoystickPresent(C.int(joy))) panicError() return ret }
[ "func", "JoystickPresent", "(", "joy", "Joystick", ")", "bool", "{", "ret", ":=", "glfwbool", "(", "C", ".", "glfwJoystickPresent", "(", "C", ".", "int", "(", "joy", ")", ")", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// JoystickPresent reports whether the specified joystick is present.
[ "JoystickPresent", "reports", "whether", "the", "specified", "joystick", "is", "present", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L652-L656
150,919
go-gl/glfw
v3.2/glfw/input.go
GetJoystickAxes
func GetJoystickAxes(joy Joystick) []float32 { var length int axis := C.glfwGetJoystickAxes(C.int(joy), (*C.int)(unsafe.Pointer(&length))) panicError() if axis == nil { return nil } a := make([]float32, length) for i := 0; i < length; i++ { a[i] = float32(C.GetAxisAtIndex(axis, C.int(i))) } return a }
go
func GetJoystickAxes(joy Joystick) []float32 { var length int axis := C.glfwGetJoystickAxes(C.int(joy), (*C.int)(unsafe.Pointer(&length))) panicError() if axis == nil { return nil } a := make([]float32, length) for i := 0; i < length; i++ { a[i] = float32(C.GetAxisAtIndex(axis, C.int(i))) } return a }
[ "func", "GetJoystickAxes", "(", "joy", "Joystick", ")", "[", "]", "float32", "{", "var", "length", "int", "\n\n", "axis", ":=", "C", ".", "glfwGetJoystickAxes", "(", "C", ".", "int", "(", "joy", ")", ",", "(", "*", "C", ".", "int", ")", "(", "unsaf...
// GetJoystickAxes returns a slice of axis values.
[ "GetJoystickAxes", "returns", "a", "slice", "of", "axis", "values", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/input.go#L659-L673
150,920
go-gl/glfw
v3.2/glfw/error.go
Error
func (e *Error) Error() string { return fmt.Sprintf("%s: %s", e.Code.String(), e.Desc) }
go
func (e *Error) Error() string { return fmt.Sprintf("%s: %s", e.Code.String(), e.Desc) }
[ "func", "(", "e", "*", "Error", ")", "Error", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "e", ".", "Code", ".", "String", "(", ")", ",", "e", ".", "Desc", ")", "\n", "}" ]
// Error prints the error code and description in a readable format.
[ "Error", "prints", "the", "error", "code", "and", "description", "in", "a", "readable", "format", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/error.go#L104-L106
150,921
go-gl/glfw
v3.2/glfw/error.go
flushErrors
func flushErrors() { err := fetchError() if err != nil { fmt.Println("GLFW: An uncaught error has occurred:", err) fmt.Println("GLFW: Please report this bug in the Go package immediately.") } }
go
func flushErrors() { err := fetchError() if err != nil { fmt.Println("GLFW: An uncaught error has occurred:", err) fmt.Println("GLFW: Please report this bug in the Go package immediately.") } }
[ "func", "flushErrors", "(", ")", "{", "err", ":=", "fetchError", "(", ")", "\n", "if", "err", "!=", "nil", "{", "fmt", ".", "Println", "(", "\"", "\"", ",", "err", ")", "\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "}", "\n", "}" ]
// flushErrors is called by Terminate before it actually calls C.glfwTerminate, // this ensures that any uncaught errors buffered in lastError are printed // before the program exits.
[ "flushErrors", "is", "called", "by", "Terminate", "before", "it", "actually", "calls", "C", ".", "glfwTerminate", "this", "ensures", "that", "any", "uncaught", "errors", "buffered", "in", "lastError", "are", "printed", "before", "the", "program", "exits", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/error.go#L134-L140
150,922
go-gl/glfw
v3.0/glfw/glfw.go
GetVersion
func GetVersion() (major, minor, revision int) { var ( maj C.int min C.int rev C.int ) C.glfwGetVersion(&maj, &min, &rev) return int(maj), int(min), int(rev) }
go
func GetVersion() (major, minor, revision int) { var ( maj C.int min C.int rev C.int ) C.glfwGetVersion(&maj, &min, &rev) return int(maj), int(min), int(rev) }
[ "func", "GetVersion", "(", ")", "(", "major", ",", "minor", ",", "revision", "int", ")", "{", "var", "(", "maj", "C", ".", "int", "\n", "min", "C", ".", "int", "\n", "rev", "C", ".", "int", "\n", ")", "\n\n", "C", ".", "glfwGetVersion", "(", "&...
//GetVersion retrieves the major, minor and revision numbers of the GLFW //library. It is intended for when you are using GLFW as a shared library and //want to ensure that you are using the minimum required version. // //This function may be called before Init.
[ "GetVersion", "retrieves", "the", "major", "minor", "and", "revision", "numbers", "of", "the", "GLFW", "library", ".", "It", "is", "intended", "for", "when", "you", "are", "using", "GLFW", "as", "a", "shared", "library", "and", "want", "to", "ensure", "tha...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/glfw.go#L67-L76
150,923
go-gl/glfw
v3.0/glfw/input.go
GetKey
func (w *Window) GetKey(key Key) Action { return Action(C.glfwGetKey(w.data, C.int(key))) }
go
func (w *Window) GetKey(key Key) Action { return Action(C.glfwGetKey(w.data, C.int(key))) }
[ "func", "(", "w", "*", "Window", ")", "GetKey", "(", "key", "Key", ")", "Action", "{", "return", "Action", "(", "C", ".", "glfwGetKey", "(", "w", ".", "data", ",", "C", ".", "int", "(", "key", ")", ")", ")", "\n", "}" ]
//GetKey returns the last reported state of a keyboard key. The returned state //is one of Press or Release. The higher-level state Repeat is only reported to //the key callback. // //If the StickyKeys input mode is enabled, this function returns Press the first //time you call this function after a key has been presse...
[ "GetKey", "returns", "the", "last", "reported", "state", "of", "a", "keyboard", "key", ".", "The", "returned", "state", "is", "one", "of", "Press", "or", "Release", ".", "The", "higher", "-", "level", "state", "Repeat", "is", "only", "reported", "to", "t...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/input.go#L290-L292
150,924
go-gl/glfw
v3.0/glfw/input.go
GetMouseButton
func (w *Window) GetMouseButton(button MouseButton) Action { return Action(C.glfwGetMouseButton(w.data, C.int(button))) }
go
func (w *Window) GetMouseButton(button MouseButton) Action { return Action(C.glfwGetMouseButton(w.data, C.int(button))) }
[ "func", "(", "w", "*", "Window", ")", "GetMouseButton", "(", "button", "MouseButton", ")", "Action", "{", "return", "Action", "(", "C", ".", "glfwGetMouseButton", "(", "w", ".", "data", ",", "C", ".", "int", "(", "button", ")", ")", ")", "\n", "}" ]
//GetMouseButton returns the last state reported for the specified mouse button. // //If the StickyMouseButtons input mode is enabled, this function returns Press //the first time you call this function after a mouse button has been pressed, //even if the mouse button has already been released.
[ "GetMouseButton", "returns", "the", "last", "state", "reported", "for", "the", "specified", "mouse", "button", ".", "If", "the", "StickyMouseButtons", "input", "mode", "is", "enabled", "this", "function", "returns", "Press", "the", "first", "time", "you", "call"...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/input.go#L299-L301
150,925
go-gl/glfw
v3.0/glfw/input.go
SetCharacterCallback
func (w *Window) SetCharacterCallback(cbfun func(w *Window, char uint)) { if cbfun == nil { C.glfwSetCharCallback(w.data, nil) } else { w.fCharHolder = cbfun C.glfwSetCharCallbackCB(w.data) } }
go
func (w *Window) SetCharacterCallback(cbfun func(w *Window, char uint)) { if cbfun == nil { C.glfwSetCharCallback(w.data, nil) } else { w.fCharHolder = cbfun C.glfwSetCharCallbackCB(w.data) } }
[ "func", "(", "w", "*", "Window", ")", "SetCharacterCallback", "(", "cbfun", "func", "(", "w", "*", "Window", ",", "char", "uint", ")", ")", "{", "if", "cbfun", "==", "nil", "{", "C", ".", "glfwSetCharCallback", "(", "w", ".", "data", ",", "nil", ")...
//SetCharacterCallback sets the character callback which is called when a //Unicode character is input. // //The character callback is intended for text input. If you want to know whether //a specific key was pressed or released, use the key callback instead.
[ "SetCharacterCallback", "sets", "the", "character", "callback", "which", "is", "called", "when", "a", "Unicode", "character", "is", "input", ".", "The", "character", "callback", "is", "intended", "for", "text", "input", ".", "If", "you", "want", "to", "know", ...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/input.go#L354-L361
150,926
go-gl/glfw
v3.0/glfw/input.go
SetCursorPositionCallback
func (w *Window) SetCursorPositionCallback(cbfun func(w *Window, xpos float64, ypos float64)) { if cbfun == nil { C.glfwSetCursorPosCallback(w.data, nil) } else { w.fCursorPosHolder = cbfun C.glfwSetCursorPosCallbackCB(w.data) } }
go
func (w *Window) SetCursorPositionCallback(cbfun func(w *Window, xpos float64, ypos float64)) { if cbfun == nil { C.glfwSetCursorPosCallback(w.data, nil) } else { w.fCursorPosHolder = cbfun C.glfwSetCursorPosCallbackCB(w.data) } }
[ "func", "(", "w", "*", "Window", ")", "SetCursorPositionCallback", "(", "cbfun", "func", "(", "w", "*", "Window", ",", "xpos", "float64", ",", "ypos", "float64", ")", ")", "{", "if", "cbfun", "==", "nil", "{", "C", ".", "glfwSetCursorPosCallback", "(", ...
//SetCursorPositionCallback sets the cursor position callback which is called //when the cursor is moved. The callback is provided with the position relative //to the upper-left corner of the client area of the window.
[ "SetCursorPositionCallback", "sets", "the", "cursor", "position", "callback", "which", "is", "called", "when", "the", "cursor", "is", "moved", ".", "The", "callback", "is", "provided", "with", "the", "position", "relative", "to", "the", "upper", "-", "left", "...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/input.go#L383-L390
150,927
go-gl/glfw
v3.0/glfw/input.go
GetJoystickButtons
func GetJoystickButtons(joy Joystick) ([]byte, error) { var length int buttons := C.glfwGetJoystickButtons(C.int(joy), (*C.int)(unsafe.Pointer(&length))) if buttons == nil { return nil, errors.New("Joystick is not present.") } b := make([]byte, length) for i := 0; i < length; i++ { b[i] = byte(C.GetButtonsA...
go
func GetJoystickButtons(joy Joystick) ([]byte, error) { var length int buttons := C.glfwGetJoystickButtons(C.int(joy), (*C.int)(unsafe.Pointer(&length))) if buttons == nil { return nil, errors.New("Joystick is not present.") } b := make([]byte, length) for i := 0; i < length; i++ { b[i] = byte(C.GetButtonsA...
[ "func", "GetJoystickButtons", "(", "joy", "Joystick", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "var", "length", "int", "\n\n", "buttons", ":=", "C", ".", "glfwGetJoystickButtons", "(", "C", ".", "int", "(", "joy", ")", ",", "(", "*", "C", ...
//GetJoystickButtons returns a slice of button values.
[ "GetJoystickButtons", "returns", "a", "slice", "of", "button", "values", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/input.go#L437-L451
150,928
go-gl/glfw
v3.0/glfw/window.go
GetPosition
func (w *Window) GetPosition() (x, y int) { var xpos, ypos C.int C.glfwGetWindowPos(w.data, &xpos, &ypos) return int(xpos), int(ypos) }
go
func (w *Window) GetPosition() (x, y int) { var xpos, ypos C.int C.glfwGetWindowPos(w.data, &xpos, &ypos) return int(xpos), int(ypos) }
[ "func", "(", "w", "*", "Window", ")", "GetPosition", "(", ")", "(", "x", ",", "y", "int", ")", "{", "var", "xpos", ",", "ypos", "C", ".", "int", "\n\n", "C", ".", "glfwGetWindowPos", "(", "w", ".", "data", ",", "&", "xpos", ",", "&", "ypos", ...
//GetPosition returns the position, in screen coordinates, of the upper-left //corner of the client area of the window.
[ "GetPosition", "returns", "the", "position", "in", "screen", "coordinates", "of", "the", "upper", "-", "left", "corner", "of", "the", "client", "area", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/window.go#L300-L305
150,929
go-gl/glfw
v3.0/glfw/window.go
GetSize
func (w *Window) GetSize() (width, height int) { var wi, h C.int C.glfwGetWindowSize(w.data, &wi, &h) return int(wi), int(h) }
go
func (w *Window) GetSize() (width, height int) { var wi, h C.int C.glfwGetWindowSize(w.data, &wi, &h) return int(wi), int(h) }
[ "func", "(", "w", "*", "Window", ")", "GetSize", "(", ")", "(", "width", ",", "height", "int", ")", "{", "var", "wi", ",", "h", "C", ".", "int", "\n", "C", ".", "glfwGetWindowSize", "(", "w", ".", "data", ",", "&", "wi", ",", "&", "h", ")", ...
//GetSize returns the size, in screen coordinates, of the client area of the //specified window.
[ "GetSize", "returns", "the", "size", "in", "screen", "coordinates", "of", "the", "client", "area", "of", "the", "specified", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/window.go#L328-L332
150,930
go-gl/glfw
v3.0/glfw/window.go
GetFramebufferSize
func (w *Window) GetFramebufferSize() (width, height int) { var wi, h C.int C.glfwGetFramebufferSize(w.data, &wi, &h) return int(wi), int(h) }
go
func (w *Window) GetFramebufferSize() (width, height int) { var wi, h C.int C.glfwGetFramebufferSize(w.data, &wi, &h) return int(wi), int(h) }
[ "func", "(", "w", "*", "Window", ")", "GetFramebufferSize", "(", ")", "(", "width", ",", "height", "int", ")", "{", "var", "wi", ",", "h", "C", ".", "int", "\n", "C", ".", "glfwGetFramebufferSize", "(", "w", ".", "data", ",", "&", "wi", ",", "&",...
//GetFramebufferSize retrieves the size, in pixels, of the framebuffer of the //specified window.
[ "GetFramebufferSize", "retrieves", "the", "size", "in", "pixels", "of", "the", "framebuffer", "of", "the", "specified", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/window.go#L351-L355
150,931
go-gl/glfw
v3.0/glfw/window.go
GetMonitor
func (w *Window) GetMonitor() (*Monitor, error) { m := C.glfwGetWindowMonitor(w.data) if m == nil { return nil, errors.New("Can't get the monitor.") } return &Monitor{m}, nil }
go
func (w *Window) GetMonitor() (*Monitor, error) { m := C.glfwGetWindowMonitor(w.data) if m == nil { return nil, errors.New("Can't get the monitor.") } return &Monitor{m}, nil }
[ "func", "(", "w", "*", "Window", ")", "GetMonitor", "(", ")", "(", "*", "Monitor", ",", "error", ")", "{", "m", ":=", "C", ".", "glfwGetWindowMonitor", "(", "w", ".", "data", ")", "\n\n", "if", "m", "==", "nil", "{", "return", "nil", ",", "errors...
//GetMonitor returns the handle of the monitor that the window is in //fullscreen on.
[ "GetMonitor", "returns", "the", "handle", "of", "the", "monitor", "that", "the", "window", "is", "in", "fullscreen", "on", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/window.go#L399-L406
150,932
go-gl/glfw
v3.0/glfw/window.go
GetAttribute
func (w *Window) GetAttribute(attrib Hint) int { return int(C.glfwGetWindowAttrib(w.data, C.int(attrib))) }
go
func (w *Window) GetAttribute(attrib Hint) int { return int(C.glfwGetWindowAttrib(w.data, C.int(attrib))) }
[ "func", "(", "w", "*", "Window", ")", "GetAttribute", "(", "attrib", "Hint", ")", "int", "{", "return", "int", "(", "C", ".", "glfwGetWindowAttrib", "(", "w", ".", "data", ",", "C", ".", "int", "(", "attrib", ")", ")", ")", "\n", "}" ]
//GetAttribute returns an attribute of the window. There are many attributes, //some related to the window and others to its context.
[ "GetAttribute", "returns", "an", "attribute", "of", "the", "window", ".", "There", "are", "many", "attributes", "some", "related", "to", "the", "window", "and", "others", "to", "its", "context", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/window.go#L410-L412
150,933
go-gl/glfw
v3.0/glfw/window.go
SetPositionCallback
func (w *Window) SetPositionCallback(cbfun func(w *Window, xpos int, ypos int)) { if cbfun == nil { C.glfwSetWindowPosCallback(w.data, nil) } else { w.fPosHolder = cbfun C.glfwSetWindowPosCallbackCB(w.data) } }
go
func (w *Window) SetPositionCallback(cbfun func(w *Window, xpos int, ypos int)) { if cbfun == nil { C.glfwSetWindowPosCallback(w.data, nil) } else { w.fPosHolder = cbfun C.glfwSetWindowPosCallbackCB(w.data) } }
[ "func", "(", "w", "*", "Window", ")", "SetPositionCallback", "(", "cbfun", "func", "(", "w", "*", "Window", ",", "xpos", "int", ",", "ypos", "int", ")", ")", "{", "if", "cbfun", "==", "nil", "{", "C", ".", "glfwSetWindowPosCallback", "(", "w", ".", ...
//SetPositionCallback sets the position callback of the window, which is called //when the window is moved. The callback is provided with the screen position //of the upper-left corner of the client area of the window.
[ "SetPositionCallback", "sets", "the", "position", "callback", "of", "the", "window", "which", "is", "called", "when", "the", "window", "is", "moved", ".", "The", "callback", "is", "provided", "with", "the", "screen", "position", "of", "the", "upper", "-", "l...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/window.go#L429-L436
150,934
go-gl/glfw
v3.2/glfw/window.go
WindowHint
func WindowHint(target Hint, hint int) { C.glfwWindowHint(C.int(target), C.int(hint)) panicError() }
go
func WindowHint(target Hint, hint int) { C.glfwWindowHint(C.int(target), C.int(hint)) panicError() }
[ "func", "WindowHint", "(", "target", "Hint", ",", "hint", "int", ")", "{", "C", ".", "glfwWindowHint", "(", "C", ".", "int", "(", "target", ")", ",", "C", ".", "int", "(", "hint", ")", ")", "\n", "panicError", "(", ")", "\n", "}" ]
// WindowHint sets hints for the next call to CreateWindow. The hints, // once set, retain their values until changed by a call to WindowHint or // DefaultWindowHints, or until the library is terminated with Terminate. // // This function may only be called from the main thread.
[ "WindowHint", "sets", "hints", "for", "the", "next", "call", "to", "CreateWindow", ".", "The", "hints", "once", "set", "retain", "their", "values", "until", "changed", "by", "a", "call", "to", "WindowHint", "or", "DefaultWindowHints", "or", "until", "the", "...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L234-L237
150,935
go-gl/glfw
v3.2/glfw/window.go
Destroy
func (w *Window) Destroy() { windows.remove(w.data) C.glfwDestroyWindow(w.data) panicError() }
go
func (w *Window) Destroy() { windows.remove(w.data) C.glfwDestroyWindow(w.data) panicError() }
[ "func", "(", "w", "*", "Window", ")", "Destroy", "(", ")", "{", "windows", ".", "remove", "(", "w", ".", "data", ")", "\n", "C", ".", "glfwDestroyWindow", "(", "w", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "}" ]
// Destroy destroys the specified window and its context. On calling this // function, no further callbacks will be called for that window. // // This function may only be called from the main thread.
[ "Destroy", "destroys", "the", "specified", "window", "and", "its", "context", ".", "On", "calling", "this", "function", "no", "further", "callbacks", "will", "be", "called", "for", "that", "window", ".", "This", "function", "may", "only", "be", "called", "fr...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L301-L305
150,936
go-gl/glfw
v3.2/glfw/window.go
ShouldClose
func (w *Window) ShouldClose() bool { ret := glfwbool(C.glfwWindowShouldClose(w.data)) panicError() return ret }
go
func (w *Window) ShouldClose() bool { ret := glfwbool(C.glfwWindowShouldClose(w.data)) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "ShouldClose", "(", ")", "bool", "{", "ret", ":=", "glfwbool", "(", "C", ".", "glfwWindowShouldClose", "(", "w", ".", "data", ")", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// ShouldClose reports the value of the close flag of the specified window.
[ "ShouldClose", "reports", "the", "value", "of", "the", "close", "flag", "of", "the", "specified", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L308-L312
150,937
go-gl/glfw
v3.2/glfw/window.go
SetShouldClose
func (w *Window) SetShouldClose(value bool) { if !value { C.glfwSetWindowShouldClose(w.data, C.int(False)) } else { C.glfwSetWindowShouldClose(w.data, C.int(True)) } panicError() }
go
func (w *Window) SetShouldClose(value bool) { if !value { C.glfwSetWindowShouldClose(w.data, C.int(False)) } else { C.glfwSetWindowShouldClose(w.data, C.int(True)) } panicError() }
[ "func", "(", "w", "*", "Window", ")", "SetShouldClose", "(", "value", "bool", ")", "{", "if", "!", "value", "{", "C", ".", "glfwSetWindowShouldClose", "(", "w", ".", "data", ",", "C", ".", "int", "(", "False", ")", ")", "\n", "}", "else", "{", "C...
// SetShouldClose sets the value of the close flag of the window. This can be // used to override the user's attempt to close the window, or to signal that it // should be closed.
[ "SetShouldClose", "sets", "the", "value", "of", "the", "close", "flag", "of", "the", "window", ".", "This", "can", "be", "used", "to", "override", "the", "user", "s", "attempt", "to", "close", "the", "window", "or", "to", "signal", "that", "it", "should"...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L317-L324
150,938
go-gl/glfw
v3.2/glfw/window.go
GetPos
func (w *Window) GetPos() (x, y int) { var xpos, ypos C.int C.glfwGetWindowPos(w.data, &xpos, &ypos) panicError() return int(xpos), int(ypos) }
go
func (w *Window) GetPos() (x, y int) { var xpos, ypos C.int C.glfwGetWindowPos(w.data, &xpos, &ypos) panicError() return int(xpos), int(ypos) }
[ "func", "(", "w", "*", "Window", ")", "GetPos", "(", ")", "(", "x", ",", "y", "int", ")", "{", "var", "xpos", ",", "ypos", "C", ".", "int", "\n", "C", ".", "glfwGetWindowPos", "(", "w", ".", "data", ",", "&", "xpos", ",", "&", "ypos", ")", ...
// GetPos returns the position, in screen coordinates, of the upper-left // corner of the client area of the window.
[ "GetPos", "returns", "the", "position", "in", "screen", "coordinates", "of", "the", "upper", "-", "left", "corner", "of", "the", "client", "area", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L389-L394
150,939
go-gl/glfw
v3.2/glfw/window.go
SetSizeLimits
func (w *Window) SetSizeLimits(minw, minh, maxw, maxh int) { C.glfwSetWindowSizeLimits(w.data, C.int(minw), C.int(minh), C.int(maxw), C.int(maxh)) panicError() }
go
func (w *Window) SetSizeLimits(minw, minh, maxw, maxh int) { C.glfwSetWindowSizeLimits(w.data, C.int(minw), C.int(minh), C.int(maxw), C.int(maxh)) panicError() }
[ "func", "(", "w", "*", "Window", ")", "SetSizeLimits", "(", "minw", ",", "minh", ",", "maxw", ",", "maxh", "int", ")", "{", "C", ".", "glfwSetWindowSizeLimits", "(", "w", ".", "data", ",", "C", ".", "int", "(", "minw", ")", ",", "C", ".", "int", ...
// SetSizeLimits sets the size limits of the client area of the specified window. // If the window is full screen or not resizable, this function does nothing. // // The size limits are applied immediately and may cause the window to be resized.
[ "SetSizeLimits", "sets", "the", "size", "limits", "of", "the", "client", "area", "of", "the", "specified", "window", ".", "If", "the", "window", "is", "full", "screen", "or", "not", "resizable", "this", "function", "does", "nothing", ".", "The", "size", "l...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L443-L446
150,940
go-gl/glfw
v3.2/glfw/window.go
GetFrameSize
func (w *Window) GetFrameSize() (left, top, right, bottom int) { var l, t, r, b C.int C.glfwGetWindowFrameSize(w.data, &l, &t, &r, &b) panicError() return int(l), int(t), int(r), int(b) }
go
func (w *Window) GetFrameSize() (left, top, right, bottom int) { var l, t, r, b C.int C.glfwGetWindowFrameSize(w.data, &l, &t, &r, &b) panicError() return int(l), int(t), int(r), int(b) }
[ "func", "(", "w", "*", "Window", ")", "GetFrameSize", "(", ")", "(", "left", ",", "top", ",", "right", ",", "bottom", "int", ")", "{", "var", "l", ",", "t", ",", "r", ",", "b", "C", ".", "int", "\n", "C", ".", "glfwGetWindowFrameSize", "(", "w"...
// GetFrameSize retrieves the size, in screen coordinates, of each edge of the frame // of the specified window. This size includes the title bar, if the window has one. // The size of the frame may vary depending on the window-related hints used to create it. // // Because this function retrieves the size of each wind...
[ "GetFrameSize", "retrieves", "the", "size", "in", "screen", "coordinates", "of", "each", "edge", "of", "the", "frame", "of", "the", "specified", "window", ".", "This", "size", "includes", "the", "title", "bar", "if", "the", "window", "has", "one", ".", "Th...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L477-L482
150,941
go-gl/glfw
v3.2/glfw/window.go
Focus
func (w *Window) Focus() error { C.glfwFocusWindow(w.data) return acceptError(APIUnavailable) }
go
func (w *Window) Focus() error { C.glfwFocusWindow(w.data) return acceptError(APIUnavailable) }
[ "func", "(", "w", "*", "Window", ")", "Focus", "(", ")", "error", "{", "C", ".", "glfwFocusWindow", "(", "w", ".", "data", ")", "\n", "return", "acceptError", "(", "APIUnavailable", ")", "\n", "}" ]
// Focus brings the specified window to front and sets input focus. // The window should already be visible and not iconified. // // By default, both windowed and full screen mode windows are focused when initially created. // Set the glfw.Focused to disable this behavior. // // Do not use this function to steal focus ...
[ "Focus", "brings", "the", "specified", "window", "to", "front", "and", "sets", "input", "focus", ".", "The", "window", "should", "already", "be", "visible", "and", "not", "iconified", ".", "By", "default", "both", "windowed", "and", "full", "screen", "mode",...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L492-L495
150,942
go-gl/glfw
v3.2/glfw/window.go
Maximize
func (w *Window) Maximize() error { C.glfwMaximizeWindow(w.data) return acceptError(APIUnavailable) }
go
func (w *Window) Maximize() error { C.glfwMaximizeWindow(w.data) return acceptError(APIUnavailable) }
[ "func", "(", "w", "*", "Window", ")", "Maximize", "(", ")", "error", "{", "C", ".", "glfwMaximizeWindow", "(", "w", ".", "data", ")", "\n", "return", "acceptError", "(", "APIUnavailable", ")", "\n", "}" ]
// Maximize maximizes the specified window if it was previously not maximized. // If the window is already maximized, this function does nothing. // // If the specified window is a full screen window, this function does nothing.
[ "Maximize", "maximizes", "the", "specified", "window", "if", "it", "was", "previously", "not", "maximized", ".", "If", "the", "window", "is", "already", "maximized", "this", "function", "does", "nothing", ".", "If", "the", "specified", "window", "is", "a", "...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L512-L515
150,943
go-gl/glfw
v3.2/glfw/window.go
GetMonitor
func (w *Window) GetMonitor() *Monitor { m := C.glfwGetWindowMonitor(w.data) panicError() if m == nil { return nil } return &Monitor{m} }
go
func (w *Window) GetMonitor() *Monitor { m := C.glfwGetWindowMonitor(w.data) panicError() if m == nil { return nil } return &Monitor{m} }
[ "func", "(", "w", "*", "Window", ")", "GetMonitor", "(", ")", "*", "Monitor", "{", "m", ":=", "C", ".", "glfwGetWindowMonitor", "(", "w", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}...
// GetMonitor returns the handle of the monitor that the window is in // fullscreen on. // // Returns nil if the window is in windowed mode.
[ "GetMonitor", "returns", "the", "handle", "of", "the", "monitor", "that", "the", "window", "is", "in", "fullscreen", "on", ".", "Returns", "nil", "if", "the", "window", "is", "in", "windowed", "mode", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L550-L557
150,944
go-gl/glfw
v3.2/glfw/window.go
SetMonitor
func (w *Window) SetMonitor(monitor *Monitor, xpos, ypos, width, height, refreshRate int) { var m *C.GLFWmonitor if monitor == nil { m = nil } else { m = monitor.data } C.glfwSetWindowMonitor(w.data, m, C.int(xpos), C.int(ypos), C.int(width), C.int(height), C.int(refreshRate)) panicError() }
go
func (w *Window) SetMonitor(monitor *Monitor, xpos, ypos, width, height, refreshRate int) { var m *C.GLFWmonitor if monitor == nil { m = nil } else { m = monitor.data } C.glfwSetWindowMonitor(w.data, m, C.int(xpos), C.int(ypos), C.int(width), C.int(height), C.int(refreshRate)) panicError() }
[ "func", "(", "w", "*", "Window", ")", "SetMonitor", "(", "monitor", "*", "Monitor", ",", "xpos", ",", "ypos", ",", "width", ",", "height", ",", "refreshRate", "int", ")", "{", "var", "m", "*", "C", ".", "GLFWmonitor", "\n", "if", "monitor", "==", "...
// SetMonitor sets the monitor that the window uses for full screen mode or, // if the monitor is NULL, makes it windowed mode. // // When setting a monitor, this function updates the width, height and refresh // rate of the desired video mode and switches to the video mode closest to it. // The window position is igno...
[ "SetMonitor", "sets", "the", "monitor", "that", "the", "window", "uses", "for", "full", "screen", "mode", "or", "if", "the", "monitor", "is", "NULL", "makes", "it", "windowed", "mode", ".", "When", "setting", "a", "monitor", "this", "function", "updates", ...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L574-L583
150,945
go-gl/glfw
v3.2/glfw/window.go
GetAttrib
func (w *Window) GetAttrib(attrib Hint) int { ret := int(C.glfwGetWindowAttrib(w.data, C.int(attrib))) panicError() return ret }
go
func (w *Window) GetAttrib(attrib Hint) int { ret := int(C.glfwGetWindowAttrib(w.data, C.int(attrib))) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetAttrib", "(", "attrib", "Hint", ")", "int", "{", "ret", ":=", "int", "(", "C", ".", "glfwGetWindowAttrib", "(", "w", ".", "data", ",", "C", ".", "int", "(", "attrib", ")", ")", ")", "\n", "panicError", "(...
// GetAttrib returns an attribute of the window. There are many attributes, // some related to the window and others to its context.
[ "GetAttrib", "returns", "an", "attribute", "of", "the", "window", ".", "There", "are", "many", "attributes", "some", "related", "to", "the", "window", "and", "others", "to", "its", "context", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L587-L591
150,946
go-gl/glfw
v3.2/glfw/window.go
SetUserPointer
func (w *Window) SetUserPointer(pointer unsafe.Pointer) { C.glfwSetWindowUserPointer(w.data, pointer) panicError() }
go
func (w *Window) SetUserPointer(pointer unsafe.Pointer) { C.glfwSetWindowUserPointer(w.data, pointer) panicError() }
[ "func", "(", "w", "*", "Window", ")", "SetUserPointer", "(", "pointer", "unsafe", ".", "Pointer", ")", "{", "C", ".", "glfwSetWindowUserPointer", "(", "w", ".", "data", ",", "pointer", ")", "\n", "panicError", "(", ")", "\n", "}" ]
// SetUserPointer sets the user-defined pointer of the window. The current value // is retained until the window is destroyed. The initial value is nil.
[ "SetUserPointer", "sets", "the", "user", "-", "defined", "pointer", "of", "the", "window", ".", "The", "current", "value", "is", "retained", "until", "the", "window", "is", "destroyed", ".", "The", "initial", "value", "is", "nil", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L595-L598
150,947
go-gl/glfw
v3.2/glfw/window.go
GetUserPointer
func (w *Window) GetUserPointer() unsafe.Pointer { ret := C.glfwGetWindowUserPointer(w.data) panicError() return ret }
go
func (w *Window) GetUserPointer() unsafe.Pointer { ret := C.glfwGetWindowUserPointer(w.data) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetUserPointer", "(", ")", "unsafe", ".", "Pointer", "{", "ret", ":=", "C", ".", "glfwGetWindowUserPointer", "(", "w", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetUserPointer returns the current value of the user-defined pointer of the // window. The initial value is nil.
[ "GetUserPointer", "returns", "the", "current", "value", "of", "the", "user", "-", "defined", "pointer", "of", "the", "window", ".", "The", "initial", "value", "is", "nil", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L602-L606
150,948
go-gl/glfw
v3.2/glfw/window.go
SetPosCallback
func (w *Window) SetPosCallback(cbfun PosCallback) (previous PosCallback) { previous = w.fPosHolder w.fPosHolder = cbfun if cbfun == nil { C.glfwSetWindowPosCallback(w.data, nil) } else { C.glfwSetWindowPosCallbackCB(w.data) } panicError() return previous }
go
func (w *Window) SetPosCallback(cbfun PosCallback) (previous PosCallback) { previous = w.fPosHolder w.fPosHolder = cbfun if cbfun == nil { C.glfwSetWindowPosCallback(w.data, nil) } else { C.glfwSetWindowPosCallbackCB(w.data) } panicError() return previous }
[ "func", "(", "w", "*", "Window", ")", "SetPosCallback", "(", "cbfun", "PosCallback", ")", "(", "previous", "PosCallback", ")", "{", "previous", "=", "w", ".", "fPosHolder", "\n", "w", ".", "fPosHolder", "=", "cbfun", "\n", "if", "cbfun", "==", "nil", "...
// SetPosCallback sets the position callback of the window, which is called // when the window is moved. The callback is provided with the screen position // of the upper-left corner of the client area of the window.
[ "SetPosCallback", "sets", "the", "position", "callback", "of", "the", "window", "which", "is", "called", "when", "the", "window", "is", "moved", ".", "The", "callback", "is", "provided", "with", "the", "screen", "position", "of", "the", "upper", "-", "left",...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L614-L624
150,949
go-gl/glfw
v3.2/glfw/window.go
SetClipboardString
func (w *Window) SetClipboardString(str string) { cp := C.CString(str) defer C.free(unsafe.Pointer(cp)) C.glfwSetClipboardString(w.data, cp) panicError() }
go
func (w *Window) SetClipboardString(str string) { cp := C.CString(str) defer C.free(unsafe.Pointer(cp)) C.glfwSetClipboardString(w.data, cp) panicError() }
[ "func", "(", "w", "*", "Window", ")", "SetClipboardString", "(", "str", "string", ")", "{", "cp", ":=", "C", ".", "CString", "(", "str", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cp", ")", ")", "\n", "C", ".", "...
// SetClipboardString sets the system clipboard to the specified UTF-8 encoded // string. // // This function may only be called from the main thread.
[ "SetClipboardString", "sets", "the", "system", "clipboard", "to", "the", "specified", "UTF", "-", "8", "encoded", "string", ".", "This", "function", "may", "only", "be", "called", "from", "the", "main", "thread", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L749-L754
150,950
go-gl/glfw
v3.2/glfw/window.go
GetClipboardString
func (w *Window) GetClipboardString() (string, error) { cs := C.glfwGetClipboardString(w.data) if cs == nil { return "", acceptError(FormatUnavailable) } return C.GoString(cs), nil }
go
func (w *Window) GetClipboardString() (string, error) { cs := C.glfwGetClipboardString(w.data) if cs == nil { return "", acceptError(FormatUnavailable) } return C.GoString(cs), nil }
[ "func", "(", "w", "*", "Window", ")", "GetClipboardString", "(", ")", "(", "string", ",", "error", ")", "{", "cs", ":=", "C", ".", "glfwGetClipboardString", "(", "w", ".", "data", ")", "\n", "if", "cs", "==", "nil", "{", "return", "\"", "\"", ",", ...
// GetClipboardString returns the contents of the system clipboard, if it // contains or is convertible to a UTF-8 encoded string. // // This function may only be called from the main thread.
[ "GetClipboardString", "returns", "the", "contents", "of", "the", "system", "clipboard", "if", "it", "contains", "or", "is", "convertible", "to", "a", "UTF", "-", "8", "encoded", "string", ".", "This", "function", "may", "only", "be", "called", "from", "the",...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/window.go#L760-L766
150,951
go-gl/glfw
v3.2/glfw/native_darwin.go
GetCocoaMonitor
func (m *Monitor) GetCocoaMonitor() uintptr { ret := uintptr(C.glfwGetCocoaMonitor(m.data)) panicError() return ret }
go
func (m *Monitor) GetCocoaMonitor() uintptr { ret := uintptr(C.glfwGetCocoaMonitor(m.data)) panicError() return ret }
[ "func", "(", "m", "*", "Monitor", ")", "GetCocoaMonitor", "(", ")", "uintptr", "{", "ret", ":=", "uintptr", "(", "C", ".", "glfwGetCocoaMonitor", "(", "m", ".", "data", ")", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetCocoaMonitor returns the CGDirectDisplayID of the monitor.
[ "GetCocoaMonitor", "returns", "the", "CGDirectDisplayID", "of", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_darwin.go#L21-L25
150,952
go-gl/glfw
v3.2/glfw/native_darwin.go
GetCocoaWindow
func (w *Window) GetCocoaWindow() uintptr { ret := uintptr(C.workaround_glfwGetCocoaWindow(w.data)) panicError() return ret }
go
func (w *Window) GetCocoaWindow() uintptr { ret := uintptr(C.workaround_glfwGetCocoaWindow(w.data)) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetCocoaWindow", "(", ")", "uintptr", "{", "ret", ":=", "uintptr", "(", "C", ".", "workaround_glfwGetCocoaWindow", "(", "w", ".", "data", ")", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetCocoaWindow returns the NSWindow of the window.
[ "GetCocoaWindow", "returns", "the", "NSWindow", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_darwin.go#L28-L32
150,953
go-gl/glfw
v3.2/glfw/native_darwin.go
GetNSGLContext
func (w *Window) GetNSGLContext() uintptr { ret := uintptr(C.workaround_glfwGetNSGLContext(w.data)) panicError() return ret }
go
func (w *Window) GetNSGLContext() uintptr { ret := uintptr(C.workaround_glfwGetNSGLContext(w.data)) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetNSGLContext", "(", ")", "uintptr", "{", "ret", ":=", "uintptr", "(", "C", ".", "workaround_glfwGetNSGLContext", "(", "w", ".", "data", ")", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetNSGLContext returns the NSOpenGLContext of the window.
[ "GetNSGLContext", "returns", "the", "NSOpenGLContext", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_darwin.go#L35-L39
150,954
go-gl/glfw
v3.2/glfw/native_linbsd.go
GetX11Adapter
func (m *Monitor) GetX11Adapter() C.RRCrtc { ret := C.glfwGetX11Adapter(m.data) panicError() return ret }
go
func (m *Monitor) GetX11Adapter() C.RRCrtc { ret := C.glfwGetX11Adapter(m.data) panicError() return ret }
[ "func", "(", "m", "*", "Monitor", ")", "GetX11Adapter", "(", ")", "C", ".", "RRCrtc", "{", "ret", ":=", "C", ".", "glfwGetX11Adapter", "(", "m", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetX11Adapter returns the RRCrtc of the monitor.
[ "GetX11Adapter", "returns", "the", "RRCrtc", "of", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_linbsd.go#L19-L23
150,955
go-gl/glfw
v3.2/glfw/native_linbsd.go
GetX11Monitor
func (m *Monitor) GetX11Monitor() C.RROutput { ret := C.glfwGetX11Monitor(m.data) panicError() return ret }
go
func (m *Monitor) GetX11Monitor() C.RROutput { ret := C.glfwGetX11Monitor(m.data) panicError() return ret }
[ "func", "(", "m", "*", "Monitor", ")", "GetX11Monitor", "(", ")", "C", ".", "RROutput", "{", "ret", ":=", "C", ".", "glfwGetX11Monitor", "(", "m", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetX11Monitor returns the RROutput of the monitor.
[ "GetX11Monitor", "returns", "the", "RROutput", "of", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_linbsd.go#L26-L30
150,956
go-gl/glfw
v3.2/glfw/native_linbsd.go
GetX11Window
func (w *Window) GetX11Window() C.Window { ret := C.glfwGetX11Window(w.data) panicError() return ret }
go
func (w *Window) GetX11Window() C.Window { ret := C.glfwGetX11Window(w.data) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetX11Window", "(", ")", "C", ".", "Window", "{", "ret", ":=", "C", ".", "glfwGetX11Window", "(", "w", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetX11Window returns the Window of the window.
[ "GetX11Window", "returns", "the", "Window", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_linbsd.go#L33-L37
150,957
go-gl/glfw
v3.2/glfw/native_linbsd.go
GetGLXContext
func (w *Window) GetGLXContext() C.GLXContext { ret := C.glfwGetGLXContext(w.data) panicError() return ret }
go
func (w *Window) GetGLXContext() C.GLXContext { ret := C.glfwGetGLXContext(w.data) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetGLXContext", "(", ")", "C", ".", "GLXContext", "{", "ret", ":=", "C", ".", "glfwGetGLXContext", "(", "w", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetGLXContext returns the GLXContext of the window.
[ "GetGLXContext", "returns", "the", "GLXContext", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_linbsd.go#L40-L44
150,958
go-gl/glfw
v3.2/glfw/native_linbsd.go
GetGLXWindow
func (w *Window) GetGLXWindow() C.GLXWindow { ret := C.glfwGetGLXWindow(w.data) panicError() return ret }
go
func (w *Window) GetGLXWindow() C.GLXWindow { ret := C.glfwGetGLXWindow(w.data) panicError() return ret }
[ "func", "(", "w", "*", "Window", ")", "GetGLXWindow", "(", ")", "C", ".", "GLXWindow", "{", "ret", ":=", "C", ".", "glfwGetGLXWindow", "(", "w", ".", "data", ")", "\n", "panicError", "(", ")", "\n", "return", "ret", "\n", "}" ]
// GetGLXWindow returns the GLXWindow of the window.
[ "GetGLXWindow", "returns", "the", "GLXWindow", "of", "the", "window", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/native_linbsd.go#L47-L51
150,959
go-gl/glfw
v3.0/glfw/error.go
SetErrorCallback
func SetErrorCallback(cbfun func(code ErrorCode, desc string)) { if cbfun == nil { C.glfwSetErrorCallback(nil) } else { fErrorHolder = cbfun C.glfwSetErrorCallbackCB() } }
go
func SetErrorCallback(cbfun func(code ErrorCode, desc string)) { if cbfun == nil { C.glfwSetErrorCallback(nil) } else { fErrorHolder = cbfun C.glfwSetErrorCallbackCB() } }
[ "func", "SetErrorCallback", "(", "cbfun", "func", "(", "code", "ErrorCode", ",", "desc", "string", ")", ")", "{", "if", "cbfun", "==", "nil", "{", "C", ".", "glfwSetErrorCallback", "(", "nil", ")", "\n", "}", "else", "{", "fErrorHolder", "=", "cbfun", ...
//SetErrorCallback sets the error callback, which is called with an error code //and a human-readable description each time a GLFW error occurs. // //This function may be called before Init.
[ "SetErrorCallback", "sets", "the", "error", "callback", "which", "is", "called", "with", "an", "error", "code", "and", "a", "human", "-", "readable", "description", "each", "time", "a", "GLFW", "error", "occurs", ".", "This", "function", "may", "be", "called...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.0/glfw/error.go#L35-L42
150,960
go-gl/glfw
v3.2/glfw/context.go
ExtensionSupported
func ExtensionSupported(extension string) bool { e := C.CString(extension) defer C.free(unsafe.Pointer(e)) ret := glfwbool(C.glfwExtensionSupported(e)) panicError() return ret }
go
func ExtensionSupported(extension string) bool { e := C.CString(extension) defer C.free(unsafe.Pointer(e)) ret := glfwbool(C.glfwExtensionSupported(e)) panicError() return ret }
[ "func", "ExtensionSupported", "(", "extension", "string", ")", "bool", "{", "e", ":=", "C", ".", "CString", "(", "extension", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "e", ")", ")", "\n", "ret", ":=", "glfwbool", "(",...
// ExtensionSupported reports whether the specified OpenGL or context creation // API extension is supported by the current context. For example, on Windows // both the OpenGL and WGL extension strings are checked. // // As this functions searches one or more extension strings on each call, it is // recommended that yo...
[ "ExtensionSupported", "reports", "whether", "the", "specified", "OpenGL", "or", "context", "creation", "API", "extension", "is", "supported", "by", "the", "current", "context", ".", "For", "example", "on", "Windows", "both", "the", "OpenGL", "and", "WGL", "exten...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/context.go#L72-L78
150,961
go-gl/glfw
v3.2/glfw/context.go
GetProcAddress
func GetProcAddress(procname string) unsafe.Pointer { p := C.CString(procname) defer C.free(unsafe.Pointer(p)) ret := unsafe.Pointer(C.glfwGetProcAddress(p)) panicError() return ret }
go
func GetProcAddress(procname string) unsafe.Pointer { p := C.CString(procname) defer C.free(unsafe.Pointer(p)) ret := unsafe.Pointer(C.glfwGetProcAddress(p)) panicError() return ret }
[ "func", "GetProcAddress", "(", "procname", "string", ")", "unsafe", ".", "Pointer", "{", "p", ":=", "C", ".", "CString", "(", "procname", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "p", ")", ")", "\n", "ret", ":=", "u...
// GetProcAddress returns the address of the specified OpenGL or OpenGL ES core // or extension function, if it is supported by the current context. // // A context must be current on the calling thread. Calling this function // without a current context will cause a GLFW_NO_CURRENT_CONTEXT error. // // This function i...
[ "GetProcAddress", "returns", "the", "address", "of", "the", "specified", "OpenGL", "or", "OpenGL", "ES", "core", "or", "extension", "function", "if", "it", "is", "supported", "by", "the", "current", "context", ".", "A", "context", "must", "be", "current", "o...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/context.go#L88-L94
150,962
go-gl/glfw
v3.1/glfw/input.go
CreateCursor
func CreateCursor(img image.Image, xhot, yhot int) *Cursor { var img_c C.GLFWimage var pixels []uint8 b := img.Bounds() switch img := img.(type) { case *image.RGBA: pixels = img.Pix default: m := image.NewRGBA(image.Rect(0, 0, b.Dx(), b.Dy())) draw.Draw(m, m.Bounds(), img, b.Min, draw.Src) pixels = m.Pix...
go
func CreateCursor(img image.Image, xhot, yhot int) *Cursor { var img_c C.GLFWimage var pixels []uint8 b := img.Bounds() switch img := img.(type) { case *image.RGBA: pixels = img.Pix default: m := image.NewRGBA(image.Rect(0, 0, b.Dx(), b.Dy())) draw.Draw(m, m.Bounds(), img, b.Min, draw.Src) pixels = m.Pix...
[ "func", "CreateCursor", "(", "img", "image", ".", "Image", ",", "xhot", ",", "yhot", "int", ")", "*", "Cursor", "{", "var", "img_c", "C", ".", "GLFWimage", "\n", "var", "pixels", "[", "]", "uint8", "\n", "b", ":=", "img", ".", "Bounds", "(", ")", ...
// Creates a new custom cursor image that can be set for a window with SetCursor. // The cursor can be destroyed with Destroy. Any remaining cursors are destroyed by Terminate. // // The pixels are 32-bit little-endian RGBA, i.e. eight bits per channel. They are arranged // canonically as packed sequential rows, starti...
[ "Creates", "a", "new", "custom", "cursor", "image", "that", "can", "be", "set", "for", "a", "window", "with", "SetCursor", ".", "The", "cursor", "can", "be", "destroyed", "with", "Destroy", ".", "Any", "remaining", "cursors", "are", "destroyed", "by", "Ter...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.1/glfw/input.go#L383-L409
150,963
go-gl/glfw
v3.1/glfw/input.go
CreateStandardCursor
func CreateStandardCursor(shape int) *Cursor { c := C.glfwCreateStandardCursor(C.int(shape)) panicError() return &Cursor{c} }
go
func CreateStandardCursor(shape int) *Cursor { c := C.glfwCreateStandardCursor(C.int(shape)) panicError() return &Cursor{c} }
[ "func", "CreateStandardCursor", "(", "shape", "int", ")", "*", "Cursor", "{", "c", ":=", "C", ".", "glfwCreateStandardCursor", "(", "C", ".", "int", "(", "shape", ")", ")", "\n", "panicError", "(", ")", "\n", "return", "&", "Cursor", "{", "c", "}", "...
// Returns a cursor with a standard shape, that can be set for a window with SetCursor.
[ "Returns", "a", "cursor", "with", "a", "standard", "shape", "that", "can", "be", "set", "for", "a", "window", "with", "SetCursor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.1/glfw/input.go#L412-L416
150,964
go-gl/glfw
v3.2/glfw/monitor.go
GetPos
func (m *Monitor) GetPos() (x, y int) { var xpos, ypos C.int C.glfwGetMonitorPos(m.data, &xpos, &ypos) panicError() return int(xpos), int(ypos) }
go
func (m *Monitor) GetPos() (x, y int) { var xpos, ypos C.int C.glfwGetMonitorPos(m.data, &xpos, &ypos) panicError() return int(xpos), int(ypos) }
[ "func", "(", "m", "*", "Monitor", ")", "GetPos", "(", ")", "(", "x", ",", "y", "int", ")", "{", "var", "xpos", ",", "ypos", "C", ".", "int", "\n", "C", ".", "glfwGetMonitorPos", "(", "m", ".", "data", ",", "&", "xpos", ",", "&", "ypos", ")", ...
// GetPos returns the position, in screen coordinates, of the upper-left // corner of the monitor.
[ "GetPos", "returns", "the", "position", "in", "screen", "coordinates", "of", "the", "upper", "-", "left", "corner", "of", "the", "monitor", "." ]
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/monitor.go#L86-L91
150,965
go-gl/glfw
v3.2/glfw/monitor.go
SetMonitorCallback
func SetMonitorCallback(cbfun func(monitor *Monitor, event MonitorEvent)) { if cbfun == nil { C.glfwSetMonitorCallback(nil) } else { fMonitorHolder = cbfun C.glfwSetMonitorCallbackCB() } panicError() }
go
func SetMonitorCallback(cbfun func(monitor *Monitor, event MonitorEvent)) { if cbfun == nil { C.glfwSetMonitorCallback(nil) } else { fMonitorHolder = cbfun C.glfwSetMonitorCallbackCB() } panicError() }
[ "func", "SetMonitorCallback", "(", "cbfun", "func", "(", "monitor", "*", "Monitor", ",", "event", "MonitorEvent", ")", ")", "{", "if", "cbfun", "==", "nil", "{", "C", ".", "glfwSetMonitorCallback", "(", "nil", ")", "\n", "}", "else", "{", "fMonitorHolder",...
// SetMonitorCallback sets the monitor configuration callback, or removes the // currently set callback. This is called when a monitor is connected to or // disconnected from the system.
[ "SetMonitorCallback", "sets", "the", "monitor", "configuration", "callback", "or", "removes", "the", "currently", "set", "callback", ".", "This", "is", "called", "when", "a", "monitor", "is", "connected", "to", "or", "disconnected", "from", "the", "system", "." ...
e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc
https://github.com/go-gl/glfw/blob/e6da0acd62b1b57ee2799d4d0a76a7d4514dc5bc/v3.2/glfw/monitor.go#L119-L127
150,966
karrick/godirwalk
dirent.go
NewDirent
func NewDirent(osPathname string) (*Dirent, error) { fi, err := os.Lstat(osPathname) if err != nil { return nil, err } return &Dirent{ name: filepath.Base(osPathname), modeType: fi.Mode() & os.ModeType, }, nil }
go
func NewDirent(osPathname string) (*Dirent, error) { fi, err := os.Lstat(osPathname) if err != nil { return nil, err } return &Dirent{ name: filepath.Base(osPathname), modeType: fi.Mode() & os.ModeType, }, nil }
[ "func", "NewDirent", "(", "osPathname", "string", ")", "(", "*", "Dirent", ",", "error", ")", "{", "fi", ",", "err", ":=", "os", ".", "Lstat", "(", "osPathname", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\...
// NewDirent returns a newly initialized Dirent structure, or an error. This // function does not follow symbolic links. // // This function is rarely used, as Dirent structures are provided by other // functions in this library that read and walk directories.
[ "NewDirent", "returns", "a", "newly", "initialized", "Dirent", "structure", "or", "an", "error", ".", "This", "function", "does", "not", "follow", "symbolic", "links", ".", "This", "function", "is", "rarely", "used", "as", "Dirent", "structures", "are", "provi...
808a2f88690f523a3fb074bc6626124660bc80eb
https://github.com/karrick/godirwalk/blob/808a2f88690f523a3fb074bc6626124660bc80eb/dirent.go#L20-L29
150,967
karrick/godirwalk
readdir_windows.go
readdirents
func readdirents(osDirname string, _ []byte) (Dirents, error) { dh, err := os.Open(osDirname) if err != nil { return nil, err } fileinfos, err := dh.Readdir(0) if er := dh.Close(); err == nil { err = er } if err != nil { return nil, err } entries := make(Dirents, len(fileinfos)) for i, info := range f...
go
func readdirents(osDirname string, _ []byte) (Dirents, error) { dh, err := os.Open(osDirname) if err != nil { return nil, err } fileinfos, err := dh.Readdir(0) if er := dh.Close(); err == nil { err = er } if err != nil { return nil, err } entries := make(Dirents, len(fileinfos)) for i, info := range f...
[ "func", "readdirents", "(", "osDirname", "string", ",", "_", "[", "]", "byte", ")", "(", "Dirents", ",", "error", ")", "{", "dh", ",", "err", ":=", "os", ".", "Open", "(", "osDirname", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",...
// The functions in this file are mere wrappers of what is already provided by // standard library, in order to provide the same API as this library provides. // // The scratch buffer argument is ignored by this architecture. // // Please send PR or link to article if you know of a more performant way of // enumerating...
[ "The", "functions", "in", "this", "file", "are", "mere", "wrappers", "of", "what", "is", "already", "provided", "by", "standard", "library", "in", "order", "to", "provide", "the", "same", "API", "as", "this", "library", "provides", ".", "The", "scratch", "...
808a2f88690f523a3fb074bc6626124660bc80eb
https://github.com/karrick/godirwalk/blob/808a2f88690f523a3fb074bc6626124660bc80eb/readdir_windows.go#L15-L35
150,968
karrick/godirwalk
walk.go
walk
func walk(osPathname string, dirent *Dirent, options *Options) error { err := options.Callback(osPathname, dirent) if err != nil { if err == filepath.SkipDir { return err } err = errCallback(err.Error()) // wrap potential errors returned by callback if action := options.ErrorCallback(osPathname, err); acti...
go
func walk(osPathname string, dirent *Dirent, options *Options) error { err := options.Callback(osPathname, dirent) if err != nil { if err == filepath.SkipDir { return err } err = errCallback(err.Error()) // wrap potential errors returned by callback if action := options.ErrorCallback(osPathname, err); acti...
[ "func", "walk", "(", "osPathname", "string", ",", "dirent", "*", "Dirent", ",", "options", "*", "Options", ")", "error", "{", "err", ":=", "options", ".", "Callback", "(", "osPathname", ",", "dirent", ")", "\n", "if", "err", "!=", "nil", "{", "if", "...
// walk recursively traverses the file system node specified by pathname and the // Dirent.
[ "walk", "recursively", "traverses", "the", "file", "system", "node", "specified", "by", "pathname", "and", "the", "Dirent", "." ]
808a2f88690f523a3fb074bc6626124660bc80eb
https://github.com/karrick/godirwalk/blob/808a2f88690f523a3fb074bc6626124660bc80eb/walk.go#L229-L313
150,969
paulmach/orb
clip/helpers.go
Geometry
func Geometry(b orb.Bound, g orb.Geometry) orb.Geometry { if g == nil { return nil } if !b.Intersects(g.Bound()) { return nil } switch g := g.(type) { case orb.Point: return g // Intersect check above case orb.MultiPoint: mp := MultiPoint(b, g) if len(mp) == 1 { return mp[0] } if mp == nil { ...
go
func Geometry(b orb.Bound, g orb.Geometry) orb.Geometry { if g == nil { return nil } if !b.Intersects(g.Bound()) { return nil } switch g := g.(type) { case orb.Point: return g // Intersect check above case orb.MultiPoint: mp := MultiPoint(b, g) if len(mp) == 1 { return mp[0] } if mp == nil { ...
[ "func", "Geometry", "(", "b", "orb", ".", "Bound", ",", "g", "orb", ".", "Geometry", ")", "orb", ".", "Geometry", "{", "if", "g", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "!", "b", ".", "Intersects", "(", "g", ".", "Bound", "...
// Geometry will clip the geometry to the bounding box using the // correct functions for the type. // This operation will modify the input of '1d or 2d geometry' by using as a // scratch space so clone if necessary.
[ "Geometry", "will", "clip", "the", "geometry", "to", "the", "bounding", "box", "using", "the", "correct", "functions", "for", "the", "type", ".", "This", "operation", "will", "modify", "the", "input", "of", "1d", "or", "2d", "geometry", "by", "using", "as"...
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/helpers.go#L15-L105
150,970
paulmach/orb
clip/helpers.go
MultiPoint
func MultiPoint(b orb.Bound, mp orb.MultiPoint) orb.MultiPoint { var result orb.MultiPoint for _, p := range mp { if b.Contains(p) { result = append(result, p) } } return result }
go
func MultiPoint(b orb.Bound, mp orb.MultiPoint) orb.MultiPoint { var result orb.MultiPoint for _, p := range mp { if b.Contains(p) { result = append(result, p) } } return result }
[ "func", "MultiPoint", "(", "b", "orb", ".", "Bound", ",", "mp", "orb", ".", "MultiPoint", ")", "orb", ".", "MultiPoint", "{", "var", "result", "orb", ".", "MultiPoint", "\n", "for", "_", ",", "p", ":=", "range", "mp", "{", "if", "b", ".", "Contains...
// MultiPoint returns a new set with the points outside the bound removed.
[ "MultiPoint", "returns", "a", "new", "set", "with", "the", "points", "outside", "the", "bound", "removed", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/helpers.go#L108-L117
150,971
paulmach/orb
clip/helpers.go
LineString
func LineString(b orb.Bound, ls orb.LineString, opts ...Option) orb.MultiLineString { open := false if len(opts) > 0 { o := &options{} for _, opt := range opts { opt(o) } open = o.openBound } result := line(b, ls, open) if len(result) == 0 { return nil } return result }
go
func LineString(b orb.Bound, ls orb.LineString, opts ...Option) orb.MultiLineString { open := false if len(opts) > 0 { o := &options{} for _, opt := range opts { opt(o) } open = o.openBound } result := line(b, ls, open) if len(result) == 0 { return nil } return result }
[ "func", "LineString", "(", "b", "orb", ".", "Bound", ",", "ls", "orb", ".", "LineString", ",", "opts", "...", "Option", ")", "orb", ".", "MultiLineString", "{", "open", ":=", "false", "\n", "if", "len", "(", "opts", ")", ">", "0", "{", "o", ":=", ...
// LineString clips the linestring to the bounding box.
[ "LineString", "clips", "the", "linestring", "to", "the", "bounding", "box", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/helpers.go#L120-L137
150,972
paulmach/orb
clip/helpers.go
MultiLineString
func MultiLineString(b orb.Bound, mls orb.MultiLineString, opts ...Option) orb.MultiLineString { open := false if len(opts) > 0 { o := &options{} for _, opt := range opts { opt(o) } open = o.openBound } var result orb.MultiLineString for _, ls := range mls { r := line(b, ls, open) if len(r) != 0 {...
go
func MultiLineString(b orb.Bound, mls orb.MultiLineString, opts ...Option) orb.MultiLineString { open := false if len(opts) > 0 { o := &options{} for _, opt := range opts { opt(o) } open = o.openBound } var result orb.MultiLineString for _, ls := range mls { r := line(b, ls, open) if len(r) != 0 {...
[ "func", "MultiLineString", "(", "b", "orb", ".", "Bound", ",", "mls", "orb", ".", "MultiLineString", ",", "opts", "...", "Option", ")", "orb", ".", "MultiLineString", "{", "open", ":=", "false", "\n", "if", "len", "(", "opts", ")", ">", "0", "{", "o"...
// MultiLineString clips the linestrings to the bounding box // and returns a linestring union.
[ "MultiLineString", "clips", "the", "linestrings", "to", "the", "bounding", "box", "and", "returns", "a", "linestring", "union", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/helpers.go#L141-L160
150,973
paulmach/orb
clip/helpers.go
Ring
func Ring(b orb.Bound, r orb.Ring) orb.Ring { result := ring(b, r) if len(result) == 0 { return nil } return result }
go
func Ring(b orb.Bound, r orb.Ring) orb.Ring { result := ring(b, r) if len(result) == 0 { return nil } return result }
[ "func", "Ring", "(", "b", "orb", ".", "Bound", ",", "r", "orb", ".", "Ring", ")", "orb", ".", "Ring", "{", "result", ":=", "ring", "(", "b", ",", "r", ")", "\n", "if", "len", "(", "result", ")", "==", "0", "{", "return", "nil", "\n", "}", "...
// Ring clips the ring to the bounding box and returns another ring. // This operation will modify the input by using as a scratch space // so clone if necessary.
[ "Ring", "clips", "the", "ring", "to", "the", "bounding", "box", "and", "returns", "another", "ring", ".", "This", "operation", "will", "modify", "the", "input", "by", "using", "as", "a", "scratch", "space", "so", "clone", "if", "necessary", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/helpers.go#L165-L172
150,974
paulmach/orb
clip/helpers.go
Polygon
func Polygon(b orb.Bound, p orb.Polygon) orb.Polygon { if len(p) == 0 { return nil } r := Ring(b, p[0]) if r == nil { return nil } result := orb.Polygon{r} for i := 1; i < len(p); i++ { r := Ring(b, p[i]) if r != nil { result = append(result, r) } } return result }
go
func Polygon(b orb.Bound, p orb.Polygon) orb.Polygon { if len(p) == 0 { return nil } r := Ring(b, p[0]) if r == nil { return nil } result := orb.Polygon{r} for i := 1; i < len(p); i++ { r := Ring(b, p[i]) if r != nil { result = append(result, r) } } return result }
[ "func", "Polygon", "(", "b", "orb", ".", "Bound", ",", "p", "orb", ".", "Polygon", ")", "orb", ".", "Polygon", "{", "if", "len", "(", "p", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n\n", "r", ":=", "Ring", "(", "b", ",", "p", "[", ...
// Polygon clips the polygon to the bounding box excluding the inner rings // if they do not intersect the bounding box. // This operation will modify the input by using as a scratch space // so clone if necessary.
[ "Polygon", "clips", "the", "polygon", "to", "the", "bounding", "box", "excluding", "the", "inner", "rings", "if", "they", "do", "not", "intersect", "the", "bounding", "box", ".", "This", "operation", "will", "modify", "the", "input", "by", "using", "as", "...
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/helpers.go#L178-L197
150,975
paulmach/orb
clip/helpers.go
MultiPolygon
func MultiPolygon(b orb.Bound, mp orb.MultiPolygon) orb.MultiPolygon { var result orb.MultiPolygon for _, polygon := range mp { p := Polygon(b, polygon) if p != nil { result = append(result, p) } } return result }
go
func MultiPolygon(b orb.Bound, mp orb.MultiPolygon) orb.MultiPolygon { var result orb.MultiPolygon for _, polygon := range mp { p := Polygon(b, polygon) if p != nil { result = append(result, p) } } return result }
[ "func", "MultiPolygon", "(", "b", "orb", ".", "Bound", ",", "mp", "orb", ".", "MultiPolygon", ")", "orb", ".", "MultiPolygon", "{", "var", "result", "orb", ".", "MultiPolygon", "\n", "for", "_", ",", "polygon", ":=", "range", "mp", "{", "p", ":=", "P...
// MultiPolygon clips the multi polygon to the bounding box excluding // any polygons if they don't intersect the bounding box. // This operation will modify the input by using as a scratch space // so clone if necessary.
[ "MultiPolygon", "clips", "the", "multi", "polygon", "to", "the", "bounding", "box", "excluding", "any", "polygons", "if", "they", "don", "t", "intersect", "the", "bounding", "box", ".", "This", "operation", "will", "modify", "the", "input", "by", "using", "a...
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/helpers.go#L203-L213
150,976
paulmach/orb
clip/helpers.go
Collection
func Collection(b orb.Bound, c orb.Collection) orb.Collection { var result orb.Collection for _, g := range c { clipped := Geometry(b, g) if clipped != nil { result = append(result, clipped) } } return result }
go
func Collection(b orb.Bound, c orb.Collection) orb.Collection { var result orb.Collection for _, g := range c { clipped := Geometry(b, g) if clipped != nil { result = append(result, clipped) } } return result }
[ "func", "Collection", "(", "b", "orb", ".", "Bound", ",", "c", "orb", ".", "Collection", ")", "orb", ".", "Collection", "{", "var", "result", "orb", ".", "Collection", "\n", "for", "_", ",", "g", ":=", "range", "c", "{", "clipped", ":=", "Geometry", ...
// Collection clips each element in the collection to the bounding box. // It will exclude elements if they don't intersect the bounding box. // This operation will modify the input of '2d geometry' by using as a // scratch space so clone if necessary.
[ "Collection", "clips", "each", "element", "in", "the", "collection", "to", "the", "bounding", "box", ".", "It", "will", "exclude", "elements", "if", "they", "don", "t", "intersect", "the", "bounding", "box", ".", "This", "operation", "will", "modify", "the",...
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/helpers.go#L219-L229
150,977
paulmach/orb
maptile/tilecover/polygon.go
Ring
func Ring(r orb.Ring, z maptile.Zoom) maptile.Set { if len(r) == 0 { return make(maptile.Set) } return Polygon(orb.Polygon{r}, z) }
go
func Ring(r orb.Ring, z maptile.Zoom) maptile.Set { if len(r) == 0 { return make(maptile.Set) } return Polygon(orb.Polygon{r}, z) }
[ "func", "Ring", "(", "r", "orb", ".", "Ring", ",", "z", "maptile", ".", "Zoom", ")", "maptile", ".", "Set", "{", "if", "len", "(", "r", ")", "==", "0", "{", "return", "make", "(", "maptile", ".", "Set", ")", "\n", "}", "\n\n", "return", "Polygo...
// Ring creates a tile cover for the ring.
[ "Ring", "creates", "a", "tile", "cover", "for", "the", "ring", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/maptile/tilecover/polygon.go#L11-L17
150,978
paulmach/orb
maptile/tilecover/polygon.go
Polygon
func Polygon(p orb.Polygon, z maptile.Zoom) maptile.Set { set := make(maptile.Set) polygon(set, p, z) return set }
go
func Polygon(p orb.Polygon, z maptile.Zoom) maptile.Set { set := make(maptile.Set) polygon(set, p, z) return set }
[ "func", "Polygon", "(", "p", "orb", ".", "Polygon", ",", "z", "maptile", ".", "Zoom", ")", "maptile", ".", "Set", "{", "set", ":=", "make", "(", "maptile", ".", "Set", ")", "\n", "polygon", "(", "set", ",", "p", ",", "z", ")", "\n\n", "return", ...
// Polygon creates a tile cover for the polygon.
[ "Polygon", "creates", "a", "tile", "cover", "for", "the", "polygon", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/maptile/tilecover/polygon.go#L20-L25
150,979
paulmach/orb
maptile/tilecover/polygon.go
MultiPolygon
func MultiPolygon(mp orb.MultiPolygon, z maptile.Zoom) maptile.Set { set := make(maptile.Set) for _, p := range mp { polygon(set, p, z) } return set }
go
func MultiPolygon(mp orb.MultiPolygon, z maptile.Zoom) maptile.Set { set := make(maptile.Set) for _, p := range mp { polygon(set, p, z) } return set }
[ "func", "MultiPolygon", "(", "mp", "orb", ".", "MultiPolygon", ",", "z", "maptile", ".", "Zoom", ")", "maptile", ".", "Set", "{", "set", ":=", "make", "(", "maptile", ".", "Set", ")", "\n", "for", "_", ",", "p", ":=", "range", "mp", "{", "polygon",...
// MultiPolygon creates a tile cover for the multi-polygon.
[ "MultiPolygon", "creates", "a", "tile", "cover", "for", "the", "multi", "-", "polygon", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/maptile/tilecover/polygon.go#L28-L35
150,980
paulmach/orb
geometry.go
Bound
func (c Collection) Bound() Bound { if len(c) == 0 { return emptyBound } var b Bound start := -1 for i, g := range c { if g != nil { start = i b = g.Bound() break } } if start == -1 { return emptyBound } for i := start + 1; i < len(c); i++ { if c[i] == nil { continue } b = b.Unio...
go
func (c Collection) Bound() Bound { if len(c) == 0 { return emptyBound } var b Bound start := -1 for i, g := range c { if g != nil { start = i b = g.Bound() break } } if start == -1 { return emptyBound } for i := start + 1; i < len(c); i++ { if c[i] == nil { continue } b = b.Unio...
[ "func", "(", "c", "Collection", ")", "Bound", "(", ")", "Bound", "{", "if", "len", "(", "c", ")", "==", "0", "{", "return", "emptyBound", "\n", "}", "\n\n", "var", "b", "Bound", "\n", "start", ":=", "-", "1", "\n\n", "for", "i", ",", "g", ":=",...
// Bound returns the bounding box of all the Geometries combined.
[ "Bound", "returns", "the", "bounding", "box", "of", "all", "the", "Geometries", "combined", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/geometry.go#L87-L116
150,981
paulmach/orb
geometry.go
Equal
func (c Collection) Equal(collection Collection) bool { if len(c) != len(collection) { return false } for i, g := range c { if !Equal(g, collection[i]) { return false } } return true }
go
func (c Collection) Equal(collection Collection) bool { if len(c) != len(collection) { return false } for i, g := range c { if !Equal(g, collection[i]) { return false } } return true }
[ "func", "(", "c", "Collection", ")", "Equal", "(", "collection", "Collection", ")", "bool", "{", "if", "len", "(", "c", ")", "!=", "len", "(", "collection", ")", "{", "return", "false", "\n", "}", "\n\n", "for", "i", ",", "g", ":=", "range", "c", ...
// Equal compares two collections. Returns true if lengths are the same // and all the sub geometries are the same and in the same order.
[ "Equal", "compares", "two", "collections", ".", "Returns", "true", "if", "lengths", "are", "the", "same", "and", "all", "the", "sub", "geometries", "are", "the", "same", "and", "in", "the", "same", "order", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/geometry.go#L120-L132
150,982
paulmach/orb
geometry.go
Clone
func (c Collection) Clone() Collection { if c == nil { return nil } nc := make(Collection, len(c)) for i, g := range c { nc[i] = Clone(g) } return nc }
go
func (c Collection) Clone() Collection { if c == nil { return nil } nc := make(Collection, len(c)) for i, g := range c { nc[i] = Clone(g) } return nc }
[ "func", "(", "c", "Collection", ")", "Clone", "(", ")", "Collection", "{", "if", "c", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "nc", ":=", "make", "(", "Collection", ",", "len", "(", "c", ")", ")", "\n", "for", "i", ",", "g", ":=",...
// Clone returns a deep copy of the collection.
[ "Clone", "returns", "a", "deep", "copy", "of", "the", "collection", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/geometry.go#L135-L146
150,983
paulmach/orb
simplify/radial.go
Radial
func Radial(df orb.DistanceFunc, threshold float64) *RadialSimplifier { return &RadialSimplifier{ DistanceFunc: df, Threshold: threshold, } }
go
func Radial(df orb.DistanceFunc, threshold float64) *RadialSimplifier { return &RadialSimplifier{ DistanceFunc: df, Threshold: threshold, } }
[ "func", "Radial", "(", "df", "orb", ".", "DistanceFunc", ",", "threshold", "float64", ")", "*", "RadialSimplifier", "{", "return", "&", "RadialSimplifier", "{", "DistanceFunc", ":", "df", ",", "Threshold", ":", "threshold", ",", "}", "\n", "}" ]
// Radial creates a new RadialSimplifier.
[ "Radial", "creates", "a", "new", "RadialSimplifier", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/simplify/radial.go#L16-L21
150,984
paulmach/orb
clip/smartclip/smart.go
Geometry
func Geometry(box orb.Bound, g orb.Geometry, o orb.Orientation) orb.Geometry { if g == nil { return nil } if g.Dimensions() != 2 { return clip.Geometry(box, g) } var mp orb.MultiPolygon switch g := g.(type) { case orb.Ring: mp = Ring(box, g, o) case orb.Polygon: mp = Polygon(box, g, o) case orb.Multi...
go
func Geometry(box orb.Bound, g orb.Geometry, o orb.Orientation) orb.Geometry { if g == nil { return nil } if g.Dimensions() != 2 { return clip.Geometry(box, g) } var mp orb.MultiPolygon switch g := g.(type) { case orb.Ring: mp = Ring(box, g, o) case orb.Polygon: mp = Polygon(box, g, o) case orb.Multi...
[ "func", "Geometry", "(", "box", "orb", ".", "Bound", ",", "g", "orb", ".", "Geometry", ",", "o", "orb", ".", "Orientation", ")", "orb", ".", "Geometry", "{", "if", "g", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "g", ".", "Dimens...
// Geometry will do a smart more involved clipping and wrapping of the geometry. // It will return simple OGC geometries. Rings that are NOT closed AND have an // endpoint in the bound will be implicitly closed.
[ "Geometry", "will", "do", "a", "smart", "more", "involved", "clipping", "and", "wrapping", "of", "the", "geometry", ".", "It", "will", "return", "simple", "OGC", "geometries", ".", "Rings", "that", "are", "NOT", "closed", "AND", "have", "an", "endpoint", "...
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L16-L62
150,985
paulmach/orb
clip/smartclip/smart.go
Ring
func Ring(box orb.Bound, r orb.Ring, o orb.Orientation) orb.MultiPolygon { if len(r) == 0 { return nil } open, closed := clipRings(box, []orb.Ring{r}) if len(open) == 0 { // nothing was clipped if len(closed) == 0 { return nil // everything outside bound } return orb.MultiPolygon{{r}} // everything i...
go
func Ring(box orb.Bound, r orb.Ring, o orb.Orientation) orb.MultiPolygon { if len(r) == 0 { return nil } open, closed := clipRings(box, []orb.Ring{r}) if len(open) == 0 { // nothing was clipped if len(closed) == 0 { return nil // everything outside bound } return orb.MultiPolygon{{r}} // everything i...
[ "func", "Ring", "(", "box", "orb", ".", "Bound", ",", "r", "orb", ".", "Ring", ",", "o", "orb", ".", "Orientation", ")", "orb", ".", "MultiPolygon", "{", "if", "len", "(", "r", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n\n", "open", ",...
// Ring will smart clip a ring to the boundary. This may result multiple rings so // a multipolygon is possible. Rings that are NOT closed AND have an endpoint in // the bound will be implicitly closed.
[ "Ring", "will", "smart", "clip", "a", "ring", "to", "the", "boundary", ".", "This", "may", "result", "multiple", "rings", "so", "a", "multipolygon", "is", "possible", ".", "Rings", "that", "are", "NOT", "closed", "AND", "have", "an", "endpoint", "in", "t...
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L67-L84
150,986
paulmach/orb
clip/smartclip/smart.go
Polygon
func Polygon(box orb.Bound, p orb.Polygon, o orb.Orientation) orb.MultiPolygon { if len(p) == 0 { return nil } open, closed := clipRings(box, p) if len(open) == 0 { // nothing was clipped if len(closed) == 0 { return nil // everything outside bound } return orb.MultiPolygon{p} // everything inside bo...
go
func Polygon(box orb.Bound, p orb.Polygon, o orb.Orientation) orb.MultiPolygon { if len(p) == 0 { return nil } open, closed := clipRings(box, p) if len(open) == 0 { // nothing was clipped if len(closed) == 0 { return nil // everything outside bound } return orb.MultiPolygon{p} // everything inside bo...
[ "func", "Polygon", "(", "box", "orb", ".", "Bound", ",", "p", "orb", ".", "Polygon", ",", "o", "orb", ".", "Orientation", ")", "orb", ".", "MultiPolygon", "{", "if", "len", "(", "p", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n\n", "open"...
// Polygon will smart clip a polygon to the bound. // Rings that are NOT closed AND have an endpoint in the bound will be // implicitly closed.
[ "Polygon", "will", "smart", "clip", "a", "polygon", "to", "the", "bound", ".", "Rings", "that", "are", "NOT", "closed", "AND", "have", "an", "endpoint", "in", "the", "bound", "will", "be", "implicitly", "closed", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L89-L114
150,987
paulmach/orb
clip/smartclip/smart.go
MultiPolygon
func MultiPolygon(box orb.Bound, mp orb.MultiPolygon, o orb.Orientation) orb.MultiPolygon { if len(mp) == 0 { return nil } // outer rings outerRings := make([]orb.Ring, 0, len(mp)) for _, p := range mp { outerRings = append(outerRings, p[0]) } outers, closedOuters := clipRings(box, outerRings) if len(oute...
go
func MultiPolygon(box orb.Bound, mp orb.MultiPolygon, o orb.Orientation) orb.MultiPolygon { if len(mp) == 0 { return nil } // outer rings outerRings := make([]orb.Ring, 0, len(mp)) for _, p := range mp { outerRings = append(outerRings, p[0]) } outers, closedOuters := clipRings(box, outerRings) if len(oute...
[ "func", "MultiPolygon", "(", "box", "orb", ".", "Bound", ",", "mp", "orb", ".", "MultiPolygon", ",", "o", "orb", ".", "Orientation", ")", "orb", ".", "MultiPolygon", "{", "if", "len", "(", "mp", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n\...
// MultiPolygon will smart clip a multipolygon to the bound. // Rings that are NOT closed AND have an endpoint in the bound will be // implicitly closed.
[ "MultiPolygon", "will", "smart", "clip", "a", "multipolygon", "to", "the", "bound", ".", "Rings", "that", "are", "NOT", "closed", "AND", "have", "an", "endpoint", "in", "the", "bound", "will", "be", "implicitly", "closed", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L119-L161
150,988
paulmach/orb
clip/smartclip/smart.go
clipRings
func clipRings(box orb.Bound, rings []orb.Ring) (open []orb.LineString, closed []orb.Ring) { var result []orb.LineString for _, r := range rings { if !r.Closed() && (box.Contains(r[0]) || box.Contains(r[len(r)-1])) { r = append(r, r[0]) } out := clip.LineString(box, orb.LineString(r), clip.OpenBound(true)) ...
go
func clipRings(box orb.Bound, rings []orb.Ring) (open []orb.LineString, closed []orb.Ring) { var result []orb.LineString for _, r := range rings { if !r.Closed() && (box.Contains(r[0]) || box.Contains(r[len(r)-1])) { r = append(r, r[0]) } out := clip.LineString(box, orb.LineString(r), clip.OpenBound(true)) ...
[ "func", "clipRings", "(", "box", "orb", ".", "Bound", ",", "rings", "[", "]", "orb", ".", "Ring", ")", "(", "open", "[", "]", "orb", ".", "LineString", ",", "closed", "[", "]", "orb", ".", "Ring", ")", "{", "var", "result", "[", "]", "orb", "."...
// clipRings will take a set of rings and clip them to the boundary. // It returns the open lineStrings with endpoints on the boundary and // the closed interior rings.
[ "clipRings", "will", "take", "a", "set", "of", "rings", "and", "clip", "them", "to", "the", "boundary", ".", "It", "returns", "the", "open", "lineStrings", "with", "endpoints", "on", "the", "boundary", "and", "the", "closed", "interior", "rings", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L166-L223
150,989
paulmach/orb
clip/smartclip/smart.go
smartWrap
func smartWrap(box orb.Bound, input []orb.LineString, o orb.Orientation) orb.MultiPolygon { points := make([]*endpoint, 0, 2*len(input)+2) for i, r := range input { // start points = append(points, &endpoint{ Point: r[0], Start: true, Side: pointSide(box, r[0]), Index: i, OtherEnd: 2*...
go
func smartWrap(box orb.Bound, input []orb.LineString, o orb.Orientation) orb.MultiPolygon { points := make([]*endpoint, 0, 2*len(input)+2) for i, r := range input { // start points = append(points, &endpoint{ Point: r[0], Start: true, Side: pointSide(box, r[0]), Index: i, OtherEnd: 2*...
[ "func", "smartWrap", "(", "box", "orb", ".", "Bound", ",", "input", "[", "]", "orb", ".", "LineString", ",", "o", "orb", ".", "Orientation", ")", "orb", ".", "MultiPolygon", "{", "points", ":=", "make", "(", "[", "]", "*", "endpoint", ",", "0", ","...
// smartWrap takes the open lineStrings with endpoints on the boundary and // connects them correctly.
[ "smartWrap", "takes", "the", "open", "lineStrings", "with", "endpoints", "on", "the", "boundary", "and", "connects", "them", "correctly", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L248-L337
150,990
paulmach/orb
clip/smartclip/smart.go
pointSide
func pointSide(b orb.Bound, p orb.Point) uint8 { if p[1] == b.Max[1] { return 4 } else if p[1] == b.Min[1] { return 2 } else if p[0] == b.Max[0] { return 3 } else if p[0] == b.Min[0] { return 1 } return notOnSide }
go
func pointSide(b orb.Bound, p orb.Point) uint8 { if p[1] == b.Max[1] { return 4 } else if p[1] == b.Min[1] { return 2 } else if p[0] == b.Max[0] { return 3 } else if p[0] == b.Min[0] { return 1 } return notOnSide }
[ "func", "pointSide", "(", "b", "orb", ".", "Bound", ",", "p", "orb", ".", "Point", ")", "uint8", "{", "if", "p", "[", "1", "]", "==", "b", ".", "Max", "[", "1", "]", "{", "return", "4", "\n", "}", "else", "if", "p", "[", "1", "]", "==", "...
// 4 // +-+ // 1 | | 3 // +-+ // 2
[ "4", "+", "-", "+", "1", "|", "|", "3", "+", "-", "+", "2" ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L346-L358
150,991
paulmach/orb
clip/smartclip/smart.go
Less
func (e *sortableEndpoints) Less(i, j int) bool { if e.eps[i].Side != e.eps[j].Side { return e.eps[i].Side < e.eps[j].Side } switch e.eps[i].Side { case 1: if e.eps[i].Point[1] != e.eps[j].Point[1] { return e.eps[i].Point[1] >= e.eps[j].Point[1] } return e.eps[i].Before(e.mls)[1] >= e.eps[j].Before(e.m...
go
func (e *sortableEndpoints) Less(i, j int) bool { if e.eps[i].Side != e.eps[j].Side { return e.eps[i].Side < e.eps[j].Side } switch e.eps[i].Side { case 1: if e.eps[i].Point[1] != e.eps[j].Point[1] { return e.eps[i].Point[1] >= e.eps[j].Point[1] } return e.eps[i].Before(e.mls)[1] >= e.eps[j].Before(e.m...
[ "func", "(", "e", "*", "sortableEndpoints", ")", "Less", "(", "i", ",", "j", "int", ")", "bool", "{", "if", "e", ".", "eps", "[", "i", "]", ".", "Side", "!=", "e", ".", "eps", "[", "j", "]", ".", "Side", "{", "return", "e", ".", "eps", "[",...
// Less sorts the points around the bound. // First comparing what side it's on and then the actual point to determine the order. // If two points are the same, we sort by the edge attached to the point so lines that are // "above" are shorted first.
[ "Less", "sorts", "the", "points", "around", "the", "bound", ".", "First", "comparing", "what", "side", "it", "s", "on", "and", "then", "the", "actual", "point", "to", "determine", "the", "order", ".", "If", "two", "points", "are", "the", "same", "we", ...
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L373-L405
150,992
paulmach/orb
clip/smartclip/smart.go
addToMultiPolygon
func addToMultiPolygon(mp orb.MultiPolygon, ring orb.Ring) orb.MultiPolygon { for i := range mp { if polygonContains(mp[i][0], ring) { mp[i] = append(mp[i], ring) return mp } } // ring is not in any polygons? // skip it, TODO: is this correct? // If input is well formed, I think it is. If it isn't, ¯\_(...
go
func addToMultiPolygon(mp orb.MultiPolygon, ring orb.Ring) orb.MultiPolygon { for i := range mp { if polygonContains(mp[i][0], ring) { mp[i] = append(mp[i], ring) return mp } } // ring is not in any polygons? // skip it, TODO: is this correct? // If input is well formed, I think it is. If it isn't, ¯\_(...
[ "func", "addToMultiPolygon", "(", "mp", "orb", ".", "MultiPolygon", ",", "ring", "orb", ".", "Ring", ")", "orb", ".", "MultiPolygon", "{", "for", "i", ":=", "range", "mp", "{", "if", "polygonContains", "(", "mp", "[", "i", "]", "[", "0", "]", ",", ...
// addToMultiPolygon does a lookup to see which polygon the ring intersects. // This should work fine if the input is well formed.
[ "addToMultiPolygon", "does", "a", "lookup", "to", "see", "which", "polygon", "the", "ring", "intersects", ".", "This", "should", "work", "fine", "if", "the", "input", "is", "well", "formed", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/clip/smartclip/smart.go#L414-L427
150,993
paulmach/orb
bound.go
ToRing
func (b Bound) ToRing() Ring { return Ring{ b.Min, Point{b.Max[0], b.Min[1]}, b.Max, Point{b.Min[0], b.Max[1]}, b.Min, } }
go
func (b Bound) ToRing() Ring { return Ring{ b.Min, Point{b.Max[0], b.Min[1]}, b.Max, Point{b.Min[0], b.Max[1]}, b.Min, } }
[ "func", "(", "b", "Bound", ")", "ToRing", "(", ")", "Ring", "{", "return", "Ring", "{", "b", ".", "Min", ",", "Point", "{", "b", ".", "Max", "[", "0", "]", ",", "b", ".", "Min", "[", "1", "]", "}", ",", "b", ".", "Max", ",", "Point", "{",...
// ToRing converts the bound into a loop defined // by the boundary of the box.
[ "ToRing", "converts", "the", "bound", "into", "a", "loop", "defined", "by", "the", "boundary", "of", "the", "box", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/bound.go#L33-L41
150,994
paulmach/orb
bound.go
Union
func (b Bound) Union(other Bound) Bound { if other.IsEmpty() { return b } b = b.Extend(other.Min) b = b.Extend(other.Max) b = b.Extend(other.LeftTop()) b = b.Extend(other.RightBottom()) return b }
go
func (b Bound) Union(other Bound) Bound { if other.IsEmpty() { return b } b = b.Extend(other.Min) b = b.Extend(other.Max) b = b.Extend(other.LeftTop()) b = b.Extend(other.RightBottom()) return b }
[ "func", "(", "b", "Bound", ")", "Union", "(", "other", "Bound", ")", "Bound", "{", "if", "other", ".", "IsEmpty", "(", ")", "{", "return", "b", "\n", "}", "\n\n", "b", "=", "b", ".", "Extend", "(", "other", ".", "Min", ")", "\n", "b", "=", "b...
// Union extends this bound to contain the union of this and the given bound.
[ "Union", "extends", "this", "bound", "to", "contain", "the", "union", "of", "this", "and", "the", "given", "bound", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/bound.go#L63-L74
150,995
paulmach/orb
bound.go
Pad
func (b Bound) Pad(d float64) Bound { b.Min[0] -= d b.Min[1] -= d b.Max[0] += d b.Max[1] += d return b }
go
func (b Bound) Pad(d float64) Bound { b.Min[0] -= d b.Min[1] -= d b.Max[0] += d b.Max[1] += d return b }
[ "func", "(", "b", "Bound", ")", "Pad", "(", "d", "float64", ")", "Bound", "{", "b", ".", "Min", "[", "0", "]", "-=", "d", "\n", "b", ".", "Min", "[", "1", "]", "-=", "d", "\n\n", "b", ".", "Max", "[", "0", "]", "+=", "d", "\n", "b", "."...
// Pad extends the bound in all directions by the given value.
[ "Pad", "extends", "the", "bound", "in", "all", "directions", "by", "the", "given", "value", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/bound.go#L104-L112
150,996
paulmach/orb
bound.go
Center
func (b Bound) Center() Point { return Point{ (b.Min[0] + b.Max[0]) / 2.0, (b.Min[1] + b.Max[1]) / 2.0, } }
go
func (b Bound) Center() Point { return Point{ (b.Min[0] + b.Max[0]) / 2.0, (b.Min[1] + b.Max[1]) / 2.0, } }
[ "func", "(", "b", "Bound", ")", "Center", "(", ")", "Point", "{", "return", "Point", "{", "(", "b", ".", "Min", "[", "0", "]", "+", "b", ".", "Max", "[", "0", "]", ")", "/", "2.0", ",", "(", "b", ".", "Min", "[", "1", "]", "+", "b", "."...
// Center returns the center of the bounds by "averaging" the x and y coords.
[ "Center", "returns", "the", "center", "of", "the", "bounds", "by", "averaging", "the", "x", "and", "y", "coords", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/bound.go#L115-L120
150,997
paulmach/orb
bound.go
IsEmpty
func (b Bound) IsEmpty() bool { return b.Min[0] > b.Max[0] || b.Min[1] > b.Max[1] }
go
func (b Bound) IsEmpty() bool { return b.Min[0] > b.Max[0] || b.Min[1] > b.Max[1] }
[ "func", "(", "b", "Bound", ")", "IsEmpty", "(", ")", "bool", "{", "return", "b", ".", "Min", "[", "0", "]", ">", "b", ".", "Max", "[", "0", "]", "||", "b", ".", "Min", "[", "1", "]", ">", "b", ".", "Max", "[", "1", "]", "\n", "}" ]
// IsEmpty returns true if it contains zero area or if // it's in some malformed negative state where the left point is larger than the right. // This can be caused by padding too much negative.
[ "IsEmpty", "returns", "true", "if", "it", "contains", "zero", "area", "or", "if", "it", "s", "in", "some", "malformed", "negative", "state", "where", "the", "left", "point", "is", "larger", "than", "the", "right", ".", "This", "can", "be", "caused", "by"...
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/bound.go#L155-L157
150,998
paulmach/orb
bound.go
IsZero
func (b Bound) IsZero() bool { return b.Max == Point{} && b.Min == Point{} }
go
func (b Bound) IsZero() bool { return b.Max == Point{} && b.Min == Point{} }
[ "func", "(", "b", "Bound", ")", "IsZero", "(", ")", "bool", "{", "return", "b", ".", "Max", "==", "Point", "{", "}", "&&", "b", ".", "Min", "==", "Point", "{", "}", "\n", "}" ]
// IsZero return true if the bound just includes just null island.
[ "IsZero", "return", "true", "if", "the", "bound", "just", "includes", "just", "null", "island", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/bound.go#L160-L162
150,999
paulmach/orb
bound.go
Equal
func (b Bound) Equal(c Bound) bool { return b.Min == c.Min && b.Max == c.Max }
go
func (b Bound) Equal(c Bound) bool { return b.Min == c.Min && b.Max == c.Max }
[ "func", "(", "b", "Bound", ")", "Equal", "(", "c", "Bound", ")", "bool", "{", "return", "b", ".", "Min", "==", "c", ".", "Min", "&&", "b", ".", "Max", "==", "c", ".", "Max", "\n", "}" ]
// Equal returns if two bounds are equal.
[ "Equal", "returns", "if", "two", "bounds", "are", "equal", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/bound.go#L170-L172