1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-10-08 07:07:25 -04:00

Replace GL booleans with public macros

This commit is contained in:
Camilla Berglund 2015-08-23 19:30:04 +02:00
parent 13fbb4748a
commit 0eccf75f65
71 changed files with 581 additions and 557 deletions

View File

@ -61,6 +61,8 @@ GLFW bundles a number of dependencies in the `deps/` directory.
## Changelog
- Added `GLFW_TRUE` and `GLFW_FALSE` as client API independent boolean values
## Contact

View File

@ -103,7 +103,7 @@ creating OpenGL contexts of version 2.1 and below. Where this extension is
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
`GLFW_OPENGL_FORWARD_COMPAT` hints to `GL_TRUE` will cause @ref
`GLFW_OPENGL_FORWARD_COMPAT` hints to `GLFW_TRUE` will cause @ref
glfwCreateWindow to fail.
GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for
@ -146,7 +146,7 @@ creating OpenGL contexts of version 2.1 and below. Where this extension is
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
`GLFW_OPENGL_FORWARD_COMPAT` hints to `GL_TRUE` will cause @ref
`GLFW_OPENGL_FORWARD_COMPAT` hints to `GLFW_TRUE` will cause @ref
glfwCreateWindow to fail.
GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for
@ -176,7 +176,7 @@ version 2.1.
Because of this, on OS X 10.7 and later, the `GLFW_CONTEXT_VERSION_MAJOR` and
`GLFW_CONTEXT_VERSION_MINOR` hints will cause @ref glfwCreateWindow to fail if
given version 3.0 or 3.1, the `GLFW_OPENGL_FORWARD_COMPAT` hint must be set to
`GL_TRUE` and the `GLFW_OPENGL_PROFILE` hint must be set to
`GLFW_TRUE` and the `GLFW_OPENGL_PROFILE` hint must be set to
`GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts and the
`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.

View File

@ -64,7 +64,7 @@ contexts with hidden windows can be created with the
[GLFW_VISIBLE](@ref window_hints_wnd) window hint.
@code
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL);
@endcode
@ -271,8 +271,8 @@ if (glfwExtensionSupported("GL_ARB_debug_output"))
@endcode
The argument is a null terminated ASCII string with the extension name. If the
extension is supported, @ref glfwExtensionSupported returns `GL_TRUE`, otherwise
it returns `GL_FALSE`.
extension is supported, @ref glfwExtensionSupported returns `GLFW_TRUE`,
otherwise it returns `GLFW_FALSE`.
@subsubsection context_glext_proc Fetching function pointers

View File

@ -37,7 +37,7 @@ GLFW_NOT_INITIALIZED error.
@subsection intro_init_init Initializing GLFW
The library is initialized with @ref glfwInit, which returns `GL_FALSE` if an
The library is initialized with @ref glfwInit, which returns `GLFW_FALSE` if an
error occurred.
@code
@ -50,7 +50,7 @@ if (!glfwInit())
If any part of initialization fails, all remaining bits are terminated as if
@ref glfwTerminate was called. The library only needs to be initialized once
and additional calls to an already initialized library will simply return
`GL_TRUE` immediately.
`GLFW_TRUE` immediately.
Once the library has been successfully initialized, it should be terminated
before the application exits.

View File

@ -216,7 +216,7 @@ glfwTerminate, the window is "open".
A user attempting to close a window is now just an event like any other. Unlike
GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless
you choose them to be. Each window now has a close flag that is set to
`GL_TRUE` when the user attempts to close that window. By default, nothing else
`GLFW_TRUE` when the user attempts to close that window. By default, nothing else
happens and the window stays visible. It is then up to you to either destroy
the window, take some other action or simply ignore the request.
@ -254,7 +254,7 @@ int GLFWCALL window_close_callback(void);
void window_close_callback(GLFWwindow* window);
@endcode
@note GLFW never clears the close flag to `GL_FALSE`, meaning you can use it
@note GLFW never clears the close flag to `GLFW_FALSE`, meaning you can use it
for other reasons to close the window as well, for example the user choosing
Quit from an in-game menu.

View File

@ -60,8 +60,8 @@ the GLFW header.
@subsection quick_init_term Initializing and terminating GLFW
Before you can use most GLFW functions, the library must be initialized. On
successful initialization, `GL_TRUE` is returned. If an error occurred,
`GL_FALSE` is returned.
successful initialization, `GLFW_TRUE` is returned. If an error occurred,
`GLFW_FALSE` is returned.
@code
if (!glfwInit())
@ -192,7 +192,7 @@ callback function.
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
@endcode

View File

@ -298,12 +298,12 @@ extension.
Window hint | Default value | Supported values
------------------------------- | --------------------------- | ----------------
`GLFW_RESIZABLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
`GLFW_VISIBLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
`GLFW_DECORATED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
`GLFW_FOCUSED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
`GLFW_AUTO_ICONIFY` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
`GLFW_FLOATING` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
`GLFW_RESIZABLE` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_VISIBLE` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_DECORATED` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_FOCUSED` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_AUTO_ICONIFY` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_FLOATING` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_RED_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
`GLFW_GREEN_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
`GLFW_BLUE_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
@ -317,16 +317,16 @@ Window hint | Default value | Supported values
`GLFW_AUX_BUFFERS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
`GLFW_SAMPLES` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
`GLFW_REFRESH_RATE` | `GLFW_DONT_CARE` | 0 to `INT_MAX` or `GLFW_DONT_CARE`
`GLFW_STEREO` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
`GLFW_SRGB_CAPABLE` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
`GLFW_DOUBLEBUFFER` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
`GLFW_STEREO` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_SRGB_CAPABLE` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_DOUBLEBUFFER` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_CLIENT_API` | `GLFW_OPENGL_API` | `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API`
`GLFW_CONTEXT_VERSION_MAJOR` | 1 | Any valid major version number of the chosen client API
`GLFW_CONTEXT_VERSION_MINOR` | 0 | Any valid minor version number of the chosen client API
`GLFW_CONTEXT_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET`
`GLFW_CONTEXT_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`
`GLFW_OPENGL_FORWARD_COMPAT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
`GLFW_OPENGL_DEBUG_CONTEXT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
`GLFW_OPENGL_FORWARD_COMPAT` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_OPENGL_DEBUG_CONTEXT` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
`GLFW_OPENGL_PROFILE` | `GLFW_OPENGL_ANY_PROFILE` | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE`
@ -383,7 +383,7 @@ again unless certain conditions are met.
void window_close_callback(GLFWwindow* window)
{
if (!time_to_close)
glfwSetWindowShouldClose(window, GL_FALSE);
glfwSetWindowShouldClose(window, GLFW_FALSE);
}
@endcode
@ -746,11 +746,11 @@ either `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API`.
`GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and
`GLFW_CONTEXT_REVISION` indicate the client API version of the window's context.
`GLFW_OPENGL_FORWARD_COMPAT` is `GL_TRUE` if the window's context is an OpenGL
forward-compatible one, or `GL_FALSE` otherwise.
`GLFW_OPENGL_FORWARD_COMPAT` is `GLFW_TRUE` if the window's context is an OpenGL
forward-compatible one, or `GLFW_FALSE` otherwise.
`GLFW_OPENGL_DEBUG_CONTEXT` is `GL_TRUE` if the window's context is an OpenGL
debug context, or `GL_FALSE` otherwise.
`GLFW_OPENGL_DEBUG_CONTEXT` is `GLFW_TRUE` if the window's context is an OpenGL
debug context, or `GLFW_FALSE` otherwise.
`GLFW_OPENGL_PROFILE` indicates the OpenGL profile used by the context. This is
`GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` if the context uses

View File

@ -91,7 +91,7 @@ typedef struct {float x; float y; float z;} vertex_t;
int width, height;
GLfloat deg_rot_y = 0.f;
GLfloat deg_rot_y_inc = 2.f;
GLboolean override_pos = GL_FALSE;
int override_pos = GLFW_FALSE;
GLfloat cursor_x = 0.f;
GLfloat cursor_y = 0.f;
GLfloat ball_x = -RADIUS;
@ -236,7 +236,7 @@ void reshape( GLFWwindow* window, int w, int h )
void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods )
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
static void set_ball_pos ( GLfloat x, GLfloat y )
@ -252,12 +252,12 @@ void mouse_button_callback( GLFWwindow* window, int button, int action, int mods
if (action == GLFW_PRESS)
{
override_pos = GL_TRUE;
override_pos = GLFW_TRUE;
set_ball_pos(cursor_x, cursor_y);
}
else
{
override_pos = GL_FALSE;
override_pos = GLFW_FALSE;
}
}

View File

@ -219,7 +219,7 @@ void key( GLFWwindow* window, int k, int s, int action, int mods )
view_rotz += 5.0;
break;
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
case GLFW_KEY_UP:
view_rotx += 5.0;

View File

@ -386,7 +386,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
case GLFW_KEY_ESCAPE:
/* Exit program on Escape */
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}
}
@ -414,11 +414,11 @@ int main(int argc, char** argv)
if (!glfwInit())
exit(EXIT_FAILURE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL);
if (! window )

View File

@ -875,7 +875,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
switch (key)
{
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
case GLFW_KEY_W:
wireframe = !wireframe;

View File

@ -37,7 +37,7 @@ static void error_callback(int error, const char* description)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
int main(void)

View File

@ -473,7 +473,7 @@ static void mouseButtonFun(GLFWwindow* window, int button, int action, int mods)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}

View File

