diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index 588b52ab..2fffa1d9 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -410,7 +410,7 @@ GLFWAPI int glfwGetVideoModes(GLFWvidmode* list, int maxcount); GLFWAPI void glfwGetDesktopMode(GLFWvidmode* mode); /* Window handling */ -GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, int mode); +GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, int mode, const char* title); GLFWAPI void glfwOpenWindowHint(int target, int hint); GLFWAPI void glfwMakeWindowCurrent(GLFWwindow window); GLFWAPI int glfwIsWindow(GLFWwindow window); diff --git a/readme.html b/readme.html index 8e439073..0c0a2f8b 100644 --- a/readme.html +++ b/readme.html @@ -268,6 +268,7 @@ version of GLFW.

  • Added glfwSetWindowUserPointer and glfwGetWindowUserPointer functions for per-window user pointers
  • Added glfwGetVersionString function for determining which code paths were enabled at compile time
  • Added windows simple multi-window test program
  • +
  • Added initial window title parameter to glfwOpenWindow
  • Changed buffer bit depth parameters of glfwOpenWindow to window hints
  • Renamed lib source code directory to src
  • Renamed glfw.h to glfw3.h to avoid conflicts with 2.x series
  • diff --git a/src/internal.h b/src/internal.h index 7ef6d6a3..93499b19 100644 --- a/src/internal.h +++ b/src/internal.h @@ -99,6 +99,7 @@ typedef struct _GLFWhints typedef struct _GLFWwndconfig { int mode; + const char* title; int refreshRate; int windowNoResize; int glMajor; diff --git a/src/win32/win32_window.c b/src/win32/win32_window.c index 3fdbc39f..30ba8145 100644 --- a/src/win32/win32_window.c +++ b/src/win32/win32_window.c @@ -1166,7 +1166,7 @@ static int createWindow(_GLFWwindow* window, window->Win32.handle = CreateWindowEx(window->Win32.dwExStyle, _GLFW_WNDCLASSNAME, - "GLFW Window", + wndconfig->title, window->Win32.dwStyle, wa.left, wa.top, // Window position fullWidth, // Decorated window width diff --git a/src/window.c b/src/window.c index f061df56..3c89abd6 100644 --- a/src/window.c +++ b/src/window.c @@ -395,7 +395,8 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, // Create the GLFW window and its associated context //======================================================================== -GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, int mode) +GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, + int mode, const char* title) { _GLFWfbconfig fbconfig; _GLFWwndconfig wndconfig; @@ -436,6 +437,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, int mode) // Set up desired window config wndconfig.mode = mode; + wndconfig.title = title; wndconfig.refreshRate = Max(_glfwLibrary.hints.refreshRate, 0); wndconfig.windowNoResize = _glfwLibrary.hints.windowNoResize ? GL_TRUE : GL_FALSE; wndconfig.glMajor = Max(_glfwLibrary.hints.glMajor, 1); diff --git a/src/x11/x11_window.c b/src/x11/x11_window.c index ba0e59b9..906f1ffc 100644 --- a/src/x11/x11_window.c +++ b/src/x11/x11_window.c @@ -828,7 +828,7 @@ static GLboolean createWindow(_GLFWwindow* window, XFree(hints); } - _glfwPlatformSetWindowTitle(window, "GLFW Window"); + _glfwPlatformSetWindowTitle(window, wndconfig->title); // Make sure the window is mapped before proceeding XMapWindow(_glfwLibrary.X11.display, window->X11.handle);