diff options
author | Coşku Baş <cosku.bas@gmail.com> | 2015-01-19 09:32:58 +0100 |
---|---|---|
committer | Coşku Baş <cosku.bas@gmail.com> | 2015-01-19 09:32:58 +0100 |
commit | cf5b435f07047c20ad34f15ef4dd54be47050da1 (patch) | |
tree | 9d6136535ad57c771a9eef84fa8ee9eccef76983 | |
parent | 95d7d8d2c7daf146fcb7814189f4fea08c6bd66d (diff) | |
download | glfw3-cf5b435f07047c20ad34f15ef4dd54be47050da1.tar.gz |
Adhere strictly to C API naming
-rw-r--r-- | input.go | 6 | ||||
-rw-r--r-- | monitor.go | 2 | ||||
-rw-r--r-- | window.go | 8 |
3 files changed, 8 insertions, 8 deletions
@@ -327,7 +327,7 @@ func (w *Window) GetMouseButton(button MouseButton) (Action, error) { // The coordinate can be converted to their integer equivalents with the floor // function. Casting directly to an integer type works for positive coordinates, // but fails for negative ones. -func (w *Window) GetCursorPosition() (x, y float64, err error) { +func (w *Window) GetCursorPos() (x, y float64, err error) { var xpos, ypos C.double C.glfwGetCursorPos(w.data, &xpos, &ypos) return float64(xpos), float64(ypos), fetchError() @@ -339,7 +339,7 @@ func (w *Window) GetCursorPosition() (x, y float64, err error) { // // If the cursor is disabled (with CursorDisabled) then the cursor position is // unbounded and limited only by the minimum and maximum values of a double. -func (w *Window) SetCursorPosition(xpos, ypos float64) error { +func (w *Window) SetCursorPos(xpos, ypos float64) error { C.glfwSetCursorPos(w.data, C.double(xpos), C.double(ypos)) return fetchError() } @@ -445,7 +445,7 @@ type CursorPositionCallback func(w *Window, xpos float64, ypos float64) // 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. -func (w *Window) SetCursorPositionCallback(cbfun CursorPositionCallback) (previous CursorPositionCallback, err error) { +func (w *Window) SetCursorPosCallback(cbfun CursorPositionCallback) (previous CursorPositionCallback, err error) { previous = w.fCursorPosHolder w.fCursorPosHolder = cbfun if cbfun == nil { @@ -79,7 +79,7 @@ func GetPrimaryMonitor() (*Monitor, error) { // GetPosition returns the position, in screen coordinates, of the upper-left // corner of the monitor. -func (m *Monitor) GetPosition() (x, y int, err error) { +func (m *Monitor) GetPos() (x, y int, err error) { var xpos, ypos C.int C.glfwGetMonitorPos(m.data, &xpos, &ypos) return int(xpos), int(ypos), fetchError() @@ -298,7 +298,7 @@ func (w *Window) SetTitle(title string) error { // GetPosition returns the position, in screen coordinates, of the upper-left // corner of the client area of the window. -func (w *Window) GetPosition() (x, y int, err error) { +func (w *Window) GetPos() (x, y int, err error) { var xpos, ypos C.int C.glfwGetWindowPos(w.data, &xpos, &ypos) return int(xpos), int(ypos), fetchError() @@ -318,7 +318,7 @@ func (w *Window) GetPosition() (x, y int, err error) { // The window manager may put limits on what positions are allowed. // // This function may only be called from the main thread. -func (w *Window) SetPosition(xpos, ypos int) error { +func (w *Window) SetPos(xpos, ypos int) error { C.glfwSetWindowPos(w.data, C.int(xpos), C.int(ypos)) return fetchError() } @@ -406,7 +406,7 @@ func (w *Window) GetMonitor() (*Monitor, error) { // GetAttribute returns an attribute of the window. There are many attributes, // some related to the window and others to its context. -func (w *Window) GetAttribute(attrib Hint) (int, error) { +func (w *Window) GetAttrib(attrib Hint) (int, error) { return int(C.glfwGetWindowAttrib(w.data, C.int(attrib))), fetchError() } @@ -428,7 +428,7 @@ type PositionCallback func(w *Window, xpos int, ypos int) // 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. -func (w *Window) SetPositionCallback(cbfun PositionCallback) (previous PositionCallback, err error) { +func (w *Window) SetPosCallback(cbfun PositionCallback) (previous PositionCallback, err error) { previous = w.fPosHolder w.fPosHolder = cbfun if cbfun == nil { |