summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoşku Baş <cosku.bas@gmail.com>2015-01-19 09:32:58 +0100
committerCoşku Baş <cosku.bas@gmail.com>2015-01-19 09:32:58 +0100
commitcf5b435f07047c20ad34f15ef4dd54be47050da1 (patch)
tree9d6136535ad57c771a9eef84fa8ee9eccef76983
parent95d7d8d2c7daf146fcb7814189f4fea08c6bd66d (diff)
downloadglfw3-cf5b435f07047c20ad34f15ef4dd54be47050da1.tar.gz
Adhere strictly to C API naming
-rw-r--r--input.go6
-rw-r--r--monitor.go2
-rw-r--r--window.go8
3 files changed, 8 insertions, 8 deletions
diff --git a/input.go b/input.go
index 7d3f5f3..c727ae7 100644
--- a/input.go
+++ b/input.go
@@ -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 {
diff --git a/monitor.go b/monitor.go
index 894d7b0..50a7e31 100644
--- a/monitor.go
+++ b/monitor.go
@@ -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()
diff --git a/window.go b/window.go
index 85ecaa8..5c13d54 100644
--- a/window.go
+++ b/window.go
@@ -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 {