From da311671930247712dc43247c6adaa33b2de84cd Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Thu, 18 Oct 2012 23:01:41 +0200
Subject: [PATCH] Renamed glfwGetMonitorString to glfwGetMonitorName.
---
include/GL/glfw3.h | 3 +--
readme.html | 2 +-
src/monitor.c | 12 ++----------
tests/events.c | 2 +-
tests/modes.c | 4 ++--
5 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h
index 2c30d9e0..019f6a40 100644
--- a/include/GL/glfw3.h
+++ b/include/GL/glfw3.h
@@ -458,7 +458,6 @@ extern "C" {
#define GLFW_GAMMA_RAMP_SIZE 256
/* Monitor constants */
-#define GLFW_MONITOR_NAME 0x00060000
#define GLFW_MONITOR_PHYSICAL_WIDTH 0x00060001
#define GLFW_MONITOR_PHYSICAL_HEIGHT 0x00060002
#define GLFW_MONITOR_SCREEN_POS_X 0x00060003
@@ -532,7 +531,7 @@ GLFWAPI void glfwSetErrorCallback(GLFWerrorfun cbfun);
GLFWAPI GLFWmonitor* glfwGetMonitors(int* count);
GLFWAPI GLFWmonitor glfwGetPrimaryMonitor(void);
GLFWAPI int glfwGetMonitorParam(GLFWmonitor monitor, int param);
-GLFWAPI const char* glfwGetMonitorString(GLFWmonitor monitor, int param);
+GLFWAPI const char* glfwGetMonitorName(GLFWmonitor monitor);
GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor monitor, void* pointer);
GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor monitor);
GLFWAPI void glfwSetMonitorCallback(GLFWmonitorfun cbfun);
diff --git a/readme.html b/readme.html
index d7fb76bc..5b5e2214 100644
--- a/readme.html
+++ b/readme.html
@@ -269,7 +269,7 @@ version of GLFW.
- Added
GLFWmonitor
monitor handle type and updated monitor-related functions to take a monitor handle
- Added
glfwGetMonitors
and glfwGetPrimaryMonitor
for enumerating available monitors
- - Added
glfwGetMonitorParam
and glfwGetMonitorString
for retrieving monitor properties
+ - Added
glfwGetMonitorParam
and glfwGetMonitorName
for retrieving monitor properties
- Added
glfwSetMonitorUserPointer
and glfwGetMonitorUserPointer
for per-monitor user pointers
- Added
glfwSetMonitorCallback
and GLFWmonitorfun
for notification of changes in the set of available monitors
- Added
GLFWwindow
window handle type and updated window-related functions and callbacks to take a window handle
diff --git a/src/monitor.c b/src/monitor.c
index e0b5e489..4906e793 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -334,7 +334,7 @@ GLFWAPI int glfwGetMonitorParam(GLFWmonitor handle, int param)
// Get monitor string
//========================================================================
-GLFWAPI const char* glfwGetMonitorString(GLFWmonitor handle, int param)
+GLFWAPI const char* glfwGetMonitorName(GLFWmonitor handle)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
@@ -351,15 +351,7 @@ GLFWAPI const char* glfwGetMonitorString(GLFWmonitor handle, int param)
return NULL;
}
- switch (param)
- {
- case GLFW_MONITOR_NAME:
- return monitor->name;
- }
-
- _glfwSetError(GLFW_INVALID_ENUM,
- "glfwGetMonitorString: Invalid enum value for 'param' parameter");
- return NULL;
+ return monitor->name;
}
diff --git a/tests/events.c b/tests/events.c
index f30fd5da..a006e447 100644
--- a/tests/events.c
+++ b/tests/events.c
@@ -366,7 +366,7 @@ void monitor_callback(GLFWmonitor monitor, int event)
printf("%08x at %0.3f: Monitor %s %s\n",
counter++,
glfwGetTime(),
- glfwGetMonitorString(monitor, GLFW_MONITOR_NAME),
+ glfwGetMonitorName(monitor),
get_monitor_event_name(event));
}
diff --git a/tests/modes.c b/tests/modes.c
index abb30337..2f8d30da 100644
--- a/tests/modes.c
+++ b/tests/modes.c
@@ -98,7 +98,7 @@ static void list_modes(GLFWmonitor monitor)
glfwGetVideoMode(monitor, &mode);
- printf("Name: %s\n", glfwGetMonitorString(monitor, GLFW_MONITOR_NAME));
+ printf("Name: %s\n", glfwGetMonitorName(monitor));
printf("Current mode: %s\n", format_mode(&mode));
printf("Virtual position: %i %i\n",
glfwGetMonitorParam(monitor, GLFW_MONITOR_SCREEN_POS_X),
@@ -140,7 +140,7 @@ static void test_modes(GLFWmonitor monitor)
printf("Testing mode %u on monitor %s: %s\n",
(unsigned int) i,
- glfwGetMonitorString(monitor, GLFW_MONITOR_NAME),
+ glfwGetMonitorName(monitor),
format_mode(mode));
window_handle = glfwCreateWindow(mode->width, mode->height,