@ -278,7 +278,7 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
switch (key)
{
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
case GLFW_KEY_SPACE:
init_grid();

View File

@ -214,6 +214,24 @@ extern "C" {
#define GLFW_VERSION_REVISION 0
/*! @} */
/*! @name Boolean values
* @{ */
/*! @brief One.
*
* One. Seriously. You don't _need_ to use this symbol in your code. It's
* just semantic sugar for the number 1. You can use `1` or `true` or `_True`
* or `GL_TRUE` or whatever you want.
*/
#define GLFW_TRUE 1
/*! @brief Zero.
*
* Zero. Seriously. You don't _need_ to use this symbol in your code. It's
* just just semantic sugar for the number 0. You can use `0` or `false` or
* `_False` or `GL_FALSE` or whatever you want.
*/
#define GLFW_FALSE 0
/*! @} */
/*! @name Key and button actions
* @{ */
/*! @brief The key or mouse button was released.
@ -801,8 +819,8 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*);
* This is the function signature for window focus callback functions.
*
* @param[in] window The window that gained or lost input focus.
* @param[in] focused `GL_TRUE` if the window was given input focus, or
* `GL_FALSE` if it lost it.
* @param[in] focused `GLFW_TRUE` if the window was given input focus, or
* `GLFW_FALSE` if it lost it.
*
* @sa glfwSetWindowFocusCallback
*
@ -816,8 +834,8 @@ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);
* functions.
*
* @param[in] window The window that was iconified or restored.
* @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`
* if it was restored.
* @param[in] iconified `GLFW_TRUE` if the window was iconified, or
* `GLFW_FALSE` if it was restored.
*
* @sa glfwSetWindowIconifyCallback
*
@ -876,8 +894,8 @@ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);
* This is the function signature for cursor enter/leave callback functions.
*
* @param[in] window The window that received the event.
* @param[in] entered `GL_TRUE` if the cursor entered the window's client
* area, or `GL_FALSE` if it left it.
* @param[in] entered `GLFW_TRUE` if the cursor entered the window's client
* area, or `GLFW_FALSE` if it left it.
*
* @sa glfwSetCursorEnterCallback
*
@ -1057,9 +1075,9 @@ typedef struct GLFWimage
* succeeds, you should call @ref glfwTerminate before the application exits.
*
* Additional calls to this function after successful initialization but before
* termination will return `GL_TRUE` immediately.
* termination will return `GLFW_TRUE` immediately.
*
* @return `GL_TRUE` if successful, or `GL_FALSE` if an
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
* @remarks __OS X:__ This function will change the current directory of the
@ -2420,20 +2438,20 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
* and unlimited cursor movement. This is useful for implementing for
* example 3D camera controls.
*
* If the mode is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to
* enable sticky keys, or `GL_FALSE` to disable it. If sticky keys are
* If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to
* enable sticky keys, or `GLFW_FALSE` to disable it. If sticky keys are
* enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS`
* the next time it is called even if the key had been released before the
* call. This is useful when you are only interested in whether keys have been
* pressed but not when or in which order.
*
* If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either
* `GL_TRUE` to enable sticky mouse buttons, or `GL_FALSE` to disable it. If
* sticky mouse buttons are enabled, a mouse button press will ensure that @ref
* glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even if
* the mouse button had been released before the call. This is useful when you
* are only interested in whether mouse buttons have been pressed but not when
* or in which order.
* `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it.
* If sticky mouse buttons are enabled, a mouse button press will ensure that
* @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even
* if the mouse button had been released before the call. This is useful when
* you are only interested in whether mouse buttons have been pressed but not
* when or in which order.
*
* @param[in] window The window whose input mode to set.
* @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
@ -2957,7 +2975,7 @@ GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun);
* This function returns whether the specified joystick is present.
*
* @param[in] joy The [joystick](@ref joysticks) to query.
* @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise.
* @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise.
*
* @par Thread Safety
* This function may only be called from the main thread.
@ -3279,7 +3297,8 @@ GLFWAPI void glfwSwapInterval(int interval);
* a context, so there is no danger in doing this.
*
* @param[in] extension The ASCII encoded name of the extension.
* @return `GL_TRUE` if the extension is available, or `GL_FALSE` otherwise.
* @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE`
* otherwise.
*
* @par Thread Safety
* This function may be called from any thread.

View File

@ -207,17 +207,17 @@ int _glfwPlatformInit(void)
_glfw.ns.eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
if (!_glfw.ns.eventSource)
return GL_FALSE;
return GLFW_FALSE;
CGEventSourceSetLocalEventsSuppressionInterval(_glfw.ns.eventSource, 0.0);
if (!_glfwInitContextAPI())
return GL_FALSE;
return GLFW_FALSE;
_glfwInitTimer();
_glfwInitJoysticks();
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformTerminate(void)

View File

@ -76,28 +76,28 @@ static char* getDisplayName(CGDirectDisplayID displayID)
// Check whether the display mode should be included in enumeration
//
static GLboolean modeIsGood(CGDisplayModeRef mode)
static GLFWbool modeIsGood(CGDisplayModeRef mode)
{
uint32_t flags = CGDisplayModeGetIOFlags(mode);
if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag))
return GL_FALSE;
return GLFW_FALSE;
if (flags & kDisplayModeInterlacedFlag)
return GL_FALSE;
return GLFW_FALSE;
if (flags & kDisplayModeStretchedFlag)
return GL_FALSE;
return GLFW_FALSE;
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
{
CFRelease(format);
return GL_FALSE;
return GLFW_FALSE;
}
CFRelease(format);
return GL_TRUE;
return GLFW_TRUE;
}
// Convert Core Graphics display mode to GLFW video mode
@ -166,7 +166,7 @@ static void endFadeReservation(CGDisplayFadeReservationToken token)
// Change the current video mode
//
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
{
CFArrayRef modes;
CFIndex count, i;
@ -178,7 +178,7 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
best = _glfwChooseVideoMode(monitor, desired);
_glfwPlatformGetVideoMode(monitor, &current);
if (_glfwCompareVideoModes(&current, best) == 0)
return GL_TRUE;
return GLFW_TRUE;
CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
@ -216,10 +216,10 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Cocoa: Monitor mode list changed");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
// Restore the previously saved (original) video mode
@ -283,7 +283,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
return monitors;
}
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
{
// HACK: Compare unit numbers instead of display IDs to work around display
// replacement on machines with automatic graphics switching

View File

@ -116,7 +116,7 @@ typedef struct _GLFWtimeNS
void _glfwInitTimer(void);
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
#endif // _glfw3_cocoa_platform_h_

View File

@ -66,10 +66,10 @@ static void centerCursor(_GLFWwindow *window)
// Enter full screen mode
//
static GLboolean enterFullscreenMode(_GLFWwindow* window)
static GLFWbool enterFullscreenMode(_GLFWwindow* window)
{
GLFWvidmode mode;
GLboolean status;
GLFWbool status;
int xpos, ypos;
status = _glfwSetVideoMode(window->monitor, &window->videoMode);
@ -207,7 +207,7 @@ static int translateKey(unsigned int key)
if (window->monitor)
leaveFullscreenMode(window);
_glfwInputWindowIconify(window, GL_TRUE);
_glfwInputWindowIconify(window, GLFW_TRUE);
}
- (void)windowDidDeminiaturize:(NSNotification *)notification
@ -215,7 +215,7 @@ static int translateKey(unsigned int key)
if (window->monitor)
enterFullscreenMode(window);
_glfwInputWindowIconify(window, GL_FALSE);
_glfwInputWindowIconify(window, GLFW_FALSE);
}
- (void)windowDidBecomeKey:(NSNotification *)notification
@ -226,7 +226,7 @@ static int translateKey(unsigned int key)
centerCursor(window);
}
_glfwInputWindowFocus(window, GL_TRUE);
_glfwInputWindowFocus(window, GLFW_TRUE);
_glfwPlatformSetCursorMode(window, window->cursorMode);
}
@ -235,7 +235,7 @@ static int translateKey(unsigned int key)
if (window->monitor && window->autoIconify)
_glfwPlatformIconifyWindow(window);
_glfwInputWindowFocus(window, GL_FALSE);
_glfwInputWindowFocus(window, GLFW_FALSE);
}
@end
@ -440,12 +440,12 @@ static int translateKey(unsigned int key)
- (void)mouseExited:(NSEvent *)event
{
_glfwInputCursorEnter(window, GL_FALSE);
_glfwInputCursorEnter(window, GLFW_FALSE);
}
- (void)mouseEntered:(NSEvent *)event
{
_glfwInputCursorEnter(window, GL_TRUE);
_glfwInputCursorEnter(window, GLFW_TRUE);
}
- (void)viewDidChangeBackingProperties
@ -782,10 +782,10 @@ static void createMenuBar(void)
// Initialize the Cocoa Application Kit
//
static GLboolean initializeAppKit(void)
static GLFWbool initializeAppKit(void)
{
if (NSApp)
return GL_TRUE;
return GLFW_TRUE;
// Implicitly create shared NSApplication instance
[GLFWApplication sharedApplication];
@ -807,18 +807,18 @@ static GLboolean initializeAppKit(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Cocoa: Failed to create application delegate");
return GL_FALSE;
return GLFW_FALSE;
}
[NSApp setDelegate:_glfw.ns.delegate];
[NSApp run];
return GL_TRUE;
return GLFW_TRUE;
}
// Create the Cocoa window
//
static GLboolean createWindow(_GLFWwindow* window,
static GLFWbool createWindow(_GLFWwindow* window,
const _GLFWwndconfig* wndconfig)
{
window->ns.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window];
@ -826,7 +826,7 @@ static GLboolean createWindow(_GLFWwindow* window,
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Cocoa: Failed to create window delegate");
return GL_FALSE;
return GLFW_FALSE;
}
unsigned int styleMask = 0;
@ -866,7 +866,7 @@ static GLboolean createWindow(_GLFWwindow* window,
if (window->ns.object == nil)
{
_glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to create window");
return GL_FALSE;
return GLFW_FALSE;
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
@ -908,7 +908,7 @@ static GLboolean createWindow(_GLFWwindow* window,
[window->ns.object setRestorable:NO];
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
return GL_TRUE;
return GLFW_TRUE;
}
@ -922,13 +922,13 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
const _GLFWfbconfig* fbconfig)
{
if (!initializeAppKit())
return GL_FALSE;
return GLFW_FALSE;
if (!createWindow(window, wndconfig))
return GL_FALSE;
return GLFW_FALSE;
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
return GL_FALSE;
return GLFW_FALSE;
[window->nsgl.context setView:window->ns.view];
@ -936,10 +936,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
{
_glfwPlatformShowWindow(window);
if (!enterFullscreenMode(window))
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
@ -1196,7 +1196,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
NSBitmapImageRep* rep;
if (!initializeAppKit())
return GL_FALSE;
return GLFW_FALSE;
rep = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:NULL
@ -1212,7 +1212,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
bitsPerPixel:32];
if (rep == nil)
return GL_FALSE;
return GLFW_FALSE;
memcpy([rep bitmapData], image->pixels, image->width * image->height * 4);
@ -1226,26 +1226,26 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
[rep release];
if (cursor->ns.object == nil)
return GL_FALSE;
return GLFW_FALSE;
return GL_TRUE;
return GLFW_TRUE;
}
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
{
if (!initializeAppKit())
return GL_FALSE;
return GLFW_FALSE;
cursor->ns.object = getStandardCursor(shape);
if (!cursor->ns.object)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Cocoa: Failed to retrieve standard cursor");
return GL_FALSE;
return GLFW_FALSE;
}
[cursor->ns.object retain];
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)

View File

@ -35,7 +35,7 @@
// Parses the client API version string and extracts the version number
//
static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
static GLFWbool parseVersionString(int* api, int* major, int* minor, int* rev)
{
int i;
_GLFWwindow* window;
@ -57,7 +57,7 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Failed to retrieve context version string");
return GL_FALSE;
return GLFW_FALSE;
}
for (i = 0; prefixes[i]; i++)
@ -76,10 +76,10 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"No version found in context version string");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
@ -87,13 +87,13 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
////// GLFW internal API //////
//////////////////////////////////////////////////////////////////////////
GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
{
if (ctxconfig->api != GLFW_OPENGL_API &&
ctxconfig->api != GLFW_OPENGL_ES_API)
{
_glfwInputError(GLFW_INVALID_ENUM, "Invalid client API");
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->api == GLFW_OPENGL_API)
@ -112,7 +112,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
_glfwInputError(GLFW_INVALID_VALUE,
"Invalid OpenGL version %i.%i",
ctxconfig->major, ctxconfig->minor);
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->profile)
@ -122,7 +122,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
{
_glfwInputError(GLFW_INVALID_ENUM,
"Invalid OpenGL profile");
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->major < 3 ||
@ -133,7 +133,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
_glfwInputError(GLFW_INVALID_VALUE,
"Context profiles are only defined for OpenGL version 3.2 and above");
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -142,7 +142,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
// Forward-compatible contexts are only defined for OpenGL version 3.0 and above
_glfwInputError(GLFW_INVALID_VALUE,
"Forward-compatibility is only defined for OpenGL version 3.0 and above");
return GL_FALSE;
return GLFW_FALSE;
}
}
else if (ctxconfig->api == GLFW_OPENGL_ES_API)
@ -159,7 +159,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
_glfwInputError(GLFW_INVALID_VALUE,
"Invalid OpenGL ES version %i.%i",
ctxconfig->major, ctxconfig->minor);
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -170,7 +170,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
{
_glfwInputError(GLFW_INVALID_ENUM,
"Invalid context robustness mode");
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -181,11 +181,11 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
{
_glfwInputError(GLFW_INVALID_ENUM,
"Invalid context release behavior");
return GL_FALSE;
return GLFW_FALSE;
}
}
return GL_TRUE;
return GLFW_TRUE;
}
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
@ -351,7 +351,7 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
return closest;
}
GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
{
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
@ -364,7 +364,7 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
&window->context.minor,
&window->context.revision))
{
return GL_FALSE;
return GLFW_FALSE;
}
#if defined(_GLFW_USE_OPENGL)
@ -379,7 +379,7 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Entry point retrieval is broken");
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -392,17 +392,17 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
window->GetIntegerv(GL_CONTEXT_FLAGS, &flags);
if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
window->context.forward = GL_TRUE;
window->context.forward = GLFW_TRUE;
if (flags & GL_CONTEXT_FLAG_DEBUG_BIT)
window->context.debug = GL_TRUE;
window->context.debug = GLFW_TRUE;
else if (glfwExtensionSupported("GL_ARB_debug_output") &&
ctxconfig->debug)
{
// HACK: This is a workaround for older drivers (pre KHR_debug)
// not setting the debug bit in the context flags for
// debug contexts
window->context.debug = GL_TRUE;
window->context.debug = GLFW_TRUE;
}
}
@ -472,10 +472,10 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
}
#endif // _GLFW_USE_OPENGL
return GL_TRUE;
return GLFW_TRUE;
}
GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
GLFWbool _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
{
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
@ -491,10 +491,10 @@ GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
// {GLX|WGL}_ARB_create_context extension and fail here
_glfwInputError(GLFW_VERSION_UNAVAILABLE, NULL);
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
int _glfwStringInExtensionString(const char* string, const char* extensions)
@ -508,7 +508,7 @@ int _glfwStringInExtensionString(const char* string, const char* extensions)
where = strstr(start, string);
if (!where)
return GL_FALSE;
return GLFW_FALSE;
terminator = where + strlen(string);
if (where == start || *(where - 1) == ' ')
@ -520,7 +520,7 @@ int _glfwStringInExtensionString(const char* string, const char* extensions)
start = terminator;
}
return GL_TRUE;
return GLFW_TRUE;
}
@ -565,19 +565,19 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
{
_GLFWwindow* window;
_GLFW_REQUIRE_INIT_OR_RETURN(GL_FALSE);
_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);
window = _glfwPlatformGetCurrentContext();
if (!window)
{
_glfwInputError(GLFW_NO_CURRENT_CONTEXT, NULL);
return GL_FALSE;
return GLFW_FALSE;
}
if (*extension == '\0')
{
_glfwInputError(GLFW_INVALID_VALUE, NULL);
return GL_FALSE;
return GLFW_FALSE;
}
#if defined(_GLFW_USE_OPENGL)
@ -597,11 +597,11 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Failed to retrieve extension string %i", i);
return GL_FALSE;
return GLFW_FALSE;
}
if (strcmp(en, extension) == 0)
return GL_TRUE;
return GLFW_TRUE;
}
}
else
@ -614,11 +614,11 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Failed to retrieve extension string");
return GL_FALSE;
return GLFW_FALSE;
}
if (_glfwStringInExtensionString(extension, extensions))
return GL_TRUE;
return GLFW_TRUE;
}
// Check if extension is in the platform-specific string

View File

@ -84,7 +84,7 @@ static int getConfigAttrib(EGLConfig config, int attrib)
// Return a list of available and usable framebuffer configs
//
static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
static GLFWbool chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* desired,
EGLConfig* result)
{
@ -97,7 +97,7 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
if (!nativeCount)
{
_glfwInputError(GLFW_API_UNAVAILABLE, "EGL: No EGLConfigs returned");
return GL_FALSE;
return GLFW_FALSE;
}
nativeConfigs = calloc(nativeCount, sizeof(EGLConfig));
@ -154,7 +154,7 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
u->stencilBits = getConfigAttrib(n, EGL_STENCIL_SIZE);
u->samples = getConfigAttrib(n, EGL_SAMPLES);
u->doublebuffer = GL_TRUE;
u->doublebuffer = GLFW_TRUE;
u->egl = n;
usableCount++;
@ -167,7 +167,7 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
free(nativeConfigs);
free(usableConfigs);
return closest ? GL_TRUE : GL_FALSE;
return closest ? GLFW_TRUE : GLFW_FALSE;
}
@ -194,7 +194,7 @@ int _glfwInitContextAPI(void)
};
if (!_glfwCreateContextTLS())
return GL_FALSE;
return GLFW_FALSE;
for (i = 0; sonames[i]; i++)
{
@ -206,7 +206,7 @@ int _glfwInitContextAPI(void)
if (!_glfw.egl.handle)
{
_glfwInputError(GLFW_API_UNAVAILABLE, "EGL: Failed to load EGL");
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.egl.GetConfigAttrib =
@ -249,7 +249,7 @@ int _glfwInitContextAPI(void)
_glfwInputError(GLFW_API_UNAVAILABLE,
"EGL: Failed to get EGL display: %s",
getErrorString(_glfw_eglGetError()));
return GL_FALSE;
return GLFW_FALSE;
}
if (!_glfw_eglInitialize(_glfw.egl.display,
@ -259,13 +259,13 @@ int _glfwInitContextAPI(void)
_glfwInputError(GLFW_API_UNAVAILABLE,
"EGL: Failed to initialize EGL: %s",
getErrorString(_glfw_eglGetError()));
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.egl.KHR_create_context =
_glfwPlatformExtensionSupported("EGL_KHR_create_context");
return GL_TRUE;
return GLFW_TRUE;
}
// Terminate EGL
@ -308,7 +308,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
"EGL: Failed to find a suitable EGLConfig");
return GL_FALSE;
return GLFW_FALSE;
}
#if defined(_GLFW_X11)
@ -355,7 +355,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"EGL: Failed to retrieve visual for EGLConfig");
return GL_FALSE;
return GLFW_FALSE;
}
}
#endif // _GLFW_X11
@ -367,7 +367,7 @@ int _glfwCreateContext(_GLFWwindow* window,
_glfwInputError(GLFW_API_UNAVAILABLE,
"EGL: Failed to bind OpenGL ES: %s",
getErrorString(_glfw_eglGetError()));
return GL_FALSE;
return GLFW_FALSE;
}
}
else
@ -377,7 +377,7 @@ int _glfwCreateContext(_GLFWwindow* window,
_glfwInputError(GLFW_API_UNAVAILABLE,
"EGL: Failed to bind OpenGL: %s",
getErrorString(_glfw_eglGetError()));
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -450,7 +450,7 @@ int _glfwCreateContext(_GLFWwindow* window,
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"EGL: Failed to create context: %s",
getErrorString(_glfw_eglGetError()));
return GL_FALSE;
return GLFW_FALSE;
}
window->egl.config = config;
@ -515,11 +515,11 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_API_UNAVAILABLE,
"EGL: Failed to load client library");
return GL_FALSE;
return GLFW_FALSE;
}
}
return GL_TRUE;
return GLFW_TRUE;
}
#undef setEGLattrib
@ -632,10 +632,10 @@ int _glfwPlatformExtensionSupported(const char* extension)
if (extensions)
{
if (_glfwStringInExtensionString(extension, extensions))
return GL_TRUE;
return GLFW_TRUE;
}
return GL_FALSE;
return GLFW_FALSE;
}
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)

View File

@ -109,7 +109,7 @@ typedef struct _GLFWlibraryEGL
EGLDisplay display;
EGLint major, minor;
GLboolean KHR_create_context;
GLFWbool KHR_create_context;
void* handle;

View File

@ -48,27 +48,27 @@ static int getFBConfigAttrib(GLXFBConfig fbconfig, int attrib)
// Return a list of available and usable framebuffer configs
//
static GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* result)
static GLFWbool chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* result)
{
GLXFBConfig* nativeConfigs;
_GLFWfbconfig* usableConfigs;
const _GLFWfbconfig* closest;
int i, nativeCount, usableCount;
const char* vendor;
GLboolean trustWindowBit = GL_TRUE;
GLFWbool trustWindowBit = GLFW_TRUE;
// HACK: This is a (hopefully temporary) workaround for Chromium
// (VirtualBox GL) not setting the window bit on any GLXFBConfigs
vendor = _glfw_glXGetClientString(_glfw.x11.display, GLX_VENDOR);
if (strcmp(vendor, "Chromium") == 0)
trustWindowBit = GL_FALSE;
trustWindowBit = GLFW_FALSE;
nativeConfigs = _glfw_glXGetFBConfigs(_glfw.x11.display, _glfw.x11.screen,
&nativeCount);
if (!nativeCount)
{
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: No GLXFBConfigs returned");
return GL_FALSE;
return GLFW_FALSE;
}
usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig));
@ -110,9 +110,9 @@ static GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* resul
u->auxBuffers = getFBConfigAttrib(n, GLX_AUX_BUFFERS);
if (getFBConfigAttrib(n, GLX_STEREO))
u->stereo = GL_TRUE;
u->stereo = GLFW_TRUE;
if (getFBConfigAttrib(n, GLX_DOUBLEBUFFER))
u->doublebuffer = GL_TRUE;
u->doublebuffer = GLFW_TRUE;
if (_glfw.glx.ARB_multisample)
u->samples = getFBConfigAttrib(n, GLX_SAMPLES);
@ -131,7 +131,7 @@ static GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* resul
XFree(nativeConfigs);
free(usableConfigs);
return closest ? GL_TRUE : GL_FALSE;
return closest ? GLFW_TRUE : GLFW_FALSE;
}
// Create the OpenGL context using legacy API
@ -163,13 +163,13 @@ int _glfwInitContextAPI(void)
#endif
if (!_glfwCreateContextTLS())
return GL_FALSE;
return GLFW_FALSE;
_glfw.glx.handle = dlopen(soname, RTLD_LAZY | RTLD_GLOBAL);
if (!_glfw.glx.handle)
{
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: %s", dlerror());
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.glx.GetFBConfigs =
@ -204,7 +204,7 @@ int _glfwInitContextAPI(void)
&_glfw.glx.eventBase))
{
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: GLX extension not found");
return GL_FALSE;
return GLFW_FALSE;
}
if (!_glfw_glXQueryVersion(_glfw.x11.display,
@ -213,14 +213,14 @@ int _glfwInitContextAPI(void)
{
_glfwInputError(GLFW_API_UNAVAILABLE,
"GLX: Failed to query GLX version");
return GL_FALSE;
return GLFW_FALSE;
}
if (_glfw.glx.major == 1 && _glfw.glx.minor < 3)
{
_glfwInputError(GLFW_API_UNAVAILABLE,
"GLX: GLX version 1.3 is required");
return GL_FALSE;
return GLFW_FALSE;
}
if (_glfwPlatformExtensionSupported("GLX_EXT_swap_control"))
@ -229,7 +229,7 @@ int _glfwInitContextAPI(void)
_glfwPlatformGetProcAddress("glXSwapIntervalEXT");
if (_glfw.glx.SwapIntervalEXT)
_glfw.glx.EXT_swap_control = GL_TRUE;
_glfw.glx.EXT_swap_control = GLFW_TRUE;
}
if (_glfwPlatformExtensionSupported("GLX_SGI_swap_control"))
@ -238,7 +238,7 @@ int _glfwInitContextAPI(void)
_glfwPlatformGetProcAddress("glXSwapIntervalSGI");
if (_glfw.glx.SwapIntervalSGI)
_glfw.glx.SGI_swap_control = GL_TRUE;
_glfw.glx.SGI_swap_control = GLFW_TRUE;
}
if (_glfwPlatformExtensionSupported("GLX_MESA_swap_control"))
@ -247,17 +247,17 @@ int _glfwInitContextAPI(void)
_glfwPlatformGetProcAddress("glXSwapIntervalMESA");
if (_glfw.glx.SwapIntervalMESA)
_glfw.glx.MESA_swap_control = GL_TRUE;
_glfw.glx.MESA_swap_control = GLFW_TRUE;
}
if (_glfwPlatformExtensionSupported("GLX_ARB_multisample"))
_glfw.glx.ARB_multisample = GL_TRUE;
_glfw.glx.ARB_multisample = GLFW_TRUE;
if (_glfwPlatformExtensionSupported("GLX_ARB_framebuffer_sRGB"))
_glfw.glx.ARB_framebuffer_sRGB = GL_TRUE;
_glfw.glx.ARB_framebuffer_sRGB = GLFW_TRUE;
if (_glfwPlatformExtensionSupported("GLX_EXT_framebuffer_sRGB"))
_glfw.glx.EXT_framebuffer_sRGB = GL_TRUE;
_glfw.glx.EXT_framebuffer_sRGB = GLFW_TRUE;
if (_glfwPlatformExtensionSupported("GLX_ARB_create_context"))
{
@ -265,22 +265,22 @@ int _glfwInitContextAPI(void)
_glfwPlatformGetProcAddress("glXCreateContextAttribsARB");
if (_glfw.glx.CreateContextAttribsARB)
_glfw.glx.ARB_create_context = GL_TRUE;
_glfw.glx.ARB_create_context = GLFW_TRUE;
}
if (_glfwPlatformExtensionSupported("GLX_ARB_create_context_robustness"))
_glfw.glx.ARB_create_context_robustness = GL_TRUE;
_glfw.glx.ARB_create_context_robustness = GLFW_TRUE;
if (_glfwPlatformExtensionSupported("GLX_ARB_create_context_profile"))
_glfw.glx.ARB_create_context_profile = GL_TRUE;
_glfw.glx.ARB_create_context_profile = GLFW_TRUE;
if (_glfwPlatformExtensionSupported("GLX_EXT_create_context_es2_profile"))
_glfw.glx.EXT_create_context_es2_profile = GL_TRUE;
_glfw.glx.EXT_create_context_es2_profile = GLFW_TRUE;
if (_glfwPlatformExtensionSupported("GLX_ARB_context_flush_control"))
_glfw.glx.ARB_context_flush_control = GL_TRUE;
_glfw.glx.ARB_context_flush_control = GLFW_TRUE;
return GL_TRUE;
return GLFW_TRUE;
}
// Terminate GLX
@ -323,7 +323,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
"GLX: Failed to find a suitable GLXFBConfig");
return GL_FALSE;
return GLFW_FALSE;
}
window->glx.visual = _glfw_glXGetVisualFromFBConfig(_glfw.x11.display,
@ -332,7 +332,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"GLX: Failed to retrieve visual for GLXFBConfig");
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->api == GLFW_OPENGL_ES_API)
@ -343,7 +343,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_API_UNAVAILABLE,
"GLX: OpenGL ES requested but GLX_EXT_create_context_es2_profile is unavailable");
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -353,7 +353,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"GLX: Forward compatibility requested but GLX_ARB_create_context_profile is unavailable");
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -364,7 +364,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"GLX: An OpenGL profile requested but GLX_ARB_create_context_profile is unavailable");
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -459,7 +459,7 @@ int _glfwCreateContext(_GLFWwindow* window,
if (_glfw.x11.errorCode == _glfw.glx.errorBase + GLXBadProfileARB &&
ctxconfig->api == GLFW_OPENGL_API &&
ctxconfig->profile == GLFW_OPENGL_ANY_PROFILE &&
ctxconfig->forward == GL_FALSE)
ctxconfig->forward == GLFW_FALSE)
{
window->glx.context = createLegacyContext(window, native, share);
}
@ -473,10 +473,10 @@ int _glfwCreateContext(_GLFWwindow* window,
if (!window->glx.context)
{
_glfwInputXError(GLFW_VERSION_UNAVAILABLE, "GLX: Failed to create context");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
#undef setGLXattrib
@ -548,10 +548,10 @@ int _glfwPlatformExtensionSupported(const char* extension)
if (extensions)
{
if (_glfwStringInExtensionString(extension, extensions))
return GL_TRUE;
return GLFW_TRUE;
}
return GL_FALSE;
return GLFW_FALSE;
}
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)

View File

@ -110,17 +110,17 @@ typedef struct _GLFWlibraryGLX
PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT;
PFNGLXSWAPINTERVALMESAPROC SwapIntervalMESA;
PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
GLboolean SGI_swap_control;
GLboolean EXT_swap_control;
GLboolean MESA_swap_control;
GLboolean ARB_multisample;
GLboolean ARB_framebuffer_sRGB;
GLboolean EXT_framebuffer_sRGB;
GLboolean ARB_create_context;
GLboolean ARB_create_context_profile;
GLboolean ARB_create_context_robustness;
GLboolean EXT_create_context_es2_profile;
GLboolean ARB_context_flush_control;
GLFWbool SGI_swap_control;
GLFWbool EXT_swap_control;
GLFWbool MESA_swap_control;
GLFWbool ARB_multisample;
GLFWbool ARB_framebuffer_sRGB;
GLFWbool EXT_framebuffer_sRGB;
GLFWbool ARB_create_context;
GLFWbool ARB_create_context_profile;
GLFWbool ARB_create_context_robustness;
GLFWbool EXT_create_context_es2_profile;
GLFWbool ARB_context_flush_control;
} _GLFWlibraryGLX;

View File

@ -39,7 +39,7 @@
// Global state shared between compilation units of GLFW
// These are documented in internal.h
//
GLboolean _glfwInitialized = GL_FALSE;
GLFWbool _glfwInitialized = GLFW_FALSE;
_GLFWlibrary _glfw;
// This is outside of _glfw so it can be initialized and usable before
@ -118,23 +118,23 @@ void _glfwInputError(int error, const char* format, ...)
GLFWAPI int glfwInit(void)
{
if (_glfwInitialized)
return GL_TRUE;
return GLFW_TRUE;
memset(&_glfw, 0, sizeof(_glfw));
if (!_glfwPlatformInit())
{
_glfwPlatformTerminate();
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
_glfwInitialized = GL_TRUE;
_glfwInitialized = GLFW_TRUE;
// Not all window hints have zero as their default value
glfwDefaultWindowHints();
return GL_TRUE;
return GLFW_TRUE;
}
GLFWAPI void glfwTerminate(void)
@ -166,7 +166,7 @@ GLFWAPI void glfwTerminate(void)
_glfwPlatformTerminate();
memset(&_glfw, 0, sizeof(_glfw));
_glfwInitialized = GL_FALSE;
_glfwInitialized = GLFW_FALSE;
}
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev)

View File

@ -135,13 +135,13 @@ void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int m
{
if (key >= 0 && key <= GLFW_KEY_LAST)
{
GLboolean repeated = GL_FALSE;
GLFWbool repeated = GLFW_FALSE;
if (action == GLFW_RELEASE && window->keys[key] == GLFW_RELEASE)
return;
if (action == GLFW_PRESS && window->keys[key] == GLFW_PRESS)
repeated = GL_TRUE;
repeated = GLFW_TRUE;
if (action == GLFW_RELEASE && window->stickyKeys)
window->keys[key] = _GLFW_STICK;
@ -259,10 +259,10 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
setCursorMode(window, value);
break;
case GLFW_STICKY_KEYS:
setStickyKeys(window, value ? GL_TRUE : GL_FALSE);
setStickyKeys(window, value ? GLFW_TRUE : GLFW_FALSE);
break;
case GLFW_STICKY_MOUSE_BUTTONS:
setStickyMouseButtons(window, value ? GL_TRUE : GL_FALSE);
setStickyMouseButtons(window, value ? GLFW_TRUE : GLFW_FALSE);
break;
default:
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode");

View File

@ -81,6 +81,8 @@ typedef struct _GLFWlibrary _GLFWlibrary;
typedef struct _GLFWmonitor _GLFWmonitor;
typedef struct _GLFWcursor _GLFWcursor;
typedef int GLFWbool;
#if defined(_GLFW_COCOA)
#include "cocoa_platform.h"
#elif defined(_GLFW_WIN32)
@ -166,12 +168,12 @@ struct _GLFWwndconfig
int width;
int height;
const char* title;
GLboolean resizable;
GLboolean visible;
GLboolean decorated;
GLboolean focused;
GLboolean autoIconify;
GLboolean floating;
GLFWbool resizable;
GLFWbool visible;
GLFWbool decorated;
GLFWbool focused;
GLFWbool autoIconify;
GLFWbool floating;
_GLFWmonitor* monitor;
};
@ -187,8 +189,8 @@ struct _GLFWctxconfig
int api;
int major;
int minor;
GLboolean forward;
GLboolean debug;
GLFWbool forward;
GLFWbool debug;
int profile;
int robustness;
int release;
@ -234,19 +236,19 @@ struct _GLFWwindow
struct _GLFWwindow* next;
// Window settings and state
GLboolean resizable;
GLboolean decorated;
GLboolean autoIconify;
GLboolean floating;
GLboolean closed;
GLFWbool resizable;
GLFWbool decorated;
GLFWbool autoIconify;
GLFWbool floating;
GLFWbool closed;
void* userPointer;
GLFWvidmode videoMode;
_GLFWmonitor* monitor;
_GLFWcursor* cursor;
// Window input state
GLboolean stickyKeys;
GLboolean stickyMouseButtons;
GLFWbool stickyKeys;
GLFWbool stickyMouseButtons;
double cursorPosX, cursorPosY;
int cursorMode;
char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
@ -256,7 +258,7 @@ struct _GLFWwindow
struct {
int api;
int major, minor, revision;
GLboolean forward, debug;
GLFWbool forward, debug;
int profile;
int robustness;
int release;
@ -369,7 +371,7 @@ struct _GLFWlibrary
/*! @brief Flag indicating whether GLFW has been successfully initialized.
*/
extern GLboolean _glfwInitialized;
extern GLFWbool _glfwInitialized;
/*! @brief All global data protected by @ref _glfwInitialized.
* This should only be touched after a call to @ref glfwInit that has not been
@ -383,7 +385,7 @@ extern _GLFWlibrary _glfw;
//========================================================================
/*! @brief Initializes the platform-specific part of the library.
* @return `GL_TRUE` if successful, or `GL_FALSE` if an error occurred.
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an error occurred.
* @ingroup platform
*/
int _glfwPlatformInit(void);
@ -427,11 +429,11 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count);
*
* @param[in] first The first monitor.
* @param[in] second The second monitor.
* @return @c GL_TRUE if the monitor objects represent the same monitor, or @c
* GL_FALSE otherwise.
* @return @c GLFW_TRUE if the monitor objects represent the same monitor, or
* @c GLFW_FALSE otherwise.
* @ingroup platform
*/
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second);
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second);
/*! @copydoc glfwGetMonitorPos
* @ingroup platform
@ -657,11 +659,11 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor);
/*! @brief Notifies shared code of a window focus event.
* @param[in] window The window that received the event.
* @param[in] focused `GL_TRUE` if the window received focus, or `GL_FALSE`
* @param[in] focused `GLFW_TRUE` if the window received focus, or `GLFW_FALSE`
* if it lost focus.
* @ingroup event
*/
void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused);
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused);
/*! @brief Notifies shared code of a window movement event.
* @param[in] window The window that received the event.
@ -689,8 +691,8 @@ void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height);
/*! @brief Notifies shared code of a window iconification event.
* @param[in] window The window that received the event.
* @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`
* if it was restored.
* @param[in] iconified `GLFW_TRUE` if the window was iconified, or
* `GLFW_FALSE` if it was restored.
* @ingroup event
*/
void _glfwInputWindowIconify(_GLFWwindow* window, int iconified);
@ -720,8 +722,8 @@ void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int m
* @param[in] window The window that received the event.
* @param[in] codepoint The Unicode code point of the input character.
* @param[in] mods Bit field describing which modifier keys were held down.
* @param[in] plain `GL_TRUE` if the character is regular text input, or
* `GL_FALSE` otherwise.
* @param[in] plain `GLFW_TRUE` if the character is regular text input, or
* `GLFW_FALSE` otherwise.
* @ingroup event
*/
void _glfwInputChar(_GLFWwindow* window, unsigned int codepoint, int mods, int plain);
@ -754,8 +756,8 @@ void _glfwInputCursorMotion(_GLFWwindow* window, double x, double y);
/*! @brief Notifies shared code of a cursor enter/leave event.
* @param[in] window The window that received the event.
* @param[in] entered `GL_TRUE` if the cursor entered the client area of the
* window, or `GL_FALSE` if it left it.
* @param[in] entered `GLFW_TRUE` if the cursor entered the client area of the
* window, or `GLFW_FALSE` if it left it.
* @ingroup event
*/
void _glfwInputCursorEnter(_GLFWwindow* window, int entered);
@ -803,7 +805,7 @@ void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
/*! @brief Searches an extension string for the specified extension.
* @param[in] string The extension string to search.
* @param[in] extensions The extension to search for.
* @return `GL_TRUE` if the extension was found, or `GL_FALSE` otherwise.
* @return `GLFW_TRUE` if the extension was found, or `GLFW_FALSE` otherwise.
* @ingroup utility
*/
int _glfwStringInExtensionString(const char* string, const char* extensions);
@ -822,14 +824,15 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
/*! @brief Retrieves the attributes of the current context.
* @param[in] ctxconfig The desired context attributes.
* @return `GL_TRUE` if successful, or `GL_FALSE` if the context is unusable.
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if the context is
* unusable.
* @ingroup utility
*/
GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig);
GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig);
/*! @brief Checks whether the desired context attributes are valid.
* @param[in] ctxconfig The context attributes to check.
* @return `GL_TRUE` if the context attributes are valid, or `GL_FALSE`
* @return `GLFW_TRUE` if the context attributes are valid, or `GLFW_FALSE`
* otherwise.
* @ingroup utility
*
@ -837,16 +840,16 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig);
* exists and whether all relevant options have supported and non-conflicting
* values.
*/
GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
/*! @brief Checks whether the current context fulfils the specified hard
* constraints.
* @param[in] ctxconfig The desired context attributes.
* @return `GL_TRUE` if the context fulfils the hard constraints, or `GL_FALSE`
* otherwise.
* @return `GLFW_TRUE` if the context fulfils the hard constraints, or
* `GLFW_FALSE` otherwise.
* @ingroup utility
*/
GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig);
GLFWbool _glfwIsValidContext(const _GLFWctxconfig* ctxconfig);
/*! @ingroup utility
*/

