Removed glfwGetError and glfwErrorString.

The cached error code cannot be made per-thread unless it required
glfwInit (due to lack of __thread on OS X), which would be confusing and
partially defeats the purpose of it.

Beginners would use the generic error string facility instead of the
error callback and then be confused by its nondescript messages.

Storing the provided error code from within the error callback, whether
globally or per-thread, requires just a few lines of code and hands
control to the user without compromising thread safety.
This commit is contained in:
Camilla Berglund
2012-12-30 01:42:14 +01:00
parent 9af61d06cf
commit 9cc8fc0d0a
23 changed files with 169 additions and 187 deletions

View File

@@ -951,25 +951,6 @@ GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
*/
GLFWAPI const char* glfwGetVersionString(void);
/*! @brief Retrieves the latest error.
* @return The latest @link errors error code @endlink.
* @ingroup error
*
* @remarks This function may be called before @ref glfwInit.
*/
GLFWAPI int glfwGetError(void);
/*! @brief Retrieves a generic, human readable description of the specified error.
* @param[in] error The @link errors error code @endlink to be described.
* @return A UTF-8 encoded string describing the error.
* @ingroup error
*
* @remarks This function may be called before @ref glfwInit.
*
* @remarks This function may be called from secondary threads.
*/
GLFWAPI const char* glfwErrorString(int error);
/*! @brief Sets the error callback.
* @param[in] cbfun The new callback, or @c NULL to remove the currently set
* callback.