Renamed glfwGetWindowParam to glfwGetWindowAttrib.

Parameters are something specified at creation time and are often
immutable, while many of the values returned by glfwGetWindowParam
reflected current state not controlled by any parameter or hint.
This commit is contained in:
Camilla Berglund
2013-05-27 15:30:32 +02:00
parent fdd4518ae5
commit ad1f6f0341
11 changed files with 66 additions and 64 deletions
+1 -1
View File
@@ -361,7 +361,7 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
return closest;
}
GLboolean _glfwRefreshContextParams(void)
GLboolean _glfwRefreshContextAttribs(void)
{
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
+6 -6
View File
@@ -690,15 +690,15 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
const _GLFWfbconfig* alternatives,
unsigned int count);
/*! @brief Checks and reads back properties from the current context.
/*! @brief Retrieves the attributes of the current context.
* @return `GL_TRUE` if successful, or `GL_FALSE` if the context is unusable.
* @ingroup utility
*/
GLboolean _glfwRefreshContextParams(void);
GLboolean _glfwRefreshContextAttribs(void);
/*! @brief Checks whether the desired context properties are valid.
* @param[in] wndconfig The context properties to check.
* @return `GL_TRUE` if the context properties are valid, or `GL_FALSE`
/*! @brief Checks whether the desired context attributes are valid.
* @param[in] wndconfig The context attributes to check.
* @return `GL_TRUE` if the context attributes are valid, or `GL_FALSE`
* otherwise.
* @ingroup utility
*
@@ -710,7 +710,7 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig);
/*! @brief Checks whether the current context fulfils the specified hard
* constraints.
* @param[in] wndconfig The desired context properties.
* @param[in] wndconfig The desired context attributes.
* @return `GL_TRUE` if the context fulfils the hard constraints, or `GL_FALSE`
* otherwise.
* @ingroup utility
+4 -4
View File
@@ -226,8 +226,8 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
glfwMakeContextCurrent((GLFWwindow*) window);
// Cache the actual (as opposed to requested) context parameters
if (!_glfwRefreshContextParams())
// Retrieve the actual (as opposed to requested) context attributes
if (!_glfwRefreshContextAttribs())
{
glfwDestroyWindow((GLFWwindow*) window);
glfwMakeContextCurrent((GLFWwindow*) previous);
@@ -521,13 +521,13 @@ GLFWAPI void glfwHideWindow(GLFWwindow* handle)
_glfwPlatformHideWindow(window);
}
GLFWAPI int glfwGetWindowParam(GLFWwindow* handle, int param)
GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
_GLFW_REQUIRE_INIT_OR_RETURN(0);
switch (param)
switch (attrib)
{
case GLFW_FOCUSED:
return window == _glfw.focusedWindow;