View File

@ -286,7 +286,7 @@ static void matchCallback(void* context,
if (joy > GLFW_JOYSTICK_LAST)
return;
joystick->present = GL_TRUE;
joystick->present = GLFW_TRUE;
joystick->deviceRef = deviceRef;
CFStringRef name = IOHIDDeviceGetProperty(deviceRef,

View File

@ -100,7 +100,7 @@ static void openJoystickDevice(const char* path)
_glfw.linux_js.js[joy].axes = calloc(axisCount, sizeof(float));
_glfw.linux_js.js[joy].buttons = calloc(buttonCount, 1);
_glfw.linux_js.js[joy].present = GL_TRUE;
_glfw.linux_js.js[joy].present = GLFW_TRUE;
#endif // __linux__
}
@ -199,7 +199,7 @@ int _glfwInitJoysticks(void)
_glfwInputError(GLFW_PLATFORM_ERROR,
"Linux: Failed to initialize inotify: %s",
strerror(errno));
return GL_FALSE;
return GLFW_FALSE;
}
// HACK: Register for IN_ATTRIB as well to get notified when udev is done
@ -220,7 +220,7 @@ int _glfwInitJoysticks(void)
if (regcomp(&_glfw.linux_js.regex, "^js[0-9]\\+$", 0) != 0)
{
_glfwInputError(GLFW_PLATFORM_ERROR, "Linux: Failed to compile regex");
return GL_FALSE;
return GLFW_FALSE;
}
dir = opendir(dirname);
@ -253,7 +253,7 @@ int _glfwInitJoysticks(void)
#endif // __linux__
return GL_TRUE;
return GLFW_TRUE;
}
// Close all opened joystick handles

