diff options
author | Coşku Baş <cosku.bas@gmail.com> | 2015-01-19 09:32:58 +0100 |
---|---|---|
committer | Dmitri Shuralyov <shurcooL@gmail.com> | 2015-02-21 18:51:43 -0800 |
commit | 228af4312a951da0a736bdae0eb82a3af7742dab (patch) | |
tree | addc2bd7ba4716a6cb7cb3f04f571260f7bd5be9 | |
parent | c2a720f64c4617bc1bf155492f756f49c9ea542c (diff) | |
download | glfw-228af4312a951da0a736bdae0eb82a3af7742dab.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
@@ -347,7 +347,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() @@ -359,7 +359,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() } @@ -506,7 +506,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 { |