mirror of
https://github.com/glfw/glfw.git
synced 2024-11-14 10:34:34 +00:00
Fix confusing legacy parameter names
This commit is contained in:
parent
2cc6caf182
commit
d0649e6868
@ -1634,8 +1634,8 @@ GLFWAPI void glfwDefaultWindowHints(void);
|
|||||||
* glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is
|
* glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is
|
||||||
* terminated.
|
* terminated.
|
||||||
*
|
*
|
||||||
* @param[in] target The [window hint](@ref window_hints) to set.
|
* @param[in] hint The [window hint](@ref window_hints) to set.
|
||||||
* @param[in] hint The new value of the window hint.
|
* @param[in] value The new value of the window hint.
|
||||||
*
|
*
|
||||||
* @par Thread Safety
|
* @par Thread Safety
|
||||||
* This function must only be called from the main thread.
|
* This function must only be called from the main thread.
|
||||||
@ -1647,7 +1647,7 @@ GLFWAPI void glfwDefaultWindowHints(void);
|
|||||||
*
|
*
|
||||||
* @ingroup window
|
* @ingroup window
|
||||||
*/
|
*/
|
||||||
GLFWAPI void glfwWindowHint(int target, int hint);
|
GLFWAPI void glfwWindowHint(int hint, int value);
|
||||||
|
|
||||||
/*! @brief Creates a window and its associated context.
|
/*! @brief Creates a window and its associated context.
|
||||||
*
|
*
|
||||||
|
66
src/window.c
66
src/window.c
@ -270,104 +270,104 @@ void glfwDefaultWindowHints(void)
|
|||||||
_glfw.hints.refreshRate = GLFW_DONT_CARE;
|
_glfw.hints.refreshRate = GLFW_DONT_CARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWAPI void glfwWindowHint(int target, int hint)
|
GLFWAPI void glfwWindowHint(int hint, int value)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT();
|
_GLFW_REQUIRE_INIT();
|
||||||
|
|
||||||
switch (target)
|
switch (hint)
|
||||||
{
|
{
|
||||||
case GLFW_RED_BITS:
|
case GLFW_RED_BITS:
|
||||||
_glfw.hints.framebuffer.redBits = hint;
|
_glfw.hints.framebuffer.redBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_GREEN_BITS:
|
case GLFW_GREEN_BITS:
|
||||||
_glfw.hints.framebuffer.greenBits = hint;
|
_glfw.hints.framebuffer.greenBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_BLUE_BITS:
|
case GLFW_BLUE_BITS:
|
||||||
_glfw.hints.framebuffer.blueBits = hint;
|
_glfw.hints.framebuffer.blueBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_ALPHA_BITS:
|
case GLFW_ALPHA_BITS:
|
||||||
_glfw.hints.framebuffer.alphaBits = hint;
|
_glfw.hints.framebuffer.alphaBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_DEPTH_BITS:
|
case GLFW_DEPTH_BITS:
|
||||||
_glfw.hints.framebuffer.depthBits = hint;
|
_glfw.hints.framebuffer.depthBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_STENCIL_BITS:
|
case GLFW_STENCIL_BITS:
|
||||||
_glfw.hints.framebuffer.stencilBits = hint;
|
_glfw.hints.framebuffer.stencilBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_ACCUM_RED_BITS:
|
case GLFW_ACCUM_RED_BITS:
|
||||||
_glfw.hints.framebuffer.accumRedBits = hint;
|
_glfw.hints.framebuffer.accumRedBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_ACCUM_GREEN_BITS:
|
case GLFW_ACCUM_GREEN_BITS:
|
||||||
_glfw.hints.framebuffer.accumGreenBits = hint;
|
_glfw.hints.framebuffer.accumGreenBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_ACCUM_BLUE_BITS:
|
case GLFW_ACCUM_BLUE_BITS:
|
||||||
_glfw.hints.framebuffer.accumBlueBits = hint;
|
_glfw.hints.framebuffer.accumBlueBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_ACCUM_ALPHA_BITS:
|
case GLFW_ACCUM_ALPHA_BITS:
|
||||||
_glfw.hints.framebuffer.accumAlphaBits = hint;
|
_glfw.hints.framebuffer.accumAlphaBits = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_AUX_BUFFERS:
|
case GLFW_AUX_BUFFERS:
|
||||||
_glfw.hints.framebuffer.auxBuffers = hint;
|
_glfw.hints.framebuffer.auxBuffers = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_STEREO:
|
case GLFW_STEREO:
|
||||||
_glfw.hints.framebuffer.stereo = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.framebuffer.stereo = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_DOUBLEBUFFER:
|
case GLFW_DOUBLEBUFFER:
|
||||||
_glfw.hints.framebuffer.doublebuffer = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.framebuffer.doublebuffer = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_SAMPLES:
|
case GLFW_SAMPLES:
|
||||||
_glfw.hints.framebuffer.samples = hint;
|
_glfw.hints.framebuffer.samples = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_SRGB_CAPABLE:
|
case GLFW_SRGB_CAPABLE:
|
||||||
_glfw.hints.framebuffer.sRGB = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.framebuffer.sRGB = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_RESIZABLE:
|
case GLFW_RESIZABLE:
|
||||||
_glfw.hints.window.resizable = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.window.resizable = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_DECORATED:
|
case GLFW_DECORATED:
|
||||||
_glfw.hints.window.decorated = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.window.decorated = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_FOCUSED:
|
case GLFW_FOCUSED:
|
||||||
_glfw.hints.window.focused = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.window.focused = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_AUTO_ICONIFY:
|
case GLFW_AUTO_ICONIFY:
|
||||||
_glfw.hints.window.autoIconify = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.window.autoIconify = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_FLOATING:
|
case GLFW_FLOATING:
|
||||||
_glfw.hints.window.floating = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.window.floating = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_VISIBLE:
|
case GLFW_VISIBLE:
|
||||||
_glfw.hints.window.visible = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.window.visible = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_CLIENT_API:
|
case GLFW_CLIENT_API:
|
||||||
_glfw.hints.context.api = hint;
|
_glfw.hints.context.api = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_CONTEXT_VERSION_MAJOR:
|
case GLFW_CONTEXT_VERSION_MAJOR:
|
||||||
_glfw.hints.context.major = hint;
|
_glfw.hints.context.major = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_CONTEXT_VERSION_MINOR:
|
case GLFW_CONTEXT_VERSION_MINOR:
|
||||||
_glfw.hints.context.minor = hint;
|
_glfw.hints.context.minor = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_CONTEXT_ROBUSTNESS:
|
case GLFW_CONTEXT_ROBUSTNESS:
|
||||||
_glfw.hints.context.robustness = hint;
|
_glfw.hints.context.robustness = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_OPENGL_FORWARD_COMPAT:
|
case GLFW_OPENGL_FORWARD_COMPAT:
|
||||||
_glfw.hints.context.forward = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.context.forward = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_OPENGL_DEBUG_CONTEXT:
|
case GLFW_OPENGL_DEBUG_CONTEXT:
|
||||||
_glfw.hints.context.debug = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.context.debug = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_CONTEXT_NO_ERROR:
|
case GLFW_CONTEXT_NO_ERROR:
|
||||||
_glfw.hints.context.noerror = hint ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.context.noerror = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_OPENGL_PROFILE:
|
case GLFW_OPENGL_PROFILE:
|
||||||
_glfw.hints.context.profile = hint;
|
_glfw.hints.context.profile = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_CONTEXT_RELEASE_BEHAVIOR:
|
case GLFW_CONTEXT_RELEASE_BEHAVIOR:
|
||||||
_glfw.hints.context.release = hint;
|
_glfw.hints.context.release = value;
|
||||||
break;
|
break;
|
||||||
case GLFW_REFRESH_RATE:
|
case GLFW_REFRESH_RATE:
|
||||||
_glfw.hints.refreshRate = hint;
|
_glfw.hints.refreshRate = value;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint");
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint");
|
||||||
|
Loading…
Reference in New Issue
Block a user