View File

@ -46,14 +46,14 @@ int _glfwPlatformInit(void)
"Mir: Unable to connect to server: %s",
mir_connection_get_error_message(_glfw.mir.connection));
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.mir.display =
mir_connection_get_egl_native_display(_glfw.mir.connection);
if (!_glfwInitContextAPI())
return GL_FALSE;
return GLFW_FALSE;
// Need the default conf for when we set a NULL cursor
_glfw.mir.default_conf = mir_cursor_configuration_from_name(mir_arrow_cursor_name);
@ -70,10 +70,10 @@ int _glfwPlatformInit(void)
_glfwInputError(GLFW_PLATFORM_ERROR,
"Mir: Failed to create event mutex: %s",
strerror(error));
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformTerminate(void)

View File

@ -73,7 +73,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
return monitors;
}
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
{
return first->mir.output_id == second->mir.output_id;
}

View File

@ -44,9 +44,9 @@ static void deleteNode(EventQueue* queue, EventNode* node)
free(node);
}
static int emptyEventQueue(EventQueue* queue)
static GLFWbool emptyEventQueue(EventQueue* queue)
{
return queue->head.tqh_first == NULL ? GL_TRUE : GL_FALSE;
return queue->head.tqh_first == NULL;
}
// TODO The mir_event_ref is not supposed to be used but ... its needed
@ -385,7 +385,7 @@ static void addNewEvent(MirSurface* surface, const MirEvent* event, void* contex
enqueueEvent(event, context);
}
static int createSurface(_GLFWwindow* window)
static GLFWbool createSurface(_GLFWwindow* window)
{
MirSurfaceSpec* spec;
MirBufferUsage buffer_usage = mir_buffer_usage_hardware;
@ -395,7 +395,7 @@ static int createSurface(_GLFWwindow* window)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Mir: Unable to find a correct pixel format");
return GL_FALSE;
return GLFW_FALSE;
}
spec = mir_connection_create_spec_for_normal_surface(_glfw.mir.connection,
@ -415,12 +415,12 @@ static int createSurface(_GLFWwindow* window)
"Mir: Unable to create surface: %s",
mir_surface_get_error_message(window->mir.surface));
return GL_FALSE;
return GLFW_FALSE;
}
mir_surface_set_event_handler(window->mir.surface, addNewEvent, window);
return GL_TRUE;
return GLFW_TRUE;
}
//////////////////////////////////////////////////////////////////////////
@ -463,7 +463,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
const _GLFWfbconfig* fbconfig)
{
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
return GL_FALSE;
return GLFW_FALSE;
if (wndconfig->monitor)
{
@ -478,7 +478,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
"Mir: Requested surface size too large: %ix%i",
wndconfig->width, wndconfig->height);
return GL_FALSE;
return GLFW_FALSE;
}
}
@ -486,12 +486,12 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
window->mir.height = wndconfig->height;
if (!createSurface(window))
return GL_FALSE;
return GLFW_FALSE;
window->mir.window = mir_buffer_stream_get_egl_native_window(
mir_surface_get_buffer_stream(window->mir.surface));
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
@ -599,14 +599,14 @@ int _glfwPlatformWindowFocused(_GLFWwindow* window)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Mir: Unsupported function %s", __PRETTY_FUNCTION__);
return GL_FALSE;
return GLFW_FALSE;
}
int _glfwPlatformWindowIconified(_GLFWwindow* window)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Mir: Unsupported function %s", __PRETTY_FUNCTION__);
return GL_FALSE;
return GLFW_FALSE;
}
int _glfwPlatformWindowVisible(_GLFWwindow* window)
@ -664,7 +664,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Mir: Unable to find a correct pixel format");
return GL_FALSE;
return GLFW_FALSE;
}
stream = mir_connection_create_buffer_stream_sync(_glfw.mir.connection,
@ -699,7 +699,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
cursor->mir.custom_cursor = stream;
return GL_TRUE;
return GLFW_TRUE;
}
const char* getSystemCursorName(int shape)
@ -732,10 +732,10 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
cursor->mir.conf = mir_cursor_configuration_from_name(cursor_name);
cursor->mir.custom_cursor = NULL;
return GL_TRUE;
return GLFW_TRUE;
}
return GL_FALSE;
return GLFW_FALSE;
}
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)

View File

@ -60,17 +60,17 @@ static int compareVideoModes(const void* firstPtr, const void* secondPtr)
// Retrieves the available modes for the specified monitor
//
static int refreshVideoModes(_GLFWmonitor* monitor)
static GLFWbool refreshVideoModes(_GLFWmonitor* monitor)
{
int modeCount;
GLFWvidmode* modes;
if (monitor->modes)
return GL_TRUE;
return GLFW_TRUE;
modes = _glfwPlatformGetVideoModes(monitor, &modeCount);
if (!modes)
return GL_FALSE;
return GLFW_FALSE;
qsort(modes, modeCount, sizeof(GLFWvidmode), compareVideoModes);
@ -78,7 +78,7 @@ static int refreshVideoModes(_GLFWmonitor* monitor)
monitor->modes = modes;
monitor->modeCount = modeCount;
return GL_TRUE;
return GLFW_TRUE;
}

View File

@ -36,7 +36,7 @@
int _glfwInitContextAPI(void)
{
if (!_glfwCreateContextTLS())
return GL_FALSE;
return GLFW_FALSE;
_glfw.nsgl.framework =
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
@ -44,10 +44,10 @@ int _glfwInitContextAPI(void)
{
_glfwInputError(GLFW_API_UNAVAILABLE,
"NSGL: Failed to locate OpenGL framework");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
// Terminate OpenGL support
@ -69,7 +69,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_API_UNAVAILABLE,
"NSGL: OpenGL ES is not available on OS X");
return GL_FALSE;
return GLFW_FALSE;
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
@ -77,7 +77,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: The targeted version of OS X does not support OpenGL 3.0 or 3.1");
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->major > 2)
@ -86,14 +86,14 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: The targeted version of OS X only supports forward-compatible contexts for OpenGL 3.2 and above");
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->profile != GLFW_OPENGL_CORE_PROFILE)
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: The targeted version of OS X only supports core profile contexts for OpenGL 3.2 and above");
return GL_FALSE;
return GLFW_FALSE;
}
}
#else
@ -102,7 +102,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: The targeted version of OS X does not support OpenGL version 3.0 or above");
return GL_FALSE;
return GLFW_FALSE;
}
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
@ -213,7 +213,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
"NSGL: Failed to find a suitable pixel format");
return GL_FALSE;
return GLFW_FALSE;
}
NSOpenGLContext* share = NULL;
@ -228,10 +228,10 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: Failed to create OpenGL context");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
// Destroy the OpenGL context
@ -277,7 +277,7 @@ void _glfwPlatformSwapInterval(int interval)
int _glfwPlatformExtensionSupported(const char* extension)
{
// There are no NSGL extensions
return GL_FALSE;
return GLFW_FALSE;
}
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)

View File

@ -66,7 +66,7 @@ void _glfwInitTimer(void)
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)
{
_glfw.posix_time.monotonic = GL_TRUE;
_glfw.posix_time.monotonic = GLFW_TRUE;
_glfw.posix_time.resolution = 1e-9;
}
else

View File

@ -37,7 +37,7 @@
//
typedef struct _GLFWtimePOSIX
{
GLboolean monotonic;
GLFWbool monotonic;
double resolution;
uint64_t base;

View File

@ -38,10 +38,10 @@ int _glfwCreateContextTLS(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"POSIX: Failed to create context TLS");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwDestroyContextTLS(void)

View File

@ -102,7 +102,7 @@ static int getPixelFormatAttrib(_GLFWwindow* window, int pixelFormat, int attrib
// Return a list of available and usable framebuffer configs
//
static GLboolean choosePixelFormat(_GLFWwindow* window,
static GLFWbool choosePixelFormat(_GLFWwindow* window,
const _GLFWfbconfig* desired,
int* result)
{
@ -170,9 +170,9 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
u->auxBuffers = getPixelFormatAttrib(window, n, WGL_AUX_BUFFERS_ARB);
if (getPixelFormatAttrib(window, n, WGL_STEREO_ARB))
u->stereo = GL_TRUE;
u->stereo = GLFW_TRUE;
if (getPixelFormatAttrib(window, n, WGL_DOUBLE_BUFFER_ARB))
u->doublebuffer = GL_TRUE;
u->doublebuffer = GLFW_TRUE;
if (window->wgl.ARB_multisample)
u->samples = getPixelFormatAttrib(window, n, WGL_SAMPLES_ARB);
@ -181,7 +181,7 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
window->wgl.EXT_framebuffer_sRGB)
{
if (getPixelFormatAttrib(window, n, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB))
u->sRGB = GL_TRUE;
u->sRGB = GLFW_TRUE;
}
}
else
@ -229,9 +229,9 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
u->auxBuffers = pfd.cAuxBuffers;
if (pfd.dwFlags & PFD_STEREO)
u->stereo = GL_TRUE;
u->stereo = GLFW_TRUE;
if (pfd.dwFlags & PFD_DOUBLEBUFFER)
u->doublebuffer = GL_TRUE;
u->doublebuffer = GLFW_TRUE;
}
u->wgl = n;
@ -244,7 +244,7 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
"WGL: The driver does not appear to support OpenGL");
free(usableConfigs);
return GL_FALSE;
return GLFW_FALSE;
}
closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
@ -254,13 +254,13 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
"WGL: Failed to find a suitable pixel format");
free(usableConfigs);
return GL_FALSE;
return GLFW_FALSE;
}
*result = closest->wgl;
free(usableConfigs);
return GL_TRUE;
return GLFW_TRUE;
}
@ -273,13 +273,13 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
int _glfwInitContextAPI(void)
{
if (!_glfwCreateContextTLS())
return GL_FALSE;
return GLFW_FALSE;
_glfw.wgl.opengl32.instance = LoadLibraryW(L"opengl32.dll");
if (!_glfw.wgl.opengl32.instance)
{
_glfwInputError(GLFW_PLATFORM_ERROR, "WGL: Failed to load opengl32.dll");
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.wgl.opengl32.CreateContext = (WGLCREATECONTEXT_T)
@ -301,10 +301,10 @@ int _glfwInitContextAPI(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"WGL: Failed to load opengl32 functions");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
// Terminate WGL
@ -343,24 +343,24 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"WGL: Failed to retrieve DC for window");
return GL_FALSE;
return GLFW_FALSE;
}
if (!choosePixelFormat(window, fbconfig, &pixelFormat))
return GL_FALSE;
return GLFW_FALSE;
if (!DescribePixelFormat(window->wgl.dc, pixelFormat, sizeof(pfd), &pfd))
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"WGL: Failed to retrieve PFD for selected pixel format");
return GL_FALSE;
return GLFW_FALSE;
}
if (!SetPixelFormat(window->wgl.dc, pixelFormat, &pfd))
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"WGL: Failed to set selected pixel format");
return GL_FALSE;
return GLFW_FALSE;
}
if (window->wgl.ARB_create_context)
@ -443,7 +443,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"WGL: Failed to create OpenGL context");
return GL_FALSE;
return GLFW_FALSE;
}
}
else
@ -453,7 +453,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"WGL: Failed to create OpenGL context");
return GL_FALSE;
return GLFW_FALSE;
}
if (share)
@ -462,7 +462,7 @@ int _glfwCreateContext(_GLFWwindow* window,
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"WGL: Failed to enable sharing with specified OpenGL context");
return GL_FALSE;
return GLFW_FALSE;
}
}
}
@ -470,7 +470,7 @@ int _glfwCreateContext(_GLFWwindow* window,
_glfwPlatformMakeContextCurrent(window);
initWGLExtensions(window);
return GL_TRUE;
return GLFW_TRUE;
}
#undef setWGLattrib
@ -498,7 +498,7 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig)
{
GLboolean required = GL_FALSE;
GLFWbool required = GLFW_FALSE;
if (ctxconfig->api == GLFW_OPENGL_API)
{
@ -511,7 +511,7 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
return _GLFW_RECREATION_IMPOSSIBLE;
}
required = GL_TRUE;
required = GLFW_TRUE;
}
if (ctxconfig->profile)
@ -523,13 +523,13 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
return _GLFW_RECREATION_IMPOSSIBLE;
}
required = GL_TRUE;
required = GLFW_TRUE;
}
if (ctxconfig->release)
{
if (window->wgl.ARB_context_flush_control)
required = GL_TRUE;
required = GLFW_TRUE;
}
}
else
@ -543,26 +543,26 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
return _GLFW_RECREATION_IMPOSSIBLE;
}
required = GL_TRUE;
required = GLFW_TRUE;
}
if (ctxconfig->major != 1 || ctxconfig->minor != 0)
{
if (window->wgl.ARB_create_context)
required = GL_TRUE;
required = GLFW_TRUE;
}
if (ctxconfig->debug)
{
if (window->wgl.ARB_create_context)
required = GL_TRUE;
required = GLFW_TRUE;
}
if (fbconfig->samples > 0)
{
// MSAA is not a hard constraint, so do nothing if it's not supported
if (window->wgl.ARB_multisample && window->wgl.ARB_pixel_format)
required = GL_TRUE;
required = GLFW_TRUE;
}
if (fbconfig->sRGB)
@ -572,7 +572,7 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
window->wgl.EXT_framebuffer_sRGB) &&
window->wgl.ARB_pixel_format)
{
required = GL_TRUE;
required = GLFW_TRUE;
}
}
@ -637,7 +637,7 @@ int _glfwPlatformExtensionSupported(const char* extension)
if (extensions)
{
if (_glfwStringInExtensionString(extension, extensions))
return GL_TRUE;
return GLFW_TRUE;
}
}
@ -647,11 +647,11 @@ int _glfwPlatformExtensionSupported(const char* extension)
if (extensions)
{
if (_glfwStringInExtensionString(extension, extensions))
return GL_TRUE;
return GLFW_TRUE;
}
}
return GL_FALSE;
return GLFW_FALSE;
}
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)

View File

@ -64,16 +64,16 @@ typedef struct _GLFWcontextWGL
PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT;
PFNWGLGETEXTENSIONSSTRINGARBPROC GetExtensionsStringARB;
PFNWGLCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
GLboolean EXT_swap_control;
GLboolean ARB_multisample;
GLboolean ARB_framebuffer_sRGB;
GLboolean EXT_framebuffer_sRGB;
GLboolean ARB_pixel_format;
GLboolean ARB_create_context;
GLboolean ARB_create_context_profile;
GLboolean EXT_create_context_es2_profile;
GLboolean ARB_create_context_robustness;
GLboolean ARB_context_flush_control;
GLFWbool EXT_swap_control;
GLFWbool ARB_multisample;
GLFWbool ARB_framebuffer_sRGB;
GLFWbool EXT_framebuffer_sRGB;
GLFWbool ARB_pixel_format;
GLFWbool ARB_create_context;
GLFWbool ARB_create_context_profile;
GLFWbool EXT_create_context_es2_profile;
GLFWbool ARB_create_context_robustness;
GLFWbool ARB_context_flush_control;
} _GLFWcontextWGL;

View File

@ -60,14 +60,14 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
// Load necessary libraries (DLLs)
//
static GLboolean initLibraries(void)
static GLFWbool initLibraries(void)
{
_glfw.win32.winmm.instance = LoadLibraryW(L"winmm.dll");
if (!_glfw.win32.winmm.instance)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Win32: Failed to load winmm.dll");
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.win32.winmm.joyGetDevCaps = (JOYGETDEVCAPS_T)
@ -86,7 +86,7 @@ static GLboolean initLibraries(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Win32: Failed to load winmm functions");
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.win32.user32.instance = LoadLibraryW(L"user32.dll");
@ -107,7 +107,7 @@ static GLboolean initLibraries(void)
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmFlush");
}
return GL_TRUE;
return GLFW_TRUE;
}
// Unload used libraries (DLLs)
@ -332,7 +332,7 @@ int _glfwPlatformInit(void)
SPIF_SENDCHANGE);
if (!initLibraries())
return GL_FALSE;
return GLFW_FALSE;
createKeyTables();
@ -340,15 +340,15 @@ int _glfwPlatformInit(void)
_glfw_SetProcessDPIAware();
if (!_glfwRegisterWindowClass())
return GL_FALSE;
return GLFW_FALSE;
if (!_glfwInitContextAPI())
return GL_FALSE;
return GLFW_FALSE;
_glfwInitTimer();
_glfwInitJoysticks();
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformTerminate(void)

View File

@ -47,7 +47,7 @@
// Change the current video mode
//
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
{
GLFWvidmode current;
const GLFWvidmode* best;
@ -56,7 +56,7 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
best = _glfwChooseVideoMode(monitor, desired);
_glfwPlatformGetVideoMode(monitor, &current);
if (_glfwCompareVideoModes(&current, best) == 0)
return GL_TRUE;
return GLFW_TRUE;
ZeroMemory(&dm, sizeof(dm));
dm.dmSize = sizeof(DEVMODEW);
@ -77,11 +77,11 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
NULL) != DISP_CHANGE_SUCCESSFUL)
{
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to set video mode");
return GL_FALSE;
return GLFW_FALSE;
}
monitor->win32.modeChanged = GL_TRUE;
return GL_TRUE;
monitor->win32.modeChanged = GLFW_TRUE;
return GLFW_TRUE;
}
// Restore the previously saved (original) video mode
@ -92,7 +92,7 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
{
ChangeDisplaySettingsExW(monitor->win32.adapterName,
NULL, NULL, CDS_FULLSCREEN, NULL);
monitor->win32.modeChanged = GL_FALSE;
monitor->win32.modeChanged = GLFW_FALSE;
}
}
@ -153,7 +153,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
free(name);
if (adapter.StateFlags & DISPLAY_DEVICE_MODESPRUNED)
monitor->win32.modesPruned = GL_TRUE;
monitor->win32.modesPruned = GLFW_TRUE;
wcscpy(monitor->win32.adapterName, adapter.DeviceName);
wcscpy(monitor->win32.displayName, display.DeviceName);
@ -186,7 +186,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
return monitors;
}
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
{
return wcscmp(first->win32.displayName, second->win32.displayName) == 0;
}

View File

@ -151,8 +151,8 @@ typedef struct _GLFWwindowWin32
{
HWND handle;
GLboolean cursorTracked;
GLboolean iconified;
GLFWbool cursorTracked;
GLFWbool iconified;
// The last received cursor position, regardless of source
int cursorPosX, cursorPosY;
@ -203,8 +203,8 @@ typedef struct _GLFWmonitorWin32
WCHAR displayName[32];
char publicAdapterName[64];
char publicDisplayName[64];
GLboolean modesPruned;
GLboolean modeChanged;
GLFWbool modesPruned;
GLFWbool modeChanged;
} _GLFWmonitorWin32;
@ -222,14 +222,14 @@ typedef struct _GLFWcursorWin32
//
typedef struct _GLFWtimeWin32
{
GLboolean hasPC;
GLFWbool hasPC;
double resolution;
unsigned __int64 base;
} _GLFWtimeWin32;
GLboolean _glfwRegisterWindowClass(void);
GLFWbool _glfwRegisterWindowClass(void);
void _glfwUnregisterWindowClass(void);
BOOL _glfwIsCompositionEnabled(void);
@ -239,7 +239,7 @@ char* _glfwCreateUTF8FromWideString(const WCHAR* source);
void _glfwInitTimer(void);
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
#endif // _glfw3_win32_platform_h_

View File

@ -55,12 +55,12 @@ void _glfwInitTimer(void)
if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency))
{
_glfw.win32_time.hasPC = GL_TRUE;
_glfw.win32_time.hasPC = GLFW_TRUE;
_glfw.win32_time.resolution = 1.0 / (double) frequency;
}
else
{
_glfw.win32_time.hasPC = GL_FALSE;
_glfw.win32_time.hasPC = GLFW_FALSE;
_glfw.win32_time.resolution = 0.001; // winmm resolution is 1 ms
}

View File

@ -39,11 +39,11 @@ int _glfwCreateContextTLS(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Win32: Failed to allocate TLS index");
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.win32_tls.allocated = GL_TRUE;
return GL_TRUE;
_glfw.win32_tls.allocated = GLFW_TRUE;
return GLFW_TRUE;
}
void _glfwDestroyContextTLS(void)

View File

@ -35,7 +35,7 @@
//
typedef struct _GLFWtlsWin32
{
GLboolean allocated;
GLFWbool allocated;
DWORD context;
} _GLFWtlsWin32;

View File

@ -185,10 +185,10 @@ static int translateKey(WPARAM wParam, LPARAM lParam)
// Enter full screen mode
//
static GLboolean enterFullscreenMode(_GLFWwindow* window)
static GLFWbool enterFullscreenMode(_GLFWwindow* window)
{
GLFWvidmode mode;
GLboolean status;
GLFWbool status;
int xpos, ypos;
status = _glfwSetVideoMode(window->monitor, &window->videoMode);
@ -230,7 +230,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
if (window->cursorMode == GLFW_CURSOR_DISABLED)
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED);
_glfwInputWindowFocus(window, GL_TRUE);
_glfwInputWindowFocus(window, GLFW_TRUE);
return 0;
}
@ -242,7 +242,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
if (window->monitor && window->autoIconify)
_glfwPlatformIconifyWindow(window);
_glfwInputWindowFocus(window, GL_FALSE);
_glfwInputWindowFocus(window, GLFW_FALSE);
return 0;
}
@ -290,13 +290,13 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_CHAR:
{
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_TRUE);
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_TRUE);
return 0;
}
case WM_SYSCHAR:
{
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_FALSE);
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_FALSE);
return 0;
}
@ -311,7 +311,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
return TRUE;
}
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_TRUE);
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_TRUE);
return FALSE;
}
@ -428,8 +428,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
tme.hwndTrack = window->win32.handle;
TrackMouseEvent(&tme);
window->win32.cursorTracked = GL_TRUE;
_glfwInputCursorEnter(window, GL_TRUE);
window->win32.cursorTracked = GLFW_TRUE;
_glfwInputCursorEnter(window, GLFW_TRUE);
}
return 0;
@ -437,8 +437,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_MOUSELEAVE:
{
window->win32.cursorTracked = GL_FALSE;
_glfwInputCursorEnter(window, GL_FALSE);
window->win32.cursorTracked = GLFW_FALSE;
_glfwInputCursorEnter(window, GLFW_FALSE);
return 0;
}
@ -466,20 +466,20 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
if (!window->win32.iconified && wParam == SIZE_MINIMIZED)
{
window->win32.iconified = GL_TRUE;
window->win32.iconified = GLFW_TRUE;
if (window->monitor)
leaveFullscreenMode(window);
_glfwInputWindowIconify(window, GL_TRUE);
_glfwInputWindowIconify(window, GLFW_TRUE);
}
else if (window->win32.iconified &&
(wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED))
{
window->win32.iconified = GL_FALSE;
window->win32.iconified = GLFW_FALSE;
if (window->monitor)
enterFullscreenMode(window);
_glfwInputWindowIconify(window, GL_FALSE);
_glfwInputWindowIconify(window, GLFW_FALSE);
}
_glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam));
@ -597,7 +597,7 @@ static void getFullWindowSize(_GLFWwindow* window,
// Creates the GLFW window and rendering context
//
static int createWindow(_GLFWwindow* window,
static GLFWbool createWindow(_GLFWwindow* window,
const _GLFWwndconfig* wndconfig,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig)
@ -632,7 +632,7 @@ static int createWindow(_GLFWwindow* window,
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Win32: Failed to convert window title to UTF-16");
return GL_FALSE;
return GLFW_FALSE;
}
window->win32.handle = CreateWindowExW(getWindowExStyle(window),
@ -651,7 +651,7 @@ static int createWindow(_GLFWwindow* window,
if (!window->win32.handle)
{
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to create window");
return GL_FALSE;
return GLFW_FALSE;
}
if (_glfw_ChangeWindowMessageFilterEx)
@ -675,9 +675,9 @@ static int createWindow(_GLFWwindow* window,
DragAcceptFiles(window->win32.handle, TRUE);
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
return GL_FALSE;
return GLFW_FALSE;
return GL_TRUE;
return GLFW_TRUE;
}
// Destroys the GLFW window and rendering context
@ -700,7 +700,7 @@ static void destroyWindow(_GLFWwindow* window)
// Registers the GLFW window class
//
GLboolean _glfwRegisterWindowClass(void)
GLFWbool _glfwRegisterWindowClass(void)
{
WNDCLASSW wc;
@ -726,10 +726,10 @@ GLboolean _glfwRegisterWindowClass(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Win32: Failed to register window class");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
// Unregisters the GLFW window class
@ -752,12 +752,12 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
int status;
if (!createWindow(window, wndconfig, ctxconfig, fbconfig))
return GL_FALSE;
return GLFW_FALSE;
status = _glfwAnalyzeContext(window, ctxconfig, fbconfig);
if (status == _GLFW_RECREATION_IMPOSSIBLE)
return GL_FALSE;
return GLFW_FALSE;
if (status == _GLFW_RECREATION_REQUIRED)
{
@ -787,17 +787,17 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
// ...and then create them again, this time with better APIs
if (!createWindow(window, wndconfig, ctxconfig, fbconfig))
return GL_FALSE;
return GLFW_FALSE;
}
if (window->monitor)
{
_glfwPlatformShowWindow(window);
if (!enterFullscreenMode(window))
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
@ -1099,13 +1099,13 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
ReleaseDC(NULL, dc);
if (!bitmap)
return GL_FALSE;
return GLFW_FALSE;
mask = CreateBitmap(image->width, image->height, 1, 1, NULL);
if (!mask)
{
DeleteObject(bitmap);
return GL_FALSE;
return GLFW_FALSE;
}
for (i = 0; i < image->width * image->height; i++, target++, source += 4)
@ -1129,9 +1129,9 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
DeleteObject(mask);
if (!cursor->win32.handle)
return GL_FALSE;
return GLFW_FALSE;
return GL_TRUE;
return GLFW_TRUE;
}
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
@ -1142,10 +1142,10 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Win32: Failed to create standard cursor");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)

View File

@ -36,7 +36,7 @@
////// GLFW event API //////
//////////////////////////////////////////////////////////////////////////
void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused)
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused)
{
if (focused)
{
@ -102,7 +102,7 @@ void _glfwInputWindowDamage(_GLFWwindow* window)
void _glfwInputWindowCloseRequest(_GLFWwindow* window)
{
window->closed = GL_TRUE;
window->closed = GLFW_TRUE;
if (window->callbacks.close)
window->callbacks.close((GLFWwindow*) window);
@ -144,9 +144,9 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
if (wndconfig.monitor)
{
wndconfig.resizable = GL_TRUE;
wndconfig.visible = GL_TRUE;
wndconfig.focused = GL_TRUE;
wndconfig.resizable = GLFW_TRUE;
wndconfig.visible = GLFW_TRUE;
wndconfig.focused = GLFW_TRUE;
}
// Check the OpenGL bits of the window config
@ -244,11 +244,11 @@ void glfwDefaultWindowHints(void)
_glfw.hints.context.minor = 0;
// The default is a focused, visible, resizable window with decorations
_glfw.hints.window.resizable = GL_TRUE;
_glfw.hints.window.visible = GL_TRUE;
_glfw.hints.window.decorated = GL_TRUE;
_glfw.hints.window.focused = GL_TRUE;
_glfw.hints.window.autoIconify = GL_TRUE;
_glfw.hints.window.resizable = GLFW_TRUE;
_glfw.hints.window.visible = GLFW_TRUE;
_glfw.hints.window.decorated = GLFW_TRUE;
_glfw.hints.window.focused = GLFW_TRUE;
_glfw.hints.window.autoIconify = GLFW_TRUE;
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil,
// double buffered
@ -258,7 +258,7 @@ void glfwDefaultWindowHints(void)
_glfw.hints.framebuffer.alphaBits = 8;
_glfw.hints.framebuffer.depthBits = 24;
_glfw.hints.framebuffer.stencilBits = 8;
_glfw.hints.framebuffer.doublebuffer = GL_TRUE;
_glfw.hints.framebuffer.doublebuffer = GLFW_TRUE;
// The default is to select the highest available refresh rate
_glfw.hints.refreshRate = GLFW_DONT_CARE;
@ -304,34 +304,34 @@ GLFWAPI void glfwWindowHint(int target, int hint)
_glfw.hints.framebuffer.auxBuffers = hint;
break;
case GLFW_STEREO:
_glfw.hints.framebuffer.stereo = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.framebuffer.stereo = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_DOUBLEBUFFER:
_glfw.hints.framebuffer.doublebuffer = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.framebuffer.doublebuffer = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_SAMPLES:
_glfw.hints.framebuffer.samples = hint;
break;
case GLFW_SRGB_CAPABLE:
_glfw.hints.framebuffer.sRGB = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.framebuffer.sRGB = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_RESIZABLE:
_glfw.hints.window.resizable = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.window.resizable = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_DECORATED:
_glfw.hints.window.decorated = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.window.decorated = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_FOCUSED:
_glfw.hints.window.focused = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.window.focused = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_AUTO_ICONIFY:
_glfw.hints.window.autoIconify = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.window.autoIconify = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_FLOATING:
_glfw.hints.window.floating = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.window.floating = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_VISIBLE:
_glfw.hints.window.visible = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.window.visible = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_CLIENT_API:
_glfw.hints.context.api = hint;
@ -346,10 +346,10 @@ GLFWAPI void glfwWindowHint(int target, int hint)
_glfw.hints.context.robustness = hint;
break;
case GLFW_OPENGL_FORWARD_COMPAT:
_glfw.hints.context.forward = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.context.forward = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_OPENGL_DEBUG_CONTEXT:
_glfw.hints.context.debug = hint ? GL_TRUE : GL_FALSE;
_glfw.hints.context.debug = hint ? GLFW_TRUE : GLFW_FALSE;
break;
case GLFW_OPENGL_PROFILE:
_glfw.hints.context.profile = hint;

View File

@ -76,9 +76,9 @@ int _glfwPlatformJoystickPresent(int joy)
JOYINFO ji;
if (_glfw_joyGetPos(joy, &ji) != JOYERR_NOERROR)
return GL_FALSE;
return GLFW_FALSE;
return GL_TRUE;
return GLFW_TRUE;
}
const float* _glfwPlatformGetJoystickAxes(int joy, int* count)

View File

@ -49,7 +49,7 @@ static void pointerHandleEnter(void* data,
_glfw.wl.pointerFocus = window;
_glfwPlatformSetCursor(window, window->wl.currentCursor);
_glfwInputCursorEnter(window, GL_TRUE);
_glfwInputCursorEnter(window, GLFW_TRUE);
}
static void pointerHandleLeave(void* data,
@ -64,7 +64,7 @@ static void pointerHandleLeave(void* data,
_glfw.wl.pointerSerial = serial;
_glfw.wl.pointerFocus = NULL;
_glfwInputCursorEnter(window, GL_FALSE);
_glfwInputCursorEnter(window, GLFW_FALSE);
}
static void pointerHandleMotion(void* data,
@ -233,7 +233,7 @@ static void keyboardHandleEnter(void* data,
_GLFWwindow* window = wl_surface_get_user_data(surface);
_glfw.wl.keyboardFocus = window;
_glfwInputWindowFocus(window, GL_TRUE);
_glfwInputWindowFocus(window, GLFW_TRUE);
}
static void keyboardHandleLeave(void* data,
@ -247,7 +247,7 @@ static void keyboardHandleLeave(void* data,
return;
_glfw.wl.keyboardFocus = NULL;
_glfwInputWindowFocus(window, GL_FALSE);
_glfwInputWindowFocus(window, GLFW_FALSE);
}
static int toGLFWKeyCode(uint32_t key)
@ -548,7 +548,7 @@ int _glfwPlatformInit(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Failed to connect to display");
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.wl.registry = wl_display_get_registry(_glfw.wl.display);
@ -562,7 +562,7 @@ int _glfwPlatformInit(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Failed to initialize xkb context");
return GL_FALSE;
return GLFW_FALSE;
}
// Sync so we got all registry objects
@ -572,7 +572,7 @@ int _glfwPlatformInit(void)
wl_display_roundtrip(_glfw.wl.display);
if (!_glfwInitContextAPI())
return GL_FALSE;
return GLFW_FALSE;
_glfwInitTimer();
_glfwInitJoysticks();
@ -584,7 +584,7 @@ int _glfwPlatformInit(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Unable to load default cursor theme\n");
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.wl.defaultCursor =
wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, "left_ptr");
@ -592,13 +592,13 @@ int _glfwPlatformInit(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Unable to load default left pointer\n");
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.wl.cursorSurface =
wl_compositor_create_surface(_glfw.wl.compositor);
}
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformTerminate(void)

View File

@ -90,7 +90,7 @@ static void done(void* data,
{
struct _GLFWmonitor *monitor = data;
monitor->wl.done = GL_TRUE;
monitor->wl.done = GLFW_TRUE;
}
static void scale(void* data,
@ -195,7 +195,7 @@ err:
return NULL;
}
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
{
return first->wl.output == second->wl.output;
}

View File

@ -60,7 +60,7 @@ typedef struct _GLFWvidmodeWayland _GLFWvidmodeWayland;
typedef struct _GLFWwindowWayland
{
int width, height;
GLboolean visible;
GLFWbool visible;
struct wl_surface* surface;
struct wl_egl_window* native;
struct wl_shell_surface* shell_surface;
@ -118,7 +118,7 @@ typedef struct _GLFWmonitorWayland
_GLFWvidmodeWayland* modes;
int modesCount;
int modesSize;
GLboolean done;
GLFWbool done;
int x;
int y;

View File

@ -72,12 +72,12 @@ static const struct wl_shell_surface_listener shellSurfaceListener = {
handlePopupDone
};
static GLboolean createSurface(_GLFWwindow* window,
static GLFWbool createSurface(_GLFWwindow* window,
const _GLFWwndconfig* wndconfig)
{
window->wl.surface = wl_compositor_create_surface(_glfw.wl.compositor);
if (!window->wl.surface)
return GL_FALSE;
return GLFW_FALSE;
wl_surface_set_user_data(window->wl.surface, window);
@ -85,12 +85,12 @@ static GLboolean createSurface(_GLFWwindow* window,
wndconfig->width,
wndconfig->height);
if (!window->wl.native)
return GL_FALSE;
return GLFW_FALSE;
window->wl.shell_surface = wl_shell_get_shell_surface(_glfw.wl.shell,
window->wl.surface);
if (!window->wl.shell_surface)
return GL_FALSE;
return GLFW_FALSE;
wl_shell_surface_add_listener(window->wl.shell_surface,
&shellSurfaceListener,
@ -99,7 +99,7 @@ static GLboolean createSurface(_GLFWwindow* window,
window->wl.width = wndconfig->width;
window->wl.height = wndconfig->height;
return GL_TRUE;
return GLFW_TRUE;
}
static int
@ -217,10 +217,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
const _GLFWfbconfig* fbconfig)
{
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
return GL_FALSE;
return GLFW_FALSE;
if (!createSurface(window, wndconfig))
return GL_FALSE;
return GLFW_FALSE;
if (wndconfig->monitor)
{
@ -237,7 +237,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
window->wl.currentCursor = NULL;
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
@ -245,12 +245,12 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
if (window == _glfw.wl.pointerFocus)
{
_glfw.wl.pointerFocus = NULL;
_glfwInputCursorEnter(window, GL_FALSE);
_glfwInputCursorEnter(window, GLFW_FALSE);
}
if (window == _glfw.wl.keyboardFocus)
{
_glfw.wl.keyboardFocus = NULL;
_glfwInputWindowFocus(window, GL_FALSE);
_glfwInputWindowFocus(window, GLFW_FALSE);
}
_glfwDestroyContext(window);
@ -347,19 +347,19 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
int _glfwPlatformWindowFocused(_GLFWwindow* window)
{
// TODO
return GL_FALSE;
return GLFW_FALSE;
}
int _glfwPlatformWindowIconified(_GLFWwindow* window)
{
// TODO
return GL_FALSE;
return GLFW_FALSE;
}
int _glfwPlatformWindowVisible(_GLFWwindow* window)
{
// TODO
return GL_FALSE;
return GLFW_FALSE;
}
void _glfwPlatformPollEvents(void)
@ -413,7 +413,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Creating a buffer file for %d B failed: %m\n",
length);
return GL_FALSE;
return GLFW_FALSE;
}
data = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
@ -422,7 +422,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Cursor mmap failed: %m\n");
close(fd);
return GL_FALSE;
return GLFW_FALSE;
}
pool = wl_shm_create_pool(_glfw.wl.shm, fd, length);
@ -450,14 +450,14 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
cursor->wl.height = image->height;
cursor->wl.xhot = xhot;
cursor->wl.yhot = yhot;
return GL_TRUE;
return GLFW_TRUE;
}
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
{
// TODO
fprintf(stderr, "_glfwPlatformCreateStandardCursor not implemented yet\n");
return GL_FALSE;
return GLFW_FALSE;
}
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)

View File

@ -323,20 +323,20 @@ static void createKeyTables(void)
// Check whether the IM has a usable style
//
static GLboolean hasUsableInputMethodStyle(void)
static GLFWbool hasUsableInputMethodStyle(void)
{
unsigned int i;
GLboolean found = GL_FALSE;
GLFWbool found = GLFW_FALSE;
XIMStyles* styles = NULL;
if (XGetIMValues(_glfw.x11.im, XNQueryInputStyle, &styles, NULL) != NULL)
return GL_FALSE;
return GLFW_FALSE;
for (i = 0; i < styles->count_styles; i++)
{
if (styles->supported_styles[i] == (XIMPreeditNothing | XIMStatusNothing))
{
found = GL_TRUE;
found = GLFW_TRUE;
break;
}
}
@ -463,7 +463,7 @@ static void detectEWMH(void)
// Initialize X11 display and look for supported X11 extensions
//
static GLboolean initExtensions(void)
static GLFWbool initExtensions(void)
{
// Find or create window manager atoms
_glfw.x11.WM_PROTOCOLS = XInternAtom(_glfw.x11.display,
@ -501,12 +501,12 @@ static GLboolean initExtensions(void)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"X11: Failed to query RandR version");
return GL_FALSE;
return GLFW_FALSE;
}
// The GLFW RandR path requires at least version 1.3
if (_glfw.x11.randr.major == 1 && _glfw.x11.randr.minor < 3)
_glfw.x11.randr.available = GL_FALSE;
_glfw.x11.randr.available = GLFW_FALSE;
sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);
@ -518,7 +518,7 @@ static GLboolean initExtensions(void)
// available
_glfwInputError(GLFW_PLATFORM_ERROR,
"X11: RandR gamma ramp support seems broken");
_glfw.x11.randr.gammaBroken = GL_TRUE;
_glfw.x11.randr.gammaBroken = GLFW_TRUE;
}
XRRFreeScreenResources(sr);
@ -529,7 +529,7 @@ static GLboolean initExtensions(void)
&_glfw.x11.xinerama.minor))
{
if (XineramaIsActive(_glfw.x11.display))
_glfw.x11.xinerama.available = GL_TRUE;
_glfw.x11.xinerama.available = GLFW_TRUE;
}
#if defined(_GLFW_HAS_XINPUT)
@ -546,7 +546,7 @@ static GLboolean initExtensions(void)
&_glfw.x11.xi.major,
&_glfw.x11.xi.minor) != BadRequest)
{
_glfw.x11.xi.available = GL_TRUE;
_glfw.x11.xi.available = GLFW_TRUE;
}
}
#endif /*_GLFW_HAS_XINPUT*/
@ -569,7 +569,7 @@ static GLboolean initExtensions(void)
if (XkbSetDetectableAutoRepeat(_glfw.x11.display, True, &supported))
{
if (supported)
_glfw.x11.xkb.detectable = GL_TRUE;
_glfw.x11.xkb.detectable = GLFW_TRUE;
}
}
@ -615,7 +615,7 @@ static GLboolean initExtensions(void)
_glfw.x11.XdndFinished = XInternAtom(_glfw.x11.display, "XdndFinished", True);
_glfw.x11.XdndSelection = XInternAtom(_glfw.x11.display, "XdndSelection", True);
return GL_TRUE;
return GLFW_TRUE;
}
// Create a blank cursor for hidden and disabled cursor modes
@ -733,7 +733,7 @@ int _glfwPlatformInit(void)
"X11: The DISPLAY environment variable is missing");
}
return GL_FALSE;
return GLFW_FALSE;
}
_glfw.x11.screen = DefaultScreen(_glfw.x11.display);
@ -741,7 +741,7 @@ int _glfwPlatformInit(void)
_glfw.x11.context = XUniqueContext();
if (!initExtensions())
return GL_FALSE;
return GLFW_FALSE;
_glfw.x11.cursor = createNULLCursor();
@ -761,14 +761,14 @@ int _glfwPlatformInit(void)
}
if (!_glfwInitContextAPI())
return GL_FALSE;
return GLFW_FALSE;
if (!_glfwInitJoysticks())
return GL_FALSE;
return GLFW_FALSE;
_glfwInitTimer();
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformTerminate(void)

View File

@ -34,7 +34,7 @@
// Check whether the display mode should be included in enumeration
//
static GLboolean modeIsGood(const XRRModeInfo* mi)
static GLFWbool modeIsGood(const XRRModeInfo* mi)
{
return (mi->modeFlags & RR_Interlace) == 0;
}
@ -97,7 +97,7 @@ static GLFWvidmode vidmodeFromModeInfo(const XRRModeInfo* mi,
// Set the current video mode for the specified monitor
//
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
{
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken)
{
@ -112,7 +112,7 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
best = _glfwChooseVideoMode(monitor, desired);
_glfwPlatformGetVideoMode(monitor, &current);
if (_glfwCompareVideoModes(&current, best) == 0)
return GL_TRUE;
return GLFW_TRUE;
sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);
ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);
@ -155,11 +155,11 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"X11: Monitor mode list changed");
return GL_FALSE;
return GLFW_FALSE;
}
}
return GL_TRUE;
return GLFW_TRUE;
}
// Restore the saved (original) video mode for the specified monitor
@ -285,7 +285,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
_glfwInputError(GLFW_PLATFORM_ERROR,
"X11: RandR monitor support seems broken");
_glfw.x11.randr.monitorBroken = GL_TRUE;
_glfw.x11.randr.monitorBroken = GLFW_TRUE;
free(monitors);
monitors = NULL;
}
@ -306,7 +306,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
return monitors;
}
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
{
return first->x11.crtc == second->x11.crtc;
}

View File

@ -168,18 +168,18 @@ typedef struct _GLFWlibraryX11
Atom GLFW_SELECTION;
struct {
GLboolean available;
GLFWbool available;
int eventBase;
int errorBase;
int major;
int minor;
GLboolean gammaBroken;
GLboolean monitorBroken;
GLFWbool gammaBroken;
GLFWbool monitorBroken;
} randr;
struct {
GLboolean available;
GLboolean detectable;
GLFWbool available;
GLFWbool detectable;
int majorOpcode;
int eventBase;
int errorBase;
@ -200,14 +200,14 @@ typedef struct _GLFWlibraryX11
} xdnd;
struct {
GLboolean available;
GLFWbool available;
int major;
int minor;
} xinerama;
#if defined(_GLFW_HAS_XINPUT)
struct {
GLboolean available;
GLFWbool available;
int majorOpcode;
int eventBase;
int errorBase;
@ -218,7 +218,7 @@ typedef struct _GLFWlibraryX11
#if defined(_GLFW_HAS_XF86VM)
struct {
GLboolean available;
GLFWbool available;
int eventBase;
int errorBase;
} vidmode;
@ -251,7 +251,7 @@ typedef struct _GLFWcursorX11
} _GLFWcursorX11;
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);

View File

@ -247,7 +247,7 @@ static char** parseUriList(char* text, int* count)
// Create the X11 window (and its colormap)
//
static GLboolean createWindow(_GLFWwindow* window,
static GLFWbool createWindow(_GLFWwindow* window,
const _GLFWwndconfig* wndconfig)
{
unsigned long wamask;
@ -293,7 +293,7 @@ static GLboolean createWindow(_GLFWwindow* window,
{
_glfwInputXError(GLFW_PLATFORM_ERROR,
"X11: Failed to create window");
return GL_FALSE;
return GLFW_FALSE;
}
XSaveContext(_glfw.x11.display,
@ -400,7 +400,7 @@ static GLboolean createWindow(_GLFWwindow* window,
{
_glfwInputError(GLFW_OUT_OF_MEMORY,
"X11: Failed to allocate WM hints");
return GL_FALSE;
return GLFW_FALSE;
}
hints->flags = StateHint;
@ -499,7 +499,7 @@ static GLboolean createWindow(_GLFWwindow* window,
_glfwPlatformGetWindowPos(window, &window->x11.xpos, &window->x11.ypos);
_glfwPlatformGetWindowSize(window, &window->x11.width, &window->x11.height);
return GL_TRUE;
return GLFW_TRUE;
}
// Returns whether the event is a selection event
@ -1078,13 +1078,13 @@ static void processEvent(XEvent *event)
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_HIDDEN);
_glfwInputCursorEnter(window, GL_TRUE);
_glfwInputCursorEnter(window, GLFW_TRUE);
return;
}
case LeaveNotify:
{
_glfwInputCursorEnter(window, GL_FALSE);
_glfwInputCursorEnter(window, GLFW_FALSE);
return;
}
@ -1292,7 +1292,7 @@ static void processEvent(XEvent *event)
if (window->cursorMode == GLFW_CURSOR_DISABLED)
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED);
_glfwInputWindowFocus(window, GL_TRUE);
_glfwInputWindowFocus(window, GLFW_TRUE);
return;
}
@ -1315,7 +1315,7 @@ static void processEvent(XEvent *event)
if (window->monitor && window->autoIconify)
_glfwPlatformIconifyWindow(window);
_glfwInputWindowFocus(window, GL_FALSE);
_glfwInputWindowFocus(window, GLFW_FALSE);
return;
}
@ -1336,14 +1336,14 @@ static void processEvent(XEvent *event)
if (window->monitor)
leaveFullscreenMode(window);
_glfwInputWindowIconify(window, GL_TRUE);
_glfwInputWindowIconify(window, GLFW_TRUE);
}
else if (state == NormalState)
{
if (window->monitor)
enterFullscreenMode(window);
_glfwInputWindowIconify(window, GL_FALSE);
_glfwInputWindowIconify(window, GLFW_FALSE);
}
}
@ -1468,10 +1468,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
const _GLFWfbconfig* fbconfig)
{
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
return GL_FALSE;
return GLFW_FALSE;
if (!createWindow(window, wndconfig))
return GL_FALSE;
return GLFW_FALSE;
if (wndconfig->monitor)
{
@ -1479,7 +1479,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
enterFullscreenMode(window);
}
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
@ -1880,9 +1880,9 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
{
cursor->x11.handle = _glfwCreateCursor(image, xhot, yhot);
if (!cursor->x11.handle)
return GL_FALSE;
return GLFW_FALSE;
return GL_TRUE;
return GLFW_TRUE;
}
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
@ -1893,10 +1893,10 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"X11: Failed to create standard cursor");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)

View File

@ -58,7 +58,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
switch (key)
{
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
case GLFW_KEY_V:

View File

@ -46,9 +46,9 @@
static double cursor_x;
static double cursor_y;
static int swap_interval = 1;
static GLboolean wait_events = GL_FALSE;
static GLboolean animate_cursor = GL_FALSE;
static GLboolean track_cursor = GL_FALSE;
static int wait_events = GLFW_FALSE;
static int animate_cursor = GLFW_FALSE;
static int track_cursor = GLFW_FALSE;
static GLFWcursor* standard_cursors[6];
static void error_callback(int error, const char* description)
@ -122,7 +122,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
if (glfwGetInputMode(window, GLFW_CURSOR) != GLFW_CURSOR_DISABLED)
{
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}

View File

@ -35,7 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
static volatile GLboolean running = GL_TRUE;
static volatile int running = GLFW_TRUE;
static void error_callback(int error, const char* description)
{
@ -61,7 +61,7 @@ static int thread_main(void* data)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
static float nrand(void)
@ -116,7 +116,7 @@ int main(void)
glfwWaitEvents();
if (glfwWindowShouldClose(window))
running = GL_FALSE;
running = GLFW_FALSE;
}
glfwHideWindow(window);

View File

@ -506,7 +506,7 @@ int main(int argc, char** argv)
{
char title[128];
slots[i].closeable = GL_TRUE;
slots[i].closeable = GLFW_TRUE;
slots[i].number = i + 1;
sprintf(title, "Event Linter (Window %i)", slots[i].number);

View File

@ -69,7 +69,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
case GLFW_KEY_ESCAPE:
{
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}

View File

@ -190,7 +190,7 @@ static void list_extensions(int api, int major, int minor)
putchar('\n');
}
static GLboolean valid_version(void)
static int valid_version(void)
{
int major, minor, revision;
glfwGetVersion(&major, &minor, &revision);
@ -198,13 +198,13 @@ static GLboolean valid_version(void)
if (major != GLFW_VERSION_MAJOR)
{
printf("*** ERROR: GLFW major version mismatch! ***\n");
return GL_FALSE;
return GLFW_FALSE;
}
if (minor != GLFW_VERSION_MINOR || revision != GLFW_VERSION_REVISION)
printf("*** WARNING: GLFW version mismatch! ***\n");
return GL_TRUE;
return GLFW_TRUE;
}
static void print_version(void)
@ -224,7 +224,7 @@ int main(int argc, char** argv)
{
int ch, api, major, minor, revision, profile;
GLint redbits, greenbits, bluebits, alphabits, depthbits, stencilbits;
GLboolean list = GL_FALSE;
int list = GLFW_FALSE;
GLFWwindow* window;
enum { API, BEHAVIOR, DEBUG, FORWARD, HELP, EXTENSIONS,
@ -309,11 +309,11 @@ int main(int argc, char** argv)
break;
case 'd':
case DEBUG:
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);
break;
case 'f':
case FORWARD:
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
break;
case 'h':
case HELP:
@ -321,7 +321,7 @@ int main(int argc, char** argv)
exit(EXIT_SUCCESS);
case 'l':
case EXTENSIONS:
list = GL_TRUE;
list = GLFW_TRUE;
break;
case 'm':
case MAJOR:
@ -444,13 +444,13 @@ int main(int argc, char** argv)
glfwWindowHint(GLFW_SAMPLES, atoi(optarg));
break;
case STEREO:
glfwWindowHint(GLFW_STEREO, GL_TRUE);
glfwWindowHint(GLFW_STEREO, GLFW_TRUE);
break;
case SRGB:
glfwWindowHint(GLFW_SRGB_CAPABLE, GL_TRUE);
glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
break;
case SINGLEBUFFER:
glfwWindowHint(GLFW_DOUBLEBUFFER, GL_FALSE);
glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_FALSE);
break;
default:
usage();
@ -460,7 +460,7 @@ int main(int argc, char** argv)
print_version();
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
window = glfwCreateWindow(200, 200, "Version", NULL, NULL);
if (!window)

View File

@ -65,7 +65,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
glfwIconifyWindow(window);
break;
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}
}
@ -155,7 +155,7 @@ static GLFWwindow* create_window(GLFWmonitor* monitor)
int main(int argc, char** argv)
{
int ch, i, window_count;
GLboolean auto_iconify = GL_TRUE, fullscreen = GL_FALSE, all_monitors = GL_FALSE;
int auto_iconify = GLFW_TRUE, fullscreen = GLFW_FALSE, all_monitors = GLFW_FALSE;
GLFWwindow** windows;
while ((ch = getopt(argc, argv, "afhn")) != -1)
@ -163,7 +163,7 @@ int main(int argc, char** argv)
switch (ch)
{
case 'a':
all_monitors = GL_TRUE;
all_monitors = GLFW_TRUE;
break;
case 'h':
@ -171,11 +171,11 @@ int main(int argc, char** argv)
exit(EXIT_SUCCESS);
case 'f':
fullscreen = GL_TRUE;
fullscreen = GLFW_TRUE;
break;
case 'n':
auto_iconify = GL_FALSE;
auto_iconify = GLFW_FALSE;
break;
default:

View File

@ -40,7 +40,7 @@
typedef struct Joystick
{
GLboolean present;
int present;
char* name;
float* axes;
unsigned char* buttons;
@ -176,7 +176,7 @@ static void refresh_joysticks(void)
joystick_count++;
}
j->present = GL_TRUE;
j->present = GLFW_TRUE;
}
else
{

View File

@ -78,7 +78,7 @@ static void framebuffer_size_callback(GLFWwindow* window, int width, int height)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
static void list_modes(GLFWmonitor* monitor)

View File

@ -97,7 +97,7 @@ int main(int argc, char** argv)
printf("Requesting that MSAA not be available\n");
glfwWindowHint(GLFW_SAMPLES, samples);
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
window = glfwCreateWindow(800, 400, "Aliasing Detector", NULL, NULL);
if (!window)

View File

@ -63,7 +63,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
case GLFW_KEY_Q:
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}
}

View File

@ -46,14 +46,14 @@ static void error_callback(int error, const char* description)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE)
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
static GLFWwindow* open_window(const char* title, GLFWwindow* share, int posX, int posY)
{
GLFWwindow* window;
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
window = glfwCreateWindow(WIDTH, HEIGHT, title, NULL, share);
if (!window)
return NULL;

View File

@ -36,7 +36,7 @@
#include "getopt.h"
static GLboolean swap_tear;
static int swap_tear;
static int swap_interval;
static double frame_rate;
@ -118,7 +118,7 @@ int main(int argc, char** argv)
float position;
unsigned long frame_count = 0;
double last_time, current_time;
GLboolean fullscreen = GL_FALSE;
int fullscreen = GLFW_FALSE;
GLFWmonitor* monitor = NULL;
GLFWwindow* window;
@ -131,7 +131,7 @@ int main(int argc, char** argv)
exit(EXIT_SUCCESS);
case 'f':
fullscreen = GL_TRUE;
fullscreen = GLFW_TRUE;
break;
}
}

View File

@ -44,7 +44,7 @@ typedef struct
thrd_t id;
} Thread;
static volatile GLboolean running = GL_TRUE;
static volatile int running = GLFW_TRUE;
static void error_callback(int error, const char* description)
{
@ -87,7 +87,7 @@ int main(void)
if (!glfwInit())
exit(EXIT_FAILURE);
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
for (i = 0; i < count; i++)
{
@ -120,7 +120,7 @@ int main(void)
for (i = 0; i < count; i++)
{
if (glfwWindowShouldClose(threads[i].window))
running = GL_FALSE;
running = GLFW_FALSE;
}
}

View File

@ -72,7 +72,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
}
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GL_TRUE);
glfwSetWindowShouldClose(window, GLFW_TRUE);
break;
}
}
@ -80,7 +80,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
int main(int argc, char** argv)
{
int i;
GLboolean running = GL_TRUE;
int running = GLFW_TRUE;
GLFWwindow* windows[4];
glfwSetErrorCallback(error_callback);
@ -88,8 +88,8 @@ int main(int argc, char** argv)
if (!glfwInit())
exit(EXIT_FAILURE);
glfwWindowHint(GLFW_DECORATED, GL_FALSE);
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
for (i = 0; i < 4; i++)
{
@ -125,7 +125,7 @@ int main(int argc, char** argv)
glfwSwapBuffers(windows[i]);
if (glfwWindowShouldClose(windows[i]))
running = GL_FALSE;
running = GLFW_FALSE;
}
glfwPollEvents();