mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
Replace GL booleans with public macros
This commit is contained in:
parent
13fbb4748a
commit
0eccf75f65
@ -61,6 +61,8 @@ GLFW bundles a number of dependencies in the `deps/` directory.
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
- Added `GLFW_TRUE` and `GLFW_FALSE` as client API independent boolean values
|
||||||
|
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
|
||||||
|
@ -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`
|
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
|
||||||
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
|
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
|
||||||
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
|
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.
|
glfwCreateWindow to fail.
|
||||||
|
|
||||||
GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for
|
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`
|
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
|
||||||
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
|
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
|
||||||
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
|
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.
|
glfwCreateWindow to fail.
|
||||||
|
|
||||||
GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for
|
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
|
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
|
`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
|
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_CORE_PROFILE` when creating OpenGL 3.2 and later contexts and the
|
||||||
`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.
|
`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ contexts with hidden windows can be created with the
|
|||||||
[GLFW_VISIBLE](@ref window_hints_wnd) window hint.
|
[GLFW_VISIBLE](@ref window_hints_wnd) window hint.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
|
|
||||||
GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL);
|
GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL);
|
||||||
@endcode
|
@endcode
|
||||||
@ -271,8 +271,8 @@ if (glfwExtensionSupported("GL_ARB_debug_output"))
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
The argument is a null terminated ASCII string with the extension name. If the
|
The argument is a null terminated ASCII string with the extension name. If the
|
||||||
extension is supported, @ref glfwExtensionSupported returns `GL_TRUE`, otherwise
|
extension is supported, @ref glfwExtensionSupported returns `GLFW_TRUE`,
|
||||||
it returns `GL_FALSE`.
|
otherwise it returns `GLFW_FALSE`.
|
||||||
|
|
||||||
|
|
||||||
@subsubsection context_glext_proc Fetching function pointers
|
@subsubsection context_glext_proc Fetching function pointers
|
||||||
|
@ -37,7 +37,7 @@ GLFW_NOT_INITIALIZED error.
|
|||||||
|
|
||||||
@subsection intro_init_init Initializing GLFW
|
@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.
|
error occurred.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
@ -50,7 +50,7 @@ if (!glfwInit())
|
|||||||
If any part of initialization fails, all remaining bits are terminated as if
|
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
|
@ref glfwTerminate was called. The library only needs to be initialized once
|
||||||
and additional calls to an already initialized library will simply return
|
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
|
Once the library has been successfully initialized, it should be terminated
|
||||||
before the application exits.
|
before the application exits.
|
||||||
|
@ -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
|
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
|
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
|
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
|
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.
|
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);
|
void window_close_callback(GLFWwindow* window);
|
||||||
@endcode
|
@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
|
for other reasons to close the window as well, for example the user choosing
|
||||||
Quit from an in-game menu.
|
Quit from an in-game menu.
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ the GLFW header.
|
|||||||
@subsection quick_init_term Initializing and terminating GLFW
|
@subsection quick_init_term Initializing and terminating GLFW
|
||||||
|
|
||||||
Before you can use most GLFW functions, the library must be initialized. On
|
Before you can use most GLFW functions, the library must be initialized. On
|
||||||
successful initialization, `GL_TRUE` is returned. If an error occurred,
|
successful initialization, `GLFW_TRUE` is returned. If an error occurred,
|
||||||
`GL_FALSE` is returned.
|
`GLFW_FALSE` is returned.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
if (!glfwInit())
|
if (!glfwInit())
|
||||||
@ -192,7 +192,7 @@ callback function.
|
|||||||
static void key_callback(GLFWwindow* window, int key, int scancode, 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)
|
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
|
@ -298,12 +298,12 @@ extension.
|
|||||||
|
|
||||||
Window hint | Default value | Supported values
|
Window hint | Default value | Supported values
|
||||||
------------------------------- | --------------------------- | ----------------
|
------------------------------- | --------------------------- | ----------------
|
||||||
`GLFW_RESIZABLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
`GLFW_RESIZABLE` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_VISIBLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
`GLFW_VISIBLE` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_DECORATED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
`GLFW_DECORATED` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_FOCUSED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
`GLFW_FOCUSED` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_AUTO_ICONIFY` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
`GLFW_AUTO_ICONIFY` | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_FLOATING` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
|
`GLFW_FLOATING` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_RED_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
`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_GREEN_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||||
`GLFW_BLUE_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_AUX_BUFFERS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||||
`GLFW_SAMPLES` | 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_REFRESH_RATE` | `GLFW_DONT_CARE` | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||||
`GLFW_STEREO` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
|
`GLFW_STEREO` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_SRGB_CAPABLE` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
|
`GLFW_SRGB_CAPABLE` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_DOUBLEBUFFER` | `GL_TRUE` | `GL_TRUE` or `GL_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_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_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_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_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_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_FORWARD_COMPAT` | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
`GLFW_OPENGL_DEBUG_CONTEXT` | `GL_FALSE` | `GL_TRUE` or `GL_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`
|
`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)
|
void window_close_callback(GLFWwindow* window)
|
||||||
{
|
{
|
||||||
if (!time_to_close)
|
if (!time_to_close)
|
||||||
glfwSetWindowShouldClose(window, GL_FALSE);
|
glfwSetWindowShouldClose(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
@endcode
|
@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_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and
|
||||||
`GLFW_CONTEXT_REVISION` indicate the client API version of the window's context.
|
`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
|
`GLFW_OPENGL_FORWARD_COMPAT` is `GLFW_TRUE` if the window's context is an OpenGL
|
||||||
forward-compatible one, or `GL_FALSE` otherwise.
|
forward-compatible one, or `GLFW_FALSE` otherwise.
|
||||||
|
|
||||||
`GLFW_OPENGL_DEBUG_CONTEXT` is `GL_TRUE` if the window's context is an OpenGL
|
`GLFW_OPENGL_DEBUG_CONTEXT` is `GLFW_TRUE` if the window's context is an OpenGL
|
||||||
debug context, or `GL_FALSE` otherwise.
|
debug context, or `GLFW_FALSE` otherwise.
|
||||||
|
|
||||||
`GLFW_OPENGL_PROFILE` indicates the OpenGL profile used by the context. This is
|
`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
|
`GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` if the context uses
|
||||||
|
@ -91,7 +91,7 @@ typedef struct {float x; float y; float z;} vertex_t;
|
|||||||
int width, height;
|
int width, height;
|
||||||
GLfloat deg_rot_y = 0.f;
|
GLfloat deg_rot_y = 0.f;
|
||||||
GLfloat deg_rot_y_inc = 2.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_x = 0.f;
|
||||||
GLfloat cursor_y = 0.f;
|
GLfloat cursor_y = 0.f;
|
||||||
GLfloat ball_x = -RADIUS;
|
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 )
|
void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods )
|
||||||
{
|
{
|
||||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
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 )
|
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)
|
if (action == GLFW_PRESS)
|
||||||
{
|
{
|
||||||
override_pos = GL_TRUE;
|
override_pos = GLFW_TRUE;
|
||||||
set_ball_pos(cursor_x, cursor_y);
|
set_ball_pos(cursor_x, cursor_y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
override_pos = GL_FALSE;
|
override_pos = GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ void key( GLFWwindow* window, int k, int s, int action, int mods )
|
|||||||
view_rotz += 5.0;
|
view_rotz += 5.0;
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_UP:
|
case GLFW_KEY_UP:
|
||||||
view_rotx += 5.0;
|
view_rotx += 5.0;
|
||||||
|
@ -386,7 +386,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
{
|
{
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
/* Exit program on Escape */
|
/* Exit program on Escape */
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -414,11 +414,11 @@ int main(int argc, char** argv)
|
|||||||
if (!glfwInit())
|
if (!glfwInit())
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
||||||
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
|
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
|
||||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
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);
|
window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL);
|
||||||
if (! window )
|
if (! window )
|
||||||
|
@ -875,7 +875,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_W:
|
case GLFW_KEY_W:
|
||||||
wireframe = !wireframe;
|
wireframe = !wireframe;
|
||||||
|
@ -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)
|
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||||
{
|
{
|
||||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
|
@ -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)
|
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||||
{
|
{
|
||||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
|
|||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_SPACE:
|
case GLFW_KEY_SPACE:
|
||||||
init_grid();
|
init_grid();
|
||||||
|
@ -214,6 +214,24 @@ extern "C" {
|
|||||||
#define GLFW_VERSION_REVISION 0
|
#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
|
/*! @name Key and button actions
|
||||||
* @{ */
|
* @{ */
|
||||||
/*! @brief The key or mouse button was released.
|
/*! @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.
|
* This is the function signature for window focus callback functions.
|
||||||
*
|
*
|
||||||
* @param[in] window The window that gained or lost input focus.
|
* @param[in] window The window that gained or lost input focus.
|
||||||
* @param[in] focused `GL_TRUE` if the window was given input focus, or
|
* @param[in] focused `GLFW_TRUE` if the window was given input focus, or
|
||||||
* `GL_FALSE` if it lost it.
|
* `GLFW_FALSE` if it lost it.
|
||||||
*
|
*
|
||||||
* @sa glfwSetWindowFocusCallback
|
* @sa glfwSetWindowFocusCallback
|
||||||
*
|
*
|
||||||
@ -816,8 +834,8 @@ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);
|
|||||||
* functions.
|
* functions.
|
||||||
*
|
*
|
||||||
* @param[in] window The window that was iconified or restored.
|
* @param[in] window The window that was iconified or restored.
|
||||||
* @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`
|
* @param[in] iconified `GLFW_TRUE` if the window was iconified, or
|
||||||
* if it was restored.
|
* `GLFW_FALSE` if it was restored.
|
||||||
*
|
*
|
||||||
* @sa glfwSetWindowIconifyCallback
|
* @sa glfwSetWindowIconifyCallback
|
||||||
*
|
*
|
||||||
@ -876,8 +894,8 @@ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);
|
|||||||
* This is the function signature for cursor enter/leave callback functions.
|
* This is the function signature for cursor enter/leave callback functions.
|
||||||
*
|
*
|
||||||
* @param[in] window The window that received the event.
|
* @param[in] window The window that received the event.
|
||||||
* @param[in] entered `GL_TRUE` if the cursor entered the window's client
|
* @param[in] entered `GLFW_TRUE` if the cursor entered the window's client
|
||||||
* area, or `GL_FALSE` if it left it.
|
* area, or `GLFW_FALSE` if it left it.
|
||||||
*
|
*
|
||||||
* @sa glfwSetCursorEnterCallback
|
* @sa glfwSetCursorEnterCallback
|
||||||
*
|
*
|
||||||
@ -1057,9 +1075,9 @@ typedef struct GLFWimage
|
|||||||
* succeeds, you should call @ref glfwTerminate before the application exits.
|
* succeeds, you should call @ref glfwTerminate before the application exits.
|
||||||
*
|
*
|
||||||
* Additional calls to this function after successful initialization but before
|
* 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.
|
* [error](@ref error_handling) occurred.
|
||||||
*
|
*
|
||||||
* @remarks __OS X:__ This function will change the current directory of the
|
* @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
|
* and unlimited cursor movement. This is useful for implementing for
|
||||||
* example 3D camera controls.
|
* example 3D camera controls.
|
||||||
*
|
*
|
||||||
* If the mode is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to
|
* If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to
|
||||||
* enable sticky keys, or `GL_FALSE` to disable it. If sticky keys are
|
* 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`
|
* 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
|
* 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
|
* call. This is useful when you are only interested in whether keys have been
|
||||||
* pressed but not when or in which order.
|
* pressed but not when or in which order.
|
||||||
*
|
*
|
||||||
* If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either
|
* 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
|
* `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it.
|
||||||
* sticky mouse buttons are enabled, a mouse button press will ensure that @ref
|
* If sticky mouse buttons are enabled, a mouse button press will ensure that
|
||||||
* glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even if
|
* @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even
|
||||||
* the mouse button had been released before the call. This is useful when you
|
* if the mouse button had been released before the call. This is useful when
|
||||||
* are only interested in whether mouse buttons have been pressed but not when
|
* you are only interested in whether mouse buttons have been pressed but not
|
||||||
* or in which order.
|
* when or in which order.
|
||||||
*
|
*
|
||||||
* @param[in] window The window whose input mode to set.
|
* @param[in] window The window whose input mode to set.
|
||||||
* @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
|
* @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.
|
* This function returns whether the specified joystick is present.
|
||||||
*
|
*
|
||||||
* @param[in] joy The [joystick](@ref joysticks) to query.
|
* @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
|
* @par Thread Safety
|
||||||
* This function may only be called from the main thread.
|
* 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.
|
* a context, so there is no danger in doing this.
|
||||||
*
|
*
|
||||||
* @param[in] extension The ASCII encoded name of the extension.
|
* @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
|
* @par Thread Safety
|
||||||
* This function may be called from any thread.
|
* This function may be called from any thread.
|
||||||
|
@ -207,17 +207,17 @@ int _glfwPlatformInit(void)
|
|||||||
|
|
||||||
_glfw.ns.eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
|
_glfw.ns.eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
|
||||||
if (!_glfw.ns.eventSource)
|
if (!_glfw.ns.eventSource)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
CGEventSourceSetLocalEventsSuppressionInterval(_glfw.ns.eventSource, 0.0);
|
CGEventSourceSetLocalEventsSuppressionInterval(_glfw.ns.eventSource, 0.0);
|
||||||
|
|
||||||
if (!_glfwInitContextAPI())
|
if (!_glfwInitContextAPI())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
_glfwInitTimer();
|
_glfwInitTimer();
|
||||||
_glfwInitJoysticks();
|
_glfwInitJoysticks();
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformTerminate(void)
|
void _glfwPlatformTerminate(void)
|
||||||
|
@ -76,28 +76,28 @@ static char* getDisplayName(CGDirectDisplayID displayID)
|
|||||||
|
|
||||||
// Check whether the display mode should be included in enumeration
|
// 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);
|
uint32_t flags = CGDisplayModeGetIOFlags(mode);
|
||||||
if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag))
|
if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (flags & kDisplayModeInterlacedFlag)
|
if (flags & kDisplayModeInterlacedFlag)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (flags & kDisplayModeStretchedFlag)
|
if (flags & kDisplayModeStretchedFlag)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
|
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
|
||||||
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
|
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
|
||||||
CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
|
CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
|
||||||
{
|
{
|
||||||
CFRelease(format);
|
CFRelease(format);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFRelease(format);
|
CFRelease(format);
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert Core Graphics display mode to GLFW video mode
|
// Convert Core Graphics display mode to GLFW video mode
|
||||||
@ -166,7 +166,7 @@ static void endFadeReservation(CGDisplayFadeReservationToken token)
|
|||||||
|
|
||||||
// Change the current video mode
|
// Change the current video mode
|
||||||
//
|
//
|
||||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
||||||
{
|
{
|
||||||
CFArrayRef modes;
|
CFArrayRef modes;
|
||||||
CFIndex count, i;
|
CFIndex count, i;
|
||||||
@ -178,7 +178,7 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
|||||||
best = _glfwChooseVideoMode(monitor, desired);
|
best = _glfwChooseVideoMode(monitor, desired);
|
||||||
_glfwPlatformGetVideoMode(monitor, ¤t);
|
_glfwPlatformGetVideoMode(monitor, ¤t);
|
||||||
if (_glfwCompareVideoModes(¤t, best) == 0)
|
if (_glfwCompareVideoModes(¤t, best) == 0)
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
|
|
||||||
CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
|
CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
|
||||||
|
|
||||||
@ -216,10 +216,10 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Cocoa: Monitor mode list changed");
|
"Cocoa: Monitor mode list changed");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore the previously saved (original) video mode
|
// Restore the previously saved (original) video mode
|
||||||
@ -283,7 +283,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
return monitors;
|
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
|
// HACK: Compare unit numbers instead of display IDs to work around display
|
||||||
// replacement on machines with automatic graphics switching
|
// replacement on machines with automatic graphics switching
|
||||||
|
@ -116,7 +116,7 @@ typedef struct _GLFWtimeNS
|
|||||||
|
|
||||||
void _glfwInitTimer(void);
|
void _glfwInitTimer(void);
|
||||||
|
|
||||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
||||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
||||||
|
|
||||||
#endif // _glfw3_cocoa_platform_h_
|
#endif // _glfw3_cocoa_platform_h_
|
||||||
|
@ -66,10 +66,10 @@ static void centerCursor(_GLFWwindow *window)
|
|||||||
|
|
||||||
// Enter full screen mode
|
// Enter full screen mode
|
||||||
//
|
//
|
||||||
static GLboolean enterFullscreenMode(_GLFWwindow* window)
|
static GLFWbool enterFullscreenMode(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
GLFWvidmode mode;
|
GLFWvidmode mode;
|
||||||
GLboolean status;
|
GLFWbool status;
|
||||||
int xpos, ypos;
|
int xpos, ypos;
|
||||||
|
|
||||||
status = _glfwSetVideoMode(window->monitor, &window->videoMode);
|
status = _glfwSetVideoMode(window->monitor, &window->videoMode);
|
||||||
@ -207,7 +207,7 @@ static int translateKey(unsigned int key)
|
|||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
leaveFullscreenMode(window);
|
leaveFullscreenMode(window);
|
||||||
|
|
||||||
_glfwInputWindowIconify(window, GL_TRUE);
|
_glfwInputWindowIconify(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidDeminiaturize:(NSNotification *)notification
|
- (void)windowDidDeminiaturize:(NSNotification *)notification
|
||||||
@ -215,7 +215,7 @@ static int translateKey(unsigned int key)
|
|||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
enterFullscreenMode(window);
|
enterFullscreenMode(window);
|
||||||
|
|
||||||
_glfwInputWindowIconify(window, GL_FALSE);
|
_glfwInputWindowIconify(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeKey:(NSNotification *)notification
|
- (void)windowDidBecomeKey:(NSNotification *)notification
|
||||||
@ -226,7 +226,7 @@ static int translateKey(unsigned int key)
|
|||||||
centerCursor(window);
|
centerCursor(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfwInputWindowFocus(window, GL_TRUE);
|
_glfwInputWindowFocus(window, GLFW_TRUE);
|
||||||
_glfwPlatformSetCursorMode(window, window->cursorMode);
|
_glfwPlatformSetCursorMode(window, window->cursorMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ static int translateKey(unsigned int key)
|
|||||||
if (window->monitor && window->autoIconify)
|
if (window->monitor && window->autoIconify)
|
||||||
_glfwPlatformIconifyWindow(window);
|
_glfwPlatformIconifyWindow(window);
|
||||||
|
|
||||||
_glfwInputWindowFocus(window, GL_FALSE);
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -440,12 +440,12 @@ static int translateKey(unsigned int key)
|
|||||||
|
|
||||||
- (void)mouseExited:(NSEvent *)event
|
- (void)mouseExited:(NSEvent *)event
|
||||||
{
|
{
|
||||||
_glfwInputCursorEnter(window, GL_FALSE);
|
_glfwInputCursorEnter(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)mouseEntered:(NSEvent *)event
|
- (void)mouseEntered:(NSEvent *)event
|
||||||
{
|
{
|
||||||
_glfwInputCursorEnter(window, GL_TRUE);
|
_glfwInputCursorEnter(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidChangeBackingProperties
|
- (void)viewDidChangeBackingProperties
|
||||||
@ -782,10 +782,10 @@ static void createMenuBar(void)
|
|||||||
|
|
||||||
// Initialize the Cocoa Application Kit
|
// Initialize the Cocoa Application Kit
|
||||||
//
|
//
|
||||||
static GLboolean initializeAppKit(void)
|
static GLFWbool initializeAppKit(void)
|
||||||
{
|
{
|
||||||
if (NSApp)
|
if (NSApp)
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
|
|
||||||
// Implicitly create shared NSApplication instance
|
// Implicitly create shared NSApplication instance
|
||||||
[GLFWApplication sharedApplication];
|
[GLFWApplication sharedApplication];
|
||||||
@ -807,26 +807,26 @@ static GLboolean initializeAppKit(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Cocoa: Failed to create application delegate");
|
"Cocoa: Failed to create application delegate");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
[NSApp setDelegate:_glfw.ns.delegate];
|
[NSApp setDelegate:_glfw.ns.delegate];
|
||||||
[NSApp run];
|
[NSApp run];
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the Cocoa window
|
// Create the Cocoa window
|
||||||
//
|
//
|
||||||
static GLboolean createWindow(_GLFWwindow* window,
|
static GLFWbool createWindow(_GLFWwindow* window,
|
||||||
const _GLFWwndconfig* wndconfig)
|
const _GLFWwndconfig* wndconfig)
|
||||||
{
|
{
|
||||||
window->ns.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window];
|
window->ns.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window];
|
||||||
if (window->ns.delegate == nil)
|
if (window->ns.delegate == nil)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Cocoa: Failed to create window delegate");
|
"Cocoa: Failed to create window delegate");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int styleMask = 0;
|
unsigned int styleMask = 0;
|
||||||
@ -866,7 +866,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
if (window->ns.object == nil)
|
if (window->ns.object == nil)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to create window");
|
_glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to create window");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||||
@ -908,7 +908,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
[window->ns.object setRestorable:NO];
|
[window->ns.object setRestorable:NO];
|
||||||
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -922,13 +922,13 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
const _GLFWfbconfig* fbconfig)
|
const _GLFWfbconfig* fbconfig)
|
||||||
{
|
{
|
||||||
if (!initializeAppKit())
|
if (!initializeAppKit())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (!createWindow(window, wndconfig))
|
if (!createWindow(window, wndconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
[window->nsgl.context setView:window->ns.view];
|
[window->nsgl.context setView:window->ns.view];
|
||||||
|
|
||||||
@ -936,10 +936,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwPlatformShowWindow(window);
|
_glfwPlatformShowWindow(window);
|
||||||
if (!enterFullscreenMode(window))
|
if (!enterFullscreenMode(window))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||||
@ -1196,7 +1196,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
NSBitmapImageRep* rep;
|
NSBitmapImageRep* rep;
|
||||||
|
|
||||||
if (!initializeAppKit())
|
if (!initializeAppKit())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
rep = [[NSBitmapImageRep alloc]
|
rep = [[NSBitmapImageRep alloc]
|
||||||
initWithBitmapDataPlanes:NULL
|
initWithBitmapDataPlanes:NULL
|
||||||
@ -1212,7 +1212,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
bitsPerPixel:32];
|
bitsPerPixel:32];
|
||||||
|
|
||||||
if (rep == nil)
|
if (rep == nil)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
memcpy([rep bitmapData], image->pixels, image->width * image->height * 4);
|
memcpy([rep bitmapData], image->pixels, image->width * image->height * 4);
|
||||||
|
|
||||||
@ -1226,26 +1226,26 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
[rep release];
|
[rep release];
|
||||||
|
|
||||||
if (cursor->ns.object == nil)
|
if (cursor->ns.object == nil)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
||||||
{
|
{
|
||||||
if (!initializeAppKit())
|
if (!initializeAppKit())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
cursor->ns.object = getStandardCursor(shape);
|
cursor->ns.object = getStandardCursor(shape);
|
||||||
if (!cursor->ns.object)
|
if (!cursor->ns.object)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Cocoa: Failed to retrieve standard cursor");
|
"Cocoa: Failed to retrieve standard cursor");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
[cursor->ns.object retain];
|
[cursor->ns.object retain];
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
// Parses the client API version string and extracts the version number
|
// 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;
|
int i;
|
||||||
_GLFWwindow* window;
|
_GLFWwindow* window;
|
||||||
@ -57,7 +57,7 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Failed to retrieve context version string");
|
"Failed to retrieve context version string");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; prefixes[i]; i++)
|
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,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"No version found in context version string");
|
"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 //////
|
////// GLFW internal API //////
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
||||||
{
|
{
|
||||||
if (ctxconfig->api != GLFW_OPENGL_API &&
|
if (ctxconfig->api != GLFW_OPENGL_API &&
|
||||||
ctxconfig->api != GLFW_OPENGL_ES_API)
|
ctxconfig->api != GLFW_OPENGL_ES_API)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid client API");
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid client API");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->api == GLFW_OPENGL_API)
|
if (ctxconfig->api == GLFW_OPENGL_API)
|
||||||
@ -112,7 +112,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
|||||||
_glfwInputError(GLFW_INVALID_VALUE,
|
_glfwInputError(GLFW_INVALID_VALUE,
|
||||||
"Invalid OpenGL version %i.%i",
|
"Invalid OpenGL version %i.%i",
|
||||||
ctxconfig->major, ctxconfig->minor);
|
ctxconfig->major, ctxconfig->minor);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->profile)
|
if (ctxconfig->profile)
|
||||||
@ -122,7 +122,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_INVALID_ENUM,
|
_glfwInputError(GLFW_INVALID_ENUM,
|
||||||
"Invalid OpenGL profile");
|
"Invalid OpenGL profile");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->major < 3 ||
|
if (ctxconfig->major < 3 ||
|
||||||
@ -133,7 +133,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
|||||||
|
|
||||||
_glfwInputError(GLFW_INVALID_VALUE,
|
_glfwInputError(GLFW_INVALID_VALUE,
|
||||||
"Context profiles are only defined for OpenGL version 3.2 and above");
|
"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
|
// Forward-compatible contexts are only defined for OpenGL version 3.0 and above
|
||||||
_glfwInputError(GLFW_INVALID_VALUE,
|
_glfwInputError(GLFW_INVALID_VALUE,
|
||||||
"Forward-compatibility is only defined for OpenGL version 3.0 and above");
|
"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)
|
else if (ctxconfig->api == GLFW_OPENGL_ES_API)
|
||||||
@ -159,7 +159,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
|||||||
_glfwInputError(GLFW_INVALID_VALUE,
|
_glfwInputError(GLFW_INVALID_VALUE,
|
||||||
"Invalid OpenGL ES version %i.%i",
|
"Invalid OpenGL ES version %i.%i",
|
||||||
ctxconfig->major, ctxconfig->minor);
|
ctxconfig->major, ctxconfig->minor);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_INVALID_ENUM,
|
_glfwInputError(GLFW_INVALID_ENUM,
|
||||||
"Invalid context robustness mode");
|
"Invalid context robustness mode");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,11 +181,11 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_INVALID_ENUM,
|
_glfwInputError(GLFW_INVALID_ENUM,
|
||||||
"Invalid context release behavior");
|
"Invalid context release behavior");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
||||||
@ -351,7 +351,7 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
|||||||
return closest;
|
return closest;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
|
GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
|
||||||
{
|
{
|
||||||
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
|
|||||||
&window->context.minor,
|
&window->context.minor,
|
||||||
&window->context.revision))
|
&window->context.revision))
|
||||||
{
|
{
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_GLFW_USE_OPENGL)
|
#if defined(_GLFW_USE_OPENGL)
|
||||||
@ -379,7 +379,7 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Entry point retrieval is broken");
|
"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);
|
window->GetIntegerv(GL_CONTEXT_FLAGS, &flags);
|
||||||
|
|
||||||
if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
|
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)
|
if (flags & GL_CONTEXT_FLAG_DEBUG_BIT)
|
||||||
window->context.debug = GL_TRUE;
|
window->context.debug = GLFW_TRUE;
|
||||||
else if (glfwExtensionSupported("GL_ARB_debug_output") &&
|
else if (glfwExtensionSupported("GL_ARB_debug_output") &&
|
||||||
ctxconfig->debug)
|
ctxconfig->debug)
|
||||||
{
|
{
|
||||||
// HACK: This is a workaround for older drivers (pre KHR_debug)
|
// HACK: This is a workaround for older drivers (pre KHR_debug)
|
||||||
// not setting the debug bit in the context flags for
|
// not setting the debug bit in the context flags for
|
||||||
// debug contexts
|
// 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
|
#endif // _GLFW_USE_OPENGL
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
|
GLFWbool _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
|
||||||
{
|
{
|
||||||
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
||||||
|
|
||||||
@ -491,10 +491,10 @@ GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
|
|||||||
// {GLX|WGL}_ARB_create_context extension and fail here
|
// {GLX|WGL}_ARB_create_context extension and fail here
|
||||||
|
|
||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE, NULL);
|
_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)
|
int _glfwStringInExtensionString(const char* string, const char* extensions)
|
||||||
@ -508,7 +508,7 @@ int _glfwStringInExtensionString(const char* string, const char* extensions)
|
|||||||
|
|
||||||
where = strstr(start, string);
|
where = strstr(start, string);
|
||||||
if (!where)
|
if (!where)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
terminator = where + strlen(string);
|
terminator = where + strlen(string);
|
||||||
if (where == start || *(where - 1) == ' ')
|
if (where == start || *(where - 1) == ' ')
|
||||||
@ -520,7 +520,7 @@ int _glfwStringInExtensionString(const char* string, const char* extensions)
|
|||||||
start = terminator;
|
start = terminator;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -565,19 +565,19 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
|
|||||||
{
|
{
|
||||||
_GLFWwindow* window;
|
_GLFWwindow* window;
|
||||||
|
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(GL_FALSE);
|
_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);
|
||||||
|
|
||||||
window = _glfwPlatformGetCurrentContext();
|
window = _glfwPlatformGetCurrentContext();
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_NO_CURRENT_CONTEXT, NULL);
|
_glfwInputError(GLFW_NO_CURRENT_CONTEXT, NULL);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*extension == '\0')
|
if (*extension == '\0')
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_INVALID_VALUE, NULL);
|
_glfwInputError(GLFW_INVALID_VALUE, NULL);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_GLFW_USE_OPENGL)
|
#if defined(_GLFW_USE_OPENGL)
|
||||||
@ -597,11 +597,11 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Failed to retrieve extension string %i", i);
|
"Failed to retrieve extension string %i", i);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(en, extension) == 0)
|
if (strcmp(en, extension) == 0)
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -614,11 +614,11 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Failed to retrieve extension string");
|
"Failed to retrieve extension string");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfwStringInExtensionString(extension, extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if extension is in the platform-specific string
|
// Check if extension is in the platform-specific string
|
||||||
|
@ -84,9 +84,9 @@ static int getConfigAttrib(EGLConfig config, int attrib)
|
|||||||
|
|
||||||
// Return a list of available and usable framebuffer configs
|
// Return a list of available and usable framebuffer configs
|
||||||
//
|
//
|
||||||
static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
|
static GLFWbool chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
|
||||||
const _GLFWfbconfig* desired,
|
const _GLFWfbconfig* desired,
|
||||||
EGLConfig* result)
|
EGLConfig* result)
|
||||||
{
|
{
|
||||||
EGLConfig* nativeConfigs;
|
EGLConfig* nativeConfigs;
|
||||||
_GLFWfbconfig* usableConfigs;
|
_GLFWfbconfig* usableConfigs;
|
||||||
@ -97,7 +97,7 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
|
|||||||
if (!nativeCount)
|
if (!nativeCount)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE, "EGL: No EGLConfigs returned");
|
_glfwInputError(GLFW_API_UNAVAILABLE, "EGL: No EGLConfigs returned");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nativeConfigs = calloc(nativeCount, sizeof(EGLConfig));
|
nativeConfigs = calloc(nativeCount, sizeof(EGLConfig));
|
||||||
@ -154,7 +154,7 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
|
|||||||
u->stencilBits = getConfigAttrib(n, EGL_STENCIL_SIZE);
|
u->stencilBits = getConfigAttrib(n, EGL_STENCIL_SIZE);
|
||||||
|
|
||||||
u->samples = getConfigAttrib(n, EGL_SAMPLES);
|
u->samples = getConfigAttrib(n, EGL_SAMPLES);
|
||||||
u->doublebuffer = GL_TRUE;
|
u->doublebuffer = GLFW_TRUE;
|
||||||
|
|
||||||
u->egl = n;
|
u->egl = n;
|
||||||
usableCount++;
|
usableCount++;
|
||||||
@ -167,7 +167,7 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
|
|||||||
free(nativeConfigs);
|
free(nativeConfigs);
|
||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
|
|
||||||
return closest ? GL_TRUE : GL_FALSE;
|
return closest ? GLFW_TRUE : GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ int _glfwInitContextAPI(void)
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!_glfwCreateContextTLS())
|
if (!_glfwCreateContextTLS())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
for (i = 0; sonames[i]; i++)
|
for (i = 0; sonames[i]; i++)
|
||||||
{
|
{
|
||||||
@ -206,7 +206,7 @@ int _glfwInitContextAPI(void)
|
|||||||
if (!_glfw.egl.handle)
|
if (!_glfw.egl.handle)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE, "EGL: Failed to load EGL");
|
_glfwInputError(GLFW_API_UNAVAILABLE, "EGL: Failed to load EGL");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.egl.GetConfigAttrib =
|
_glfw.egl.GetConfigAttrib =
|
||||||
@ -249,7 +249,7 @@ int _glfwInitContextAPI(void)
|
|||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"EGL: Failed to get EGL display: %s",
|
"EGL: Failed to get EGL display: %s",
|
||||||
getErrorString(_glfw_eglGetError()));
|
getErrorString(_glfw_eglGetError()));
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_glfw_eglInitialize(_glfw.egl.display,
|
if (!_glfw_eglInitialize(_glfw.egl.display,
|
||||||
@ -259,13 +259,13 @@ int _glfwInitContextAPI(void)
|
|||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"EGL: Failed to initialize EGL: %s",
|
"EGL: Failed to initialize EGL: %s",
|
||||||
getErrorString(_glfw_eglGetError()));
|
getErrorString(_glfw_eglGetError()));
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.egl.KHR_create_context =
|
_glfw.egl.KHR_create_context =
|
||||||
_glfwPlatformExtensionSupported("EGL_KHR_create_context");
|
_glfwPlatformExtensionSupported("EGL_KHR_create_context");
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Terminate EGL
|
// Terminate EGL
|
||||||
@ -308,7 +308,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
||||||
"EGL: Failed to find a suitable EGLConfig");
|
"EGL: Failed to find a suitable EGLConfig");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_GLFW_X11)
|
#if defined(_GLFW_X11)
|
||||||
@ -355,7 +355,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"EGL: Failed to retrieve visual for EGLConfig");
|
"EGL: Failed to retrieve visual for EGLConfig");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // _GLFW_X11
|
#endif // _GLFW_X11
|
||||||
@ -367,7 +367,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"EGL: Failed to bind OpenGL ES: %s",
|
"EGL: Failed to bind OpenGL ES: %s",
|
||||||
getErrorString(_glfw_eglGetError()));
|
getErrorString(_glfw_eglGetError()));
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -377,7 +377,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"EGL: Failed to bind OpenGL: %s",
|
"EGL: Failed to bind OpenGL: %s",
|
||||||
getErrorString(_glfw_eglGetError()));
|
getErrorString(_glfw_eglGetError()));
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"EGL: Failed to create context: %s",
|
"EGL: Failed to create context: %s",
|
||||||
getErrorString(_glfw_eglGetError()));
|
getErrorString(_glfw_eglGetError()));
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
window->egl.config = config;
|
window->egl.config = config;
|
||||||
@ -515,11 +515,11 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"EGL: Failed to load client library");
|
"EGL: Failed to load client library");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef setEGLattrib
|
#undef setEGLattrib
|
||||||
@ -632,10 +632,10 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
|||||||
if (extensions)
|
if (extensions)
|
||||||
{
|
{
|
||||||
if (_glfwStringInExtensionString(extension, extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||||
|
@ -109,7 +109,7 @@ typedef struct _GLFWlibraryEGL
|
|||||||
EGLDisplay display;
|
EGLDisplay display;
|
||||||
EGLint major, minor;
|
EGLint major, minor;
|
||||||
|
|
||||||
GLboolean KHR_create_context;
|
GLFWbool KHR_create_context;
|
||||||
|
|
||||||
void* handle;
|
void* handle;
|
||||||
|
|
||||||
|
@ -48,27 +48,27 @@ static int getFBConfigAttrib(GLXFBConfig fbconfig, int attrib)
|
|||||||
|
|
||||||
// Return a list of available and usable framebuffer configs
|
// 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;
|
GLXFBConfig* nativeConfigs;
|
||||||
_GLFWfbconfig* usableConfigs;
|
_GLFWfbconfig* usableConfigs;
|
||||||
const _GLFWfbconfig* closest;
|
const _GLFWfbconfig* closest;
|
||||||
int i, nativeCount, usableCount;
|
int i, nativeCount, usableCount;
|
||||||
const char* vendor;
|
const char* vendor;
|
||||||
GLboolean trustWindowBit = GL_TRUE;
|
GLFWbool trustWindowBit = GLFW_TRUE;
|
||||||
|
|
||||||
// HACK: This is a (hopefully temporary) workaround for Chromium
|
// HACK: This is a (hopefully temporary) workaround for Chromium
|
||||||
// (VirtualBox GL) not setting the window bit on any GLXFBConfigs
|
// (VirtualBox GL) not setting the window bit on any GLXFBConfigs
|
||||||
vendor = _glfw_glXGetClientString(_glfw.x11.display, GLX_VENDOR);
|
vendor = _glfw_glXGetClientString(_glfw.x11.display, GLX_VENDOR);
|
||||||
if (strcmp(vendor, "Chromium") == 0)
|
if (strcmp(vendor, "Chromium") == 0)
|
||||||
trustWindowBit = GL_FALSE;
|
trustWindowBit = GLFW_FALSE;
|
||||||
|
|
||||||
nativeConfigs = _glfw_glXGetFBConfigs(_glfw.x11.display, _glfw.x11.screen,
|
nativeConfigs = _glfw_glXGetFBConfigs(_glfw.x11.display, _glfw.x11.screen,
|
||||||
&nativeCount);
|
&nativeCount);
|
||||||
if (!nativeCount)
|
if (!nativeCount)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: No GLXFBConfigs returned");
|
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: No GLXFBConfigs returned");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig));
|
usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig));
|
||||||
@ -110,9 +110,9 @@ static GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* resul
|
|||||||
u->auxBuffers = getFBConfigAttrib(n, GLX_AUX_BUFFERS);
|
u->auxBuffers = getFBConfigAttrib(n, GLX_AUX_BUFFERS);
|
||||||
|
|
||||||
if (getFBConfigAttrib(n, GLX_STEREO))
|
if (getFBConfigAttrib(n, GLX_STEREO))
|
||||||
u->stereo = GL_TRUE;
|
u->stereo = GLFW_TRUE;
|
||||||
if (getFBConfigAttrib(n, GLX_DOUBLEBUFFER))
|
if (getFBConfigAttrib(n, GLX_DOUBLEBUFFER))
|
||||||
u->doublebuffer = GL_TRUE;
|
u->doublebuffer = GLFW_TRUE;
|
||||||
|
|
||||||
if (_glfw.glx.ARB_multisample)
|
if (_glfw.glx.ARB_multisample)
|
||||||
u->samples = getFBConfigAttrib(n, GLX_SAMPLES);
|
u->samples = getFBConfigAttrib(n, GLX_SAMPLES);
|
||||||
@ -131,7 +131,7 @@ static GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* resul
|
|||||||
XFree(nativeConfigs);
|
XFree(nativeConfigs);
|
||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
|
|
||||||
return closest ? GL_TRUE : GL_FALSE;
|
return closest ? GLFW_TRUE : GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the OpenGL context using legacy API
|
// Create the OpenGL context using legacy API
|
||||||
@ -163,13 +163,13 @@ int _glfwInitContextAPI(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!_glfwCreateContextTLS())
|
if (!_glfwCreateContextTLS())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
_glfw.glx.handle = dlopen(soname, RTLD_LAZY | RTLD_GLOBAL);
|
_glfw.glx.handle = dlopen(soname, RTLD_LAZY | RTLD_GLOBAL);
|
||||||
if (!_glfw.glx.handle)
|
if (!_glfw.glx.handle)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: %s", dlerror());
|
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: %s", dlerror());
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.glx.GetFBConfigs =
|
_glfw.glx.GetFBConfigs =
|
||||||
@ -204,7 +204,7 @@ int _glfwInitContextAPI(void)
|
|||||||
&_glfw.glx.eventBase))
|
&_glfw.glx.eventBase))
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: GLX extension not found");
|
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: GLX extension not found");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_glfw_glXQueryVersion(_glfw.x11.display,
|
if (!_glfw_glXQueryVersion(_glfw.x11.display,
|
||||||
@ -213,14 +213,14 @@ int _glfwInitContextAPI(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"GLX: Failed to query GLX version");
|
"GLX: Failed to query GLX version");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfw.glx.major == 1 && _glfw.glx.minor < 3)
|
if (_glfw.glx.major == 1 && _glfw.glx.minor < 3)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"GLX: GLX version 1.3 is required");
|
"GLX: GLX version 1.3 is required");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfwPlatformExtensionSupported("GLX_EXT_swap_control"))
|
if (_glfwPlatformExtensionSupported("GLX_EXT_swap_control"))
|
||||||
@ -229,7 +229,7 @@ int _glfwInitContextAPI(void)
|
|||||||
_glfwPlatformGetProcAddress("glXSwapIntervalEXT");
|
_glfwPlatformGetProcAddress("glXSwapIntervalEXT");
|
||||||
|
|
||||||
if (_glfw.glx.SwapIntervalEXT)
|
if (_glfw.glx.SwapIntervalEXT)
|
||||||
_glfw.glx.EXT_swap_control = GL_TRUE;
|
_glfw.glx.EXT_swap_control = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfwPlatformExtensionSupported("GLX_SGI_swap_control"))
|
if (_glfwPlatformExtensionSupported("GLX_SGI_swap_control"))
|
||||||
@ -238,7 +238,7 @@ int _glfwInitContextAPI(void)
|
|||||||
_glfwPlatformGetProcAddress("glXSwapIntervalSGI");
|
_glfwPlatformGetProcAddress("glXSwapIntervalSGI");
|
||||||
|
|
||||||
if (_glfw.glx.SwapIntervalSGI)
|
if (_glfw.glx.SwapIntervalSGI)
|
||||||
_glfw.glx.SGI_swap_control = GL_TRUE;
|
_glfw.glx.SGI_swap_control = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfwPlatformExtensionSupported("GLX_MESA_swap_control"))
|
if (_glfwPlatformExtensionSupported("GLX_MESA_swap_control"))
|
||||||
@ -247,17 +247,17 @@ int _glfwInitContextAPI(void)
|
|||||||
_glfwPlatformGetProcAddress("glXSwapIntervalMESA");
|
_glfwPlatformGetProcAddress("glXSwapIntervalMESA");
|
||||||
|
|
||||||
if (_glfw.glx.SwapIntervalMESA)
|
if (_glfw.glx.SwapIntervalMESA)
|
||||||
_glfw.glx.MESA_swap_control = GL_TRUE;
|
_glfw.glx.MESA_swap_control = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfwPlatformExtensionSupported("GLX_ARB_multisample"))
|
if (_glfwPlatformExtensionSupported("GLX_ARB_multisample"))
|
||||||
_glfw.glx.ARB_multisample = GL_TRUE;
|
_glfw.glx.ARB_multisample = GLFW_TRUE;
|
||||||
|
|
||||||
if (_glfwPlatformExtensionSupported("GLX_ARB_framebuffer_sRGB"))
|
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"))
|
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"))
|
if (_glfwPlatformExtensionSupported("GLX_ARB_create_context"))
|
||||||
{
|
{
|
||||||
@ -265,22 +265,22 @@ int _glfwInitContextAPI(void)
|
|||||||
_glfwPlatformGetProcAddress("glXCreateContextAttribsARB");
|
_glfwPlatformGetProcAddress("glXCreateContextAttribsARB");
|
||||||
|
|
||||||
if (_glfw.glx.CreateContextAttribsARB)
|
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"))
|
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"))
|
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"))
|
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"))
|
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
|
// Terminate GLX
|
||||||
@ -323,7 +323,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
||||||
"GLX: Failed to find a suitable GLXFBConfig");
|
"GLX: Failed to find a suitable GLXFBConfig");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
window->glx.visual = _glfw_glXGetVisualFromFBConfig(_glfw.x11.display,
|
window->glx.visual = _glfw_glXGetVisualFromFBConfig(_glfw.x11.display,
|
||||||
@ -332,7 +332,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"GLX: Failed to retrieve visual for GLXFBConfig");
|
"GLX: Failed to retrieve visual for GLXFBConfig");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->api == GLFW_OPENGL_ES_API)
|
if (ctxconfig->api == GLFW_OPENGL_ES_API)
|
||||||
@ -343,7 +343,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"GLX: OpenGL ES requested but GLX_EXT_create_context_es2_profile is 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,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"GLX: Forward compatibility requested but GLX_ARB_create_context_profile is 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,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"GLX: An OpenGL profile requested but GLX_ARB_create_context_profile is 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 &&
|
if (_glfw.x11.errorCode == _glfw.glx.errorBase + GLXBadProfileARB &&
|
||||||
ctxconfig->api == GLFW_OPENGL_API &&
|
ctxconfig->api == GLFW_OPENGL_API &&
|
||||||
ctxconfig->profile == GLFW_OPENGL_ANY_PROFILE &&
|
ctxconfig->profile == GLFW_OPENGL_ANY_PROFILE &&
|
||||||
ctxconfig->forward == GL_FALSE)
|
ctxconfig->forward == GLFW_FALSE)
|
||||||
{
|
{
|
||||||
window->glx.context = createLegacyContext(window, native, share);
|
window->glx.context = createLegacyContext(window, native, share);
|
||||||
}
|
}
|
||||||
@ -473,10 +473,10 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
if (!window->glx.context)
|
if (!window->glx.context)
|
||||||
{
|
{
|
||||||
_glfwInputXError(GLFW_VERSION_UNAVAILABLE, "GLX: Failed to create context");
|
_glfwInputXError(GLFW_VERSION_UNAVAILABLE, "GLX: Failed to create context");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef setGLXattrib
|
#undef setGLXattrib
|
||||||
@ -548,10 +548,10 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
|||||||
if (extensions)
|
if (extensions)
|
||||||
{
|
{
|
||||||
if (_glfwStringInExtensionString(extension, extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||||
|
@ -110,17 +110,17 @@ typedef struct _GLFWlibraryGLX
|
|||||||
PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT;
|
PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT;
|
||||||
PFNGLXSWAPINTERVALMESAPROC SwapIntervalMESA;
|
PFNGLXSWAPINTERVALMESAPROC SwapIntervalMESA;
|
||||||
PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
|
PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
|
||||||
GLboolean SGI_swap_control;
|
GLFWbool SGI_swap_control;
|
||||||
GLboolean EXT_swap_control;
|
GLFWbool EXT_swap_control;
|
||||||
GLboolean MESA_swap_control;
|
GLFWbool MESA_swap_control;
|
||||||
GLboolean ARB_multisample;
|
GLFWbool ARB_multisample;
|
||||||
GLboolean ARB_framebuffer_sRGB;
|
GLFWbool ARB_framebuffer_sRGB;
|
||||||
GLboolean EXT_framebuffer_sRGB;
|
GLFWbool EXT_framebuffer_sRGB;
|
||||||
GLboolean ARB_create_context;
|
GLFWbool ARB_create_context;
|
||||||
GLboolean ARB_create_context_profile;
|
GLFWbool ARB_create_context_profile;
|
||||||
GLboolean ARB_create_context_robustness;
|
GLFWbool ARB_create_context_robustness;
|
||||||
GLboolean EXT_create_context_es2_profile;
|
GLFWbool EXT_create_context_es2_profile;
|
||||||
GLboolean ARB_context_flush_control;
|
GLFWbool ARB_context_flush_control;
|
||||||
|
|
||||||
} _GLFWlibraryGLX;
|
} _GLFWlibraryGLX;
|
||||||
|
|
||||||
|
12
src/init.c
12
src/init.c
@ -39,7 +39,7 @@
|
|||||||
// Global state shared between compilation units of GLFW
|
// Global state shared between compilation units of GLFW
|
||||||
// These are documented in internal.h
|
// These are documented in internal.h
|
||||||
//
|
//
|
||||||
GLboolean _glfwInitialized = GL_FALSE;
|
GLFWbool _glfwInitialized = GLFW_FALSE;
|
||||||
_GLFWlibrary _glfw;
|
_GLFWlibrary _glfw;
|
||||||
|
|
||||||
// This is outside of _glfw so it can be initialized and usable before
|
// 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)
|
GLFWAPI int glfwInit(void)
|
||||||
{
|
{
|
||||||
if (_glfwInitialized)
|
if (_glfwInitialized)
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
|
|
||||||
memset(&_glfw, 0, sizeof(_glfw));
|
memset(&_glfw, 0, sizeof(_glfw));
|
||||||
|
|
||||||
if (!_glfwPlatformInit())
|
if (!_glfwPlatformInit())
|
||||||
{
|
{
|
||||||
_glfwPlatformTerminate();
|
_glfwPlatformTerminate();
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
|
_glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
|
||||||
_glfwInitialized = GL_TRUE;
|
_glfwInitialized = GLFW_TRUE;
|
||||||
|
|
||||||
// Not all window hints have zero as their default value
|
// Not all window hints have zero as their default value
|
||||||
glfwDefaultWindowHints();
|
glfwDefaultWindowHints();
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWAPI void glfwTerminate(void)
|
GLFWAPI void glfwTerminate(void)
|
||||||
@ -166,7 +166,7 @@ GLFWAPI void glfwTerminate(void)
|
|||||||
_glfwPlatformTerminate();
|
_glfwPlatformTerminate();
|
||||||
|
|
||||||
memset(&_glfw, 0, sizeof(_glfw));
|
memset(&_glfw, 0, sizeof(_glfw));
|
||||||
_glfwInitialized = GL_FALSE;
|
_glfwInitialized = GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev)
|
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev)
|
||||||
|
@ -135,13 +135,13 @@ void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int m
|
|||||||
{
|
{
|
||||||
if (key >= 0 && key <= GLFW_KEY_LAST)
|
if (key >= 0 && key <= GLFW_KEY_LAST)
|
||||||
{
|
{
|
||||||
GLboolean repeated = GL_FALSE;
|
GLFWbool repeated = GLFW_FALSE;
|
||||||
|
|
||||||
if (action == GLFW_RELEASE && window->keys[key] == GLFW_RELEASE)
|
if (action == GLFW_RELEASE && window->keys[key] == GLFW_RELEASE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (action == GLFW_PRESS && window->keys[key] == GLFW_PRESS)
|
if (action == GLFW_PRESS && window->keys[key] == GLFW_PRESS)
|
||||||
repeated = GL_TRUE;
|
repeated = GLFW_TRUE;
|
||||||
|
|
||||||
if (action == GLFW_RELEASE && window->stickyKeys)
|
if (action == GLFW_RELEASE && window->stickyKeys)
|
||||||
window->keys[key] = _GLFW_STICK;
|
window->keys[key] = _GLFW_STICK;
|
||||||
@ -259,10 +259,10 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
|||||||
setCursorMode(window, value);
|
setCursorMode(window, value);
|
||||||
break;
|
break;
|
||||||
case GLFW_STICKY_KEYS:
|
case GLFW_STICKY_KEYS:
|
||||||
setStickyKeys(window, value ? GL_TRUE : GL_FALSE);
|
setStickyKeys(window, value ? GLFW_TRUE : GLFW_FALSE);
|
||||||
break;
|
break;
|
||||||
case GLFW_STICKY_MOUSE_BUTTONS:
|
case GLFW_STICKY_MOUSE_BUTTONS:
|
||||||
setStickyMouseButtons(window, value ? GL_TRUE : GL_FALSE);
|
setStickyMouseButtons(window, value ? GLFW_TRUE : GLFW_FALSE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode");
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode");
|
||||||
|
@ -81,6 +81,8 @@ typedef struct _GLFWlibrary _GLFWlibrary;
|
|||||||
typedef struct _GLFWmonitor _GLFWmonitor;
|
typedef struct _GLFWmonitor _GLFWmonitor;
|
||||||
typedef struct _GLFWcursor _GLFWcursor;
|
typedef struct _GLFWcursor _GLFWcursor;
|
||||||
|
|
||||||
|
typedef int GLFWbool;
|
||||||
|
|
||||||
#if defined(_GLFW_COCOA)
|
#if defined(_GLFW_COCOA)
|
||||||
#include "cocoa_platform.h"
|
#include "cocoa_platform.h"
|
||||||
#elif defined(_GLFW_WIN32)
|
#elif defined(_GLFW_WIN32)
|
||||||
@ -166,12 +168,12 @@ struct _GLFWwndconfig
|
|||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
const char* title;
|
const char* title;
|
||||||
GLboolean resizable;
|
GLFWbool resizable;
|
||||||
GLboolean visible;
|
GLFWbool visible;
|
||||||
GLboolean decorated;
|
GLFWbool decorated;
|
||||||
GLboolean focused;
|
GLFWbool focused;
|
||||||
GLboolean autoIconify;
|
GLFWbool autoIconify;
|
||||||
GLboolean floating;
|
GLFWbool floating;
|
||||||
_GLFWmonitor* monitor;
|
_GLFWmonitor* monitor;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,8 +189,8 @@ struct _GLFWctxconfig
|
|||||||
int api;
|
int api;
|
||||||
int major;
|
int major;
|
||||||
int minor;
|
int minor;
|
||||||
GLboolean forward;
|
GLFWbool forward;
|
||||||
GLboolean debug;
|
GLFWbool debug;
|
||||||
int profile;
|
int profile;
|
||||||
int robustness;
|
int robustness;
|
||||||
int release;
|
int release;
|
||||||
@ -234,19 +236,19 @@ struct _GLFWwindow
|
|||||||
struct _GLFWwindow* next;
|
struct _GLFWwindow* next;
|
||||||
|
|
||||||
// Window settings and state
|
// Window settings and state
|
||||||
GLboolean resizable;
|
GLFWbool resizable;
|
||||||
GLboolean decorated;
|
GLFWbool decorated;
|
||||||
GLboolean autoIconify;
|
GLFWbool autoIconify;
|
||||||
GLboolean floating;
|
GLFWbool floating;
|
||||||
GLboolean closed;
|
GLFWbool closed;
|
||||||
void* userPointer;
|
void* userPointer;
|
||||||
GLFWvidmode videoMode;
|
GLFWvidmode videoMode;
|
||||||
_GLFWmonitor* monitor;
|
_GLFWmonitor* monitor;
|
||||||
_GLFWcursor* cursor;
|
_GLFWcursor* cursor;
|
||||||
|
|
||||||
// Window input state
|
// Window input state
|
||||||
GLboolean stickyKeys;
|
GLFWbool stickyKeys;
|
||||||
GLboolean stickyMouseButtons;
|
GLFWbool stickyMouseButtons;
|
||||||
double cursorPosX, cursorPosY;
|
double cursorPosX, cursorPosY;
|
||||||
int cursorMode;
|
int cursorMode;
|
||||||
char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
|
char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
|
||||||
@ -256,7 +258,7 @@ struct _GLFWwindow
|
|||||||
struct {
|
struct {
|
||||||
int api;
|
int api;
|
||||||
int major, minor, revision;
|
int major, minor, revision;
|
||||||
GLboolean forward, debug;
|
GLFWbool forward, debug;
|
||||||
int profile;
|
int profile;
|
||||||
int robustness;
|
int robustness;
|
||||||
int release;
|
int release;
|
||||||
@ -369,7 +371,7 @@ struct _GLFWlibrary
|
|||||||
|
|
||||||
/*! @brief Flag indicating whether GLFW has been successfully initialized.
|
/*! @brief Flag indicating whether GLFW has been successfully initialized.
|
||||||
*/
|
*/
|
||||||
extern GLboolean _glfwInitialized;
|
extern GLFWbool _glfwInitialized;
|
||||||
|
|
||||||
/*! @brief All global data protected by @ref _glfwInitialized.
|
/*! @brief All global data protected by @ref _glfwInitialized.
|
||||||
* This should only be touched after a call to @ref glfwInit that has not been
|
* 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.
|
/*! @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
|
* @ingroup platform
|
||||||
*/
|
*/
|
||||||
int _glfwPlatformInit(void);
|
int _glfwPlatformInit(void);
|
||||||
@ -427,11 +429,11 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count);
|
|||||||
*
|
*
|
||||||
* @param[in] first The first monitor.
|
* @param[in] first The first monitor.
|
||||||
* @param[in] second The second monitor.
|
* @param[in] second The second monitor.
|
||||||
* @return @c GL_TRUE if the monitor objects represent the same monitor, or @c
|
* @return @c GLFW_TRUE if the monitor objects represent the same monitor, or
|
||||||
* GL_FALSE otherwise.
|
* @c GLFW_FALSE otherwise.
|
||||||
* @ingroup platform
|
* @ingroup platform
|
||||||
*/
|
*/
|
||||||
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second);
|
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second);
|
||||||
|
|
||||||
/*! @copydoc glfwGetMonitorPos
|
/*! @copydoc glfwGetMonitorPos
|
||||||
* @ingroup platform
|
* @ingroup platform
|
||||||
@ -657,11 +659,11 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor);
|
|||||||
|
|
||||||
/*! @brief Notifies shared code of a window focus event.
|
/*! @brief Notifies shared code of a window focus event.
|
||||||
* @param[in] window The window that received the 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.
|
* if it lost focus.
|
||||||
* @ingroup event
|
* @ingroup event
|
||||||
*/
|
*/
|
||||||
void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused);
|
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused);
|
||||||
|
|
||||||
/*! @brief Notifies shared code of a window movement event.
|
/*! @brief Notifies shared code of a window movement event.
|
||||||
* @param[in] window The window that received the 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.
|
/*! @brief Notifies shared code of a window iconification event.
|
||||||
* @param[in] window The window that received the event.
|
* @param[in] window The window that received the event.
|
||||||
* @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`
|
* @param[in] iconified `GLFW_TRUE` if the window was iconified, or
|
||||||
* if it was restored.
|
* `GLFW_FALSE` if it was restored.
|
||||||
* @ingroup event
|
* @ingroup event
|
||||||
*/
|
*/
|
||||||
void _glfwInputWindowIconify(_GLFWwindow* window, int iconified);
|
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] window The window that received the event.
|
||||||
* @param[in] codepoint The Unicode code point of the input character.
|
* @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] mods Bit field describing which modifier keys were held down.
|
||||||
* @param[in] plain `GL_TRUE` if the character is regular text input, or
|
* @param[in] plain `GLFW_TRUE` if the character is regular text input, or
|
||||||
* `GL_FALSE` otherwise.
|
* `GLFW_FALSE` otherwise.
|
||||||
* @ingroup event
|
* @ingroup event
|
||||||
*/
|
*/
|
||||||
void _glfwInputChar(_GLFWwindow* window, unsigned int codepoint, int mods, int plain);
|
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.
|
/*! @brief Notifies shared code of a cursor enter/leave event.
|
||||||
* @param[in] window The window that received the event.
|
* @param[in] window The window that received the event.
|
||||||
* @param[in] entered `GL_TRUE` if the cursor entered the client area of the
|
* @param[in] entered `GLFW_TRUE` if the cursor entered the client area of the
|
||||||
* window, or `GL_FALSE` if it left it.
|
* window, or `GLFW_FALSE` if it left it.
|
||||||
* @ingroup event
|
* @ingroup event
|
||||||
*/
|
*/
|
||||||
void _glfwInputCursorEnter(_GLFWwindow* window, int entered);
|
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.
|
/*! @brief Searches an extension string for the specified extension.
|
||||||
* @param[in] string The extension string to search.
|
* @param[in] string The extension string to search.
|
||||||
* @param[in] extensions The extension to search for.
|
* @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
|
* @ingroup utility
|
||||||
*/
|
*/
|
||||||
int _glfwStringInExtensionString(const char* string, const char* extensions);
|
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.
|
/*! @brief Retrieves the attributes of the current context.
|
||||||
* @param[in] ctxconfig The desired context attributes.
|
* @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
|
* @ingroup utility
|
||||||
*/
|
*/
|
||||||
GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig);
|
GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig);
|
||||||
|
|
||||||
/*! @brief Checks whether the desired context attributes are valid.
|
/*! @brief Checks whether the desired context attributes are valid.
|
||||||
* @param[in] ctxconfig The context attributes to check.
|
* @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.
|
* otherwise.
|
||||||
* @ingroup utility
|
* @ingroup utility
|
||||||
*
|
*
|
||||||
@ -837,16 +840,16 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig);
|
|||||||
* exists and whether all relevant options have supported and non-conflicting
|
* exists and whether all relevant options have supported and non-conflicting
|
||||||
* values.
|
* values.
|
||||||
*/
|
*/
|
||||||
GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
|
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
|
||||||
|
|
||||||
/*! @brief Checks whether the current context fulfils the specified hard
|
/*! @brief Checks whether the current context fulfils the specified hard
|
||||||
* constraints.
|
* constraints.
|
||||||
* @param[in] ctxconfig The desired context attributes.
|
* @param[in] ctxconfig The desired context attributes.
|
||||||
* @return `GL_TRUE` if the context fulfils the hard constraints, or `GL_FALSE`
|
* @return `GLFW_TRUE` if the context fulfils the hard constraints, or
|
||||||
* otherwise.
|
* `GLFW_FALSE` otherwise.
|
||||||
* @ingroup utility
|
* @ingroup utility
|
||||||
*/
|
*/
|
||||||
GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig);
|
GLFWbool _glfwIsValidContext(const _GLFWctxconfig* ctxconfig);
|
||||||
|
|
||||||
/*! @ingroup utility
|
/*! @ingroup utility
|
||||||
*/
|
*/
|
||||||
|
@ -286,7 +286,7 @@ static void matchCallback(void* context,
|
|||||||
if (joy > GLFW_JOYSTICK_LAST)
|
if (joy > GLFW_JOYSTICK_LAST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
joystick->present = GL_TRUE;
|
joystick->present = GLFW_TRUE;
|
||||||
joystick->deviceRef = deviceRef;
|
joystick->deviceRef = deviceRef;
|
||||||
|
|
||||||
CFStringRef name = IOHIDDeviceGetProperty(deviceRef,
|
CFStringRef name = IOHIDDeviceGetProperty(deviceRef,
|
||||||
|
@ -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].axes = calloc(axisCount, sizeof(float));
|
||||||
_glfw.linux_js.js[joy].buttons = calloc(buttonCount, 1);
|
_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__
|
#endif // __linux__
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ int _glfwInitJoysticks(void)
|
|||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Linux: Failed to initialize inotify: %s",
|
"Linux: Failed to initialize inotify: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: Register for IN_ATTRIB as well to get notified when udev is done
|
// 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)
|
if (regcomp(&_glfw.linux_js.regex, "^js[0-9]\\+$", 0) != 0)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Linux: Failed to compile regex");
|
_glfwInputError(GLFW_PLATFORM_ERROR, "Linux: Failed to compile regex");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = opendir(dirname);
|
dir = opendir(dirname);
|
||||||
@ -253,7 +253,7 @@ int _glfwInitJoysticks(void)
|
|||||||
|
|
||||||
#endif // __linux__
|
#endif // __linux__
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close all opened joystick handles
|
// Close all opened joystick handles
|
||||||
|
@ -46,14 +46,14 @@ int _glfwPlatformInit(void)
|
|||||||
"Mir: Unable to connect to server: %s",
|
"Mir: Unable to connect to server: %s",
|
||||||
mir_connection_get_error_message(_glfw.mir.connection));
|
mir_connection_get_error_message(_glfw.mir.connection));
|
||||||
|
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.mir.display =
|
_glfw.mir.display =
|
||||||
mir_connection_get_egl_native_display(_glfw.mir.connection);
|
mir_connection_get_egl_native_display(_glfw.mir.connection);
|
||||||
|
|
||||||
if (!_glfwInitContextAPI())
|
if (!_glfwInitContextAPI())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
// Need the default conf for when we set a NULL cursor
|
// Need the default conf for when we set a NULL cursor
|
||||||
_glfw.mir.default_conf = mir_cursor_configuration_from_name(mir_arrow_cursor_name);
|
_glfw.mir.default_conf = mir_cursor_configuration_from_name(mir_arrow_cursor_name);
|
||||||
@ -70,10 +70,10 @@ int _glfwPlatformInit(void)
|
|||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Mir: Failed to create event mutex: %s",
|
"Mir: Failed to create event mutex: %s",
|
||||||
strerror(error));
|
strerror(error));
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformTerminate(void)
|
void _glfwPlatformTerminate(void)
|
||||||
|
@ -73,7 +73,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
return monitors;
|
return monitors;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
||||||
{
|
{
|
||||||
return first->mir.output_id == second->mir.output_id;
|
return first->mir.output_id == second->mir.output_id;
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,9 @@ static void deleteNode(EventQueue* queue, EventNode* node)
|
|||||||
free(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
|
// 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);
|
enqueueEvent(event, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int createSurface(_GLFWwindow* window)
|
static GLFWbool createSurface(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
MirSurfaceSpec* spec;
|
MirSurfaceSpec* spec;
|
||||||
MirBufferUsage buffer_usage = mir_buffer_usage_hardware;
|
MirBufferUsage buffer_usage = mir_buffer_usage_hardware;
|
||||||
@ -395,7 +395,7 @@ static int createSurface(_GLFWwindow* window)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Mir: Unable to find a correct pixel format");
|
"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,
|
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: Unable to create surface: %s",
|
||||||
mir_surface_get_error_message(window->mir.surface));
|
mir_surface_get_error_message(window->mir.surface));
|
||||||
|
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
mir_surface_set_event_handler(window->mir.surface, addNewEvent, window);
|
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)
|
const _GLFWfbconfig* fbconfig)
|
||||||
{
|
{
|
||||||
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (wndconfig->monitor)
|
if (wndconfig->monitor)
|
||||||
{
|
{
|
||||||
@ -478,7 +478,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
"Mir: Requested surface size too large: %ix%i",
|
"Mir: Requested surface size too large: %ix%i",
|
||||||
wndconfig->width, wndconfig->height);
|
wndconfig->width, wndconfig->height);
|
||||||
|
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,12 +486,12 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
window->mir.height = wndconfig->height;
|
window->mir.height = wndconfig->height;
|
||||||
|
|
||||||
if (!createSurface(window))
|
if (!createSurface(window))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
window->mir.window = mir_buffer_stream_get_egl_native_window(
|
window->mir.window = mir_buffer_stream_get_egl_native_window(
|
||||||
mir_surface_get_buffer_stream(window->mir.surface));
|
mir_surface_get_buffer_stream(window->mir.surface));
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||||
@ -599,14 +599,14 @@ int _glfwPlatformWindowFocused(_GLFWwindow* window)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Mir: Unsupported function %s", __PRETTY_FUNCTION__);
|
"Mir: Unsupported function %s", __PRETTY_FUNCTION__);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformWindowIconified(_GLFWwindow* window)
|
int _glfwPlatformWindowIconified(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Mir: Unsupported function %s", __PRETTY_FUNCTION__);
|
"Mir: Unsupported function %s", __PRETTY_FUNCTION__);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformWindowVisible(_GLFWwindow* window)
|
int _glfwPlatformWindowVisible(_GLFWwindow* window)
|
||||||
@ -664,7 +664,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Mir: Unable to find a correct pixel format");
|
"Mir: Unable to find a correct pixel format");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream = mir_connection_create_buffer_stream_sync(_glfw.mir.connection,
|
stream = mir_connection_create_buffer_stream_sync(_glfw.mir.connection,
|
||||||
@ -699,7 +699,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
|
|
||||||
cursor->mir.custom_cursor = stream;
|
cursor->mir.custom_cursor = stream;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* getSystemCursorName(int shape)
|
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.conf = mir_cursor_configuration_from_name(cursor_name);
|
||||||
cursor->mir.custom_cursor = NULL;
|
cursor->mir.custom_cursor = NULL;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
||||||
|
@ -60,17 +60,17 @@ static int compareVideoModes(const void* firstPtr, const void* secondPtr)
|
|||||||
|
|
||||||
// Retrieves the available modes for the specified monitor
|
// Retrieves the available modes for the specified monitor
|
||||||
//
|
//
|
||||||
static int refreshVideoModes(_GLFWmonitor* monitor)
|
static GLFWbool refreshVideoModes(_GLFWmonitor* monitor)
|
||||||
{
|
{
|
||||||
int modeCount;
|
int modeCount;
|
||||||
GLFWvidmode* modes;
|
GLFWvidmode* modes;
|
||||||
|
|
||||||
if (monitor->modes)
|
if (monitor->modes)
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
|
|
||||||
modes = _glfwPlatformGetVideoModes(monitor, &modeCount);
|
modes = _glfwPlatformGetVideoModes(monitor, &modeCount);
|
||||||
if (!modes)
|
if (!modes)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
qsort(modes, modeCount, sizeof(GLFWvidmode), compareVideoModes);
|
qsort(modes, modeCount, sizeof(GLFWvidmode), compareVideoModes);
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ static int refreshVideoModes(_GLFWmonitor* monitor)
|
|||||||
monitor->modes = modes;
|
monitor->modes = modes;
|
||||||
monitor->modeCount = modeCount;
|
monitor->modeCount = modeCount;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
int _glfwInitContextAPI(void)
|
int _glfwInitContextAPI(void)
|
||||||
{
|
{
|
||||||
if (!_glfwCreateContextTLS())
|
if (!_glfwCreateContextTLS())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
_glfw.nsgl.framework =
|
_glfw.nsgl.framework =
|
||||||
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
|
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
|
||||||
@ -44,10 +44,10 @@ int _glfwInitContextAPI(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"NSGL: Failed to locate OpenGL framework");
|
"NSGL: Failed to locate OpenGL framework");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Terminate OpenGL support
|
// Terminate OpenGL support
|
||||||
@ -69,7 +69,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_API_UNAVAILABLE,
|
_glfwInputError(GLFW_API_UNAVAILABLE,
|
||||||
"NSGL: OpenGL ES is not available on OS X");
|
"NSGL: OpenGL ES is not available on OS X");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||||
@ -77,7 +77,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"NSGL: The targeted version of OS X does not support OpenGL 3.0 or 3.1");
|
"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)
|
if (ctxconfig->major > 2)
|
||||||
@ -86,14 +86,14 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"NSGL: The targeted version of OS X only supports forward-compatible contexts for OpenGL 3.2 and above");
|
"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)
|
if (ctxconfig->profile != GLFW_OPENGL_CORE_PROFILE)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"NSGL: The targeted version of OS X only supports core profile contexts for OpenGL 3.2 and above");
|
"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
|
#else
|
||||||
@ -102,7 +102,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"NSGL: The targeted version of OS X does not support OpenGL version 3.0 or above");
|
"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*/
|
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
||||||
"NSGL: Failed to find a suitable pixel format");
|
"NSGL: Failed to find a suitable pixel format");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSOpenGLContext* share = NULL;
|
NSOpenGLContext* share = NULL;
|
||||||
@ -228,10 +228,10 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"NSGL: Failed to create OpenGL context");
|
"NSGL: Failed to create OpenGL context");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destroy the OpenGL context
|
// Destroy the OpenGL context
|
||||||
@ -277,7 +277,7 @@ void _glfwPlatformSwapInterval(int interval)
|
|||||||
int _glfwPlatformExtensionSupported(const char* extension)
|
int _glfwPlatformExtensionSupported(const char* extension)
|
||||||
{
|
{
|
||||||
// There are no NSGL extensions
|
// There are no NSGL extensions
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||||
|
@ -66,7 +66,7 @@ void _glfwInitTimer(void)
|
|||||||
|
|
||||||
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)
|
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;
|
_glfw.posix_time.resolution = 1e-9;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
//
|
//
|
||||||
typedef struct _GLFWtimePOSIX
|
typedef struct _GLFWtimePOSIX
|
||||||
{
|
{
|
||||||
GLboolean monotonic;
|
GLFWbool monotonic;
|
||||||
double resolution;
|
double resolution;
|
||||||
uint64_t base;
|
uint64_t base;
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ int _glfwCreateContextTLS(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"POSIX: Failed to create context TLS");
|
"POSIX: Failed to create context TLS");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwDestroyContextTLS(void)
|
void _glfwDestroyContextTLS(void)
|
||||||
|
@ -102,9 +102,9 @@ static int getPixelFormatAttrib(_GLFWwindow* window, int pixelFormat, int attrib
|
|||||||
|
|
||||||
// Return a list of available and usable framebuffer configs
|
// Return a list of available and usable framebuffer configs
|
||||||
//
|
//
|
||||||
static GLboolean choosePixelFormat(_GLFWwindow* window,
|
static GLFWbool choosePixelFormat(_GLFWwindow* window,
|
||||||
const _GLFWfbconfig* desired,
|
const _GLFWfbconfig* desired,
|
||||||
int* result)
|
int* result)
|
||||||
{
|
{
|
||||||
_GLFWfbconfig* usableConfigs;
|
_GLFWfbconfig* usableConfigs;
|
||||||
const _GLFWfbconfig* closest;
|
const _GLFWfbconfig* closest;
|
||||||
@ -170,9 +170,9 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
|
|||||||
u->auxBuffers = getPixelFormatAttrib(window, n, WGL_AUX_BUFFERS_ARB);
|
u->auxBuffers = getPixelFormatAttrib(window, n, WGL_AUX_BUFFERS_ARB);
|
||||||
|
|
||||||
if (getPixelFormatAttrib(window, n, WGL_STEREO_ARB))
|
if (getPixelFormatAttrib(window, n, WGL_STEREO_ARB))
|
||||||
u->stereo = GL_TRUE;
|
u->stereo = GLFW_TRUE;
|
||||||
if (getPixelFormatAttrib(window, n, WGL_DOUBLE_BUFFER_ARB))
|
if (getPixelFormatAttrib(window, n, WGL_DOUBLE_BUFFER_ARB))
|
||||||
u->doublebuffer = GL_TRUE;
|
u->doublebuffer = GLFW_TRUE;
|
||||||
|
|
||||||
if (window->wgl.ARB_multisample)
|
if (window->wgl.ARB_multisample)
|
||||||
u->samples = getPixelFormatAttrib(window, n, WGL_SAMPLES_ARB);
|
u->samples = getPixelFormatAttrib(window, n, WGL_SAMPLES_ARB);
|
||||||
@ -181,7 +181,7 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
|
|||||||
window->wgl.EXT_framebuffer_sRGB)
|
window->wgl.EXT_framebuffer_sRGB)
|
||||||
{
|
{
|
||||||
if (getPixelFormatAttrib(window, n, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB))
|
if (getPixelFormatAttrib(window, n, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB))
|
||||||
u->sRGB = GL_TRUE;
|
u->sRGB = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -229,9 +229,9 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
|
|||||||
u->auxBuffers = pfd.cAuxBuffers;
|
u->auxBuffers = pfd.cAuxBuffers;
|
||||||
|
|
||||||
if (pfd.dwFlags & PFD_STEREO)
|
if (pfd.dwFlags & PFD_STEREO)
|
||||||
u->stereo = GL_TRUE;
|
u->stereo = GLFW_TRUE;
|
||||||
if (pfd.dwFlags & PFD_DOUBLEBUFFER)
|
if (pfd.dwFlags & PFD_DOUBLEBUFFER)
|
||||||
u->doublebuffer = GL_TRUE;
|
u->doublebuffer = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
u->wgl = n;
|
u->wgl = n;
|
||||||
@ -244,7 +244,7 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
|
|||||||
"WGL: The driver does not appear to support OpenGL");
|
"WGL: The driver does not appear to support OpenGL");
|
||||||
|
|
||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
|
closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
|
||||||
@ -254,13 +254,13 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
|
|||||||
"WGL: Failed to find a suitable pixel format");
|
"WGL: Failed to find a suitable pixel format");
|
||||||
|
|
||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
*result = closest->wgl;
|
*result = closest->wgl;
|
||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -273,13 +273,13 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
|
|||||||
int _glfwInitContextAPI(void)
|
int _glfwInitContextAPI(void)
|
||||||
{
|
{
|
||||||
if (!_glfwCreateContextTLS())
|
if (!_glfwCreateContextTLS())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
_glfw.wgl.opengl32.instance = LoadLibraryW(L"opengl32.dll");
|
_glfw.wgl.opengl32.instance = LoadLibraryW(L"opengl32.dll");
|
||||||
if (!_glfw.wgl.opengl32.instance)
|
if (!_glfw.wgl.opengl32.instance)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR, "WGL: Failed to load opengl32.dll");
|
_glfwInputError(GLFW_PLATFORM_ERROR, "WGL: Failed to load opengl32.dll");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.wgl.opengl32.CreateContext = (WGLCREATECONTEXT_T)
|
_glfw.wgl.opengl32.CreateContext = (WGLCREATECONTEXT_T)
|
||||||
@ -301,10 +301,10 @@ int _glfwInitContextAPI(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"WGL: Failed to load opengl32 functions");
|
"WGL: Failed to load opengl32 functions");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Terminate WGL
|
// Terminate WGL
|
||||||
@ -343,24 +343,24 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"WGL: Failed to retrieve DC for window");
|
"WGL: Failed to retrieve DC for window");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!choosePixelFormat(window, fbconfig, &pixelFormat))
|
if (!choosePixelFormat(window, fbconfig, &pixelFormat))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (!DescribePixelFormat(window->wgl.dc, pixelFormat, sizeof(pfd), &pfd))
|
if (!DescribePixelFormat(window->wgl.dc, pixelFormat, sizeof(pfd), &pfd))
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"WGL: Failed to retrieve PFD for selected pixel format");
|
"WGL: Failed to retrieve PFD for selected pixel format");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SetPixelFormat(window->wgl.dc, pixelFormat, &pfd))
|
if (!SetPixelFormat(window->wgl.dc, pixelFormat, &pfd))
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"WGL: Failed to set selected pixel format");
|
"WGL: Failed to set selected pixel format");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->wgl.ARB_create_context)
|
if (window->wgl.ARB_create_context)
|
||||||
@ -443,7 +443,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"WGL: Failed to create OpenGL context");
|
"WGL: Failed to create OpenGL context");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -453,7 +453,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
|
||||||
"WGL: Failed to create OpenGL context");
|
"WGL: Failed to create OpenGL context");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (share)
|
if (share)
|
||||||
@ -462,7 +462,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"WGL: Failed to enable sharing with specified OpenGL context");
|
"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);
|
_glfwPlatformMakeContextCurrent(window);
|
||||||
initWGLExtensions(window);
|
initWGLExtensions(window);
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef setWGLattrib
|
#undef setWGLattrib
|
||||||
@ -498,7 +498,7 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
|
|||||||
const _GLFWctxconfig* ctxconfig,
|
const _GLFWctxconfig* ctxconfig,
|
||||||
const _GLFWfbconfig* fbconfig)
|
const _GLFWfbconfig* fbconfig)
|
||||||
{
|
{
|
||||||
GLboolean required = GL_FALSE;
|
GLFWbool required = GLFW_FALSE;
|
||||||
|
|
||||||
if (ctxconfig->api == GLFW_OPENGL_API)
|
if (ctxconfig->api == GLFW_OPENGL_API)
|
||||||
{
|
{
|
||||||
@ -511,7 +511,7 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
|
|||||||
return _GLFW_RECREATION_IMPOSSIBLE;
|
return _GLFW_RECREATION_IMPOSSIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
required = GL_TRUE;
|
required = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->profile)
|
if (ctxconfig->profile)
|
||||||
@ -523,13 +523,13 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
|
|||||||
return _GLFW_RECREATION_IMPOSSIBLE;
|
return _GLFW_RECREATION_IMPOSSIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
required = GL_TRUE;
|
required = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->release)
|
if (ctxconfig->release)
|
||||||
{
|
{
|
||||||
if (window->wgl.ARB_context_flush_control)
|
if (window->wgl.ARB_context_flush_control)
|
||||||
required = GL_TRUE;
|
required = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -543,26 +543,26 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
|
|||||||
return _GLFW_RECREATION_IMPOSSIBLE;
|
return _GLFW_RECREATION_IMPOSSIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
required = GL_TRUE;
|
required = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->major != 1 || ctxconfig->minor != 0)
|
if (ctxconfig->major != 1 || ctxconfig->minor != 0)
|
||||||
{
|
{
|
||||||
if (window->wgl.ARB_create_context)
|
if (window->wgl.ARB_create_context)
|
||||||
required = GL_TRUE;
|
required = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->debug)
|
if (ctxconfig->debug)
|
||||||
{
|
{
|
||||||
if (window->wgl.ARB_create_context)
|
if (window->wgl.ARB_create_context)
|
||||||
required = GL_TRUE;
|
required = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fbconfig->samples > 0)
|
if (fbconfig->samples > 0)
|
||||||
{
|
{
|
||||||
// MSAA is not a hard constraint, so do nothing if it's not supported
|
// MSAA is not a hard constraint, so do nothing if it's not supported
|
||||||
if (window->wgl.ARB_multisample && window->wgl.ARB_pixel_format)
|
if (window->wgl.ARB_multisample && window->wgl.ARB_pixel_format)
|
||||||
required = GL_TRUE;
|
required = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fbconfig->sRGB)
|
if (fbconfig->sRGB)
|
||||||
@ -572,7 +572,7 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
|
|||||||
window->wgl.EXT_framebuffer_sRGB) &&
|
window->wgl.EXT_framebuffer_sRGB) &&
|
||||||
window->wgl.ARB_pixel_format)
|
window->wgl.ARB_pixel_format)
|
||||||
{
|
{
|
||||||
required = GL_TRUE;
|
required = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -637,7 +637,7 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
|||||||
if (extensions)
|
if (extensions)
|
||||||
{
|
{
|
||||||
if (_glfwStringInExtensionString(extension, extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -647,11 +647,11 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
|||||||
if (extensions)
|
if (extensions)
|
||||||
{
|
{
|
||||||
if (_glfwStringInExtensionString(extension, extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||||
|
@ -64,16 +64,16 @@ typedef struct _GLFWcontextWGL
|
|||||||
PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT;
|
PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT;
|
||||||
PFNWGLGETEXTENSIONSSTRINGARBPROC GetExtensionsStringARB;
|
PFNWGLGETEXTENSIONSSTRINGARBPROC GetExtensionsStringARB;
|
||||||
PFNWGLCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
|
PFNWGLCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
|
||||||
GLboolean EXT_swap_control;
|
GLFWbool EXT_swap_control;
|
||||||
GLboolean ARB_multisample;
|
GLFWbool ARB_multisample;
|
||||||
GLboolean ARB_framebuffer_sRGB;
|
GLFWbool ARB_framebuffer_sRGB;
|
||||||
GLboolean EXT_framebuffer_sRGB;
|
GLFWbool EXT_framebuffer_sRGB;
|
||||||
GLboolean ARB_pixel_format;
|
GLFWbool ARB_pixel_format;
|
||||||
GLboolean ARB_create_context;
|
GLFWbool ARB_create_context;
|
||||||
GLboolean ARB_create_context_profile;
|
GLFWbool ARB_create_context_profile;
|
||||||
GLboolean EXT_create_context_es2_profile;
|
GLFWbool EXT_create_context_es2_profile;
|
||||||
GLboolean ARB_create_context_robustness;
|
GLFWbool ARB_create_context_robustness;
|
||||||
GLboolean ARB_context_flush_control;
|
GLFWbool ARB_context_flush_control;
|
||||||
|
|
||||||
} _GLFWcontextWGL;
|
} _GLFWcontextWGL;
|
||||||
|
|
||||||
|
@ -60,14 +60,14 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
|
|||||||
|
|
||||||
// Load necessary libraries (DLLs)
|
// Load necessary libraries (DLLs)
|
||||||
//
|
//
|
||||||
static GLboolean initLibraries(void)
|
static GLFWbool initLibraries(void)
|
||||||
{
|
{
|
||||||
_glfw.win32.winmm.instance = LoadLibraryW(L"winmm.dll");
|
_glfw.win32.winmm.instance = LoadLibraryW(L"winmm.dll");
|
||||||
if (!_glfw.win32.winmm.instance)
|
if (!_glfw.win32.winmm.instance)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Win32: Failed to load winmm.dll");
|
"Win32: Failed to load winmm.dll");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.win32.winmm.joyGetDevCaps = (JOYGETDEVCAPS_T)
|
_glfw.win32.winmm.joyGetDevCaps = (JOYGETDEVCAPS_T)
|
||||||
@ -86,7 +86,7 @@ static GLboolean initLibraries(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Win32: Failed to load winmm functions");
|
"Win32: Failed to load winmm functions");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.win32.user32.instance = LoadLibraryW(L"user32.dll");
|
_glfw.win32.user32.instance = LoadLibraryW(L"user32.dll");
|
||||||
@ -107,7 +107,7 @@ static GLboolean initLibraries(void)
|
|||||||
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmFlush");
|
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmFlush");
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unload used libraries (DLLs)
|
// Unload used libraries (DLLs)
|
||||||
@ -332,7 +332,7 @@ int _glfwPlatformInit(void)
|
|||||||
SPIF_SENDCHANGE);
|
SPIF_SENDCHANGE);
|
||||||
|
|
||||||
if (!initLibraries())
|
if (!initLibraries())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
createKeyTables();
|
createKeyTables();
|
||||||
|
|
||||||
@ -340,15 +340,15 @@ int _glfwPlatformInit(void)
|
|||||||
_glfw_SetProcessDPIAware();
|
_glfw_SetProcessDPIAware();
|
||||||
|
|
||||||
if (!_glfwRegisterWindowClass())
|
if (!_glfwRegisterWindowClass())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (!_glfwInitContextAPI())
|
if (!_glfwInitContextAPI())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
_glfwInitTimer();
|
_glfwInitTimer();
|
||||||
_glfwInitJoysticks();
|
_glfwInitJoysticks();
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformTerminate(void)
|
void _glfwPlatformTerminate(void)
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
// Change the current video mode
|
// Change the current video mode
|
||||||
//
|
//
|
||||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
||||||
{
|
{
|
||||||
GLFWvidmode current;
|
GLFWvidmode current;
|
||||||
const GLFWvidmode* best;
|
const GLFWvidmode* best;
|
||||||
@ -56,7 +56,7 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
|||||||
best = _glfwChooseVideoMode(monitor, desired);
|
best = _glfwChooseVideoMode(monitor, desired);
|
||||||
_glfwPlatformGetVideoMode(monitor, ¤t);
|
_glfwPlatformGetVideoMode(monitor, ¤t);
|
||||||
if (_glfwCompareVideoModes(¤t, best) == 0)
|
if (_glfwCompareVideoModes(¤t, best) == 0)
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
|
|
||||||
ZeroMemory(&dm, sizeof(dm));
|
ZeroMemory(&dm, sizeof(dm));
|
||||||
dm.dmSize = sizeof(DEVMODEW);
|
dm.dmSize = sizeof(DEVMODEW);
|
||||||
@ -77,11 +77,11 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
|||||||
NULL) != DISP_CHANGE_SUCCESSFUL)
|
NULL) != DISP_CHANGE_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to set video mode");
|
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to set video mode");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor->win32.modeChanged = GL_TRUE;
|
monitor->win32.modeChanged = GLFW_TRUE;
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore the previously saved (original) video mode
|
// Restore the previously saved (original) video mode
|
||||||
@ -92,7 +92,7 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
|||||||
{
|
{
|
||||||
ChangeDisplaySettingsExW(monitor->win32.adapterName,
|
ChangeDisplaySettingsExW(monitor->win32.adapterName,
|
||||||
NULL, NULL, CDS_FULLSCREEN, NULL);
|
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);
|
free(name);
|
||||||
|
|
||||||
if (adapter.StateFlags & DISPLAY_DEVICE_MODESPRUNED)
|
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.adapterName, adapter.DeviceName);
|
||||||
wcscpy(monitor->win32.displayName, display.DeviceName);
|
wcscpy(monitor->win32.displayName, display.DeviceName);
|
||||||
@ -186,7 +186,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
return monitors;
|
return monitors;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
||||||
{
|
{
|
||||||
return wcscmp(first->win32.displayName, second->win32.displayName) == 0;
|
return wcscmp(first->win32.displayName, second->win32.displayName) == 0;
|
||||||
}
|
}
|
||||||
|
@ -151,8 +151,8 @@ typedef struct _GLFWwindowWin32
|
|||||||
{
|
{
|
||||||
HWND handle;
|
HWND handle;
|
||||||
|
|
||||||
GLboolean cursorTracked;
|
GLFWbool cursorTracked;
|
||||||
GLboolean iconified;
|
GLFWbool iconified;
|
||||||
|
|
||||||
// The last received cursor position, regardless of source
|
// The last received cursor position, regardless of source
|
||||||
int cursorPosX, cursorPosY;
|
int cursorPosX, cursorPosY;
|
||||||
@ -203,8 +203,8 @@ typedef struct _GLFWmonitorWin32
|
|||||||
WCHAR displayName[32];
|
WCHAR displayName[32];
|
||||||
char publicAdapterName[64];
|
char publicAdapterName[64];
|
||||||
char publicDisplayName[64];
|
char publicDisplayName[64];
|
||||||
GLboolean modesPruned;
|
GLFWbool modesPruned;
|
||||||
GLboolean modeChanged;
|
GLFWbool modeChanged;
|
||||||
|
|
||||||
} _GLFWmonitorWin32;
|
} _GLFWmonitorWin32;
|
||||||
|
|
||||||
@ -222,14 +222,14 @@ typedef struct _GLFWcursorWin32
|
|||||||
//
|
//
|
||||||
typedef struct _GLFWtimeWin32
|
typedef struct _GLFWtimeWin32
|
||||||
{
|
{
|
||||||
GLboolean hasPC;
|
GLFWbool hasPC;
|
||||||
double resolution;
|
double resolution;
|
||||||
unsigned __int64 base;
|
unsigned __int64 base;
|
||||||
|
|
||||||
} _GLFWtimeWin32;
|
} _GLFWtimeWin32;
|
||||||
|
|
||||||
|
|
||||||
GLboolean _glfwRegisterWindowClass(void);
|
GLFWbool _glfwRegisterWindowClass(void);
|
||||||
void _glfwUnregisterWindowClass(void);
|
void _glfwUnregisterWindowClass(void);
|
||||||
|
|
||||||
BOOL _glfwIsCompositionEnabled(void);
|
BOOL _glfwIsCompositionEnabled(void);
|
||||||
@ -239,7 +239,7 @@ char* _glfwCreateUTF8FromWideString(const WCHAR* source);
|
|||||||
|
|
||||||
void _glfwInitTimer(void);
|
void _glfwInitTimer(void);
|
||||||
|
|
||||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
||||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
||||||
|
|
||||||
#endif // _glfw3_win32_platform_h_
|
#endif // _glfw3_win32_platform_h_
|
||||||
|
@ -55,12 +55,12 @@ void _glfwInitTimer(void)
|
|||||||
|
|
||||||
if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency))
|
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;
|
_glfw.win32_time.resolution = 1.0 / (double) frequency;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_glfw.win32_time.hasPC = GL_FALSE;
|
_glfw.win32_time.hasPC = GLFW_FALSE;
|
||||||
_glfw.win32_time.resolution = 0.001; // winmm resolution is 1 ms
|
_glfw.win32_time.resolution = 0.001; // winmm resolution is 1 ms
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ int _glfwCreateContextTLS(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Win32: Failed to allocate TLS index");
|
"Win32: Failed to allocate TLS index");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.win32_tls.allocated = GL_TRUE;
|
_glfw.win32_tls.allocated = GLFW_TRUE;
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwDestroyContextTLS(void)
|
void _glfwDestroyContextTLS(void)
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
//
|
//
|
||||||
typedef struct _GLFWtlsWin32
|
typedef struct _GLFWtlsWin32
|
||||||
{
|
{
|
||||||
GLboolean allocated;
|
GLFWbool allocated;
|
||||||
DWORD context;
|
DWORD context;
|
||||||
|
|
||||||
} _GLFWtlsWin32;
|
} _GLFWtlsWin32;
|
||||||
|
@ -185,10 +185,10 @@ static int translateKey(WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
// Enter full screen mode
|
// Enter full screen mode
|
||||||
//
|
//
|
||||||
static GLboolean enterFullscreenMode(_GLFWwindow* window)
|
static GLFWbool enterFullscreenMode(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
GLFWvidmode mode;
|
GLFWvidmode mode;
|
||||||
GLboolean status;
|
GLFWbool status;
|
||||||
int xpos, ypos;
|
int xpos, ypos;
|
||||||
|
|
||||||
status = _glfwSetVideoMode(window->monitor, &window->videoMode);
|
status = _glfwSetVideoMode(window->monitor, &window->videoMode);
|
||||||
@ -230,7 +230,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||||
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED);
|
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED);
|
||||||
|
|
||||||
_glfwInputWindowFocus(window, GL_TRUE);
|
_glfwInputWindowFocus(window, GLFW_TRUE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
if (window->monitor && window->autoIconify)
|
if (window->monitor && window->autoIconify)
|
||||||
_glfwPlatformIconifyWindow(window);
|
_glfwPlatformIconifyWindow(window);
|
||||||
|
|
||||||
_glfwInputWindowFocus(window, GL_FALSE);
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,13 +290,13 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
|
|
||||||
case WM_CHAR:
|
case WM_CHAR:
|
||||||
{
|
{
|
||||||
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_TRUE);
|
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_TRUE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_SYSCHAR:
|
case WM_SYSCHAR:
|
||||||
{
|
{
|
||||||
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_FALSE);
|
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_FALSE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_TRUE);
|
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_TRUE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,8 +428,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
tme.hwndTrack = window->win32.handle;
|
tme.hwndTrack = window->win32.handle;
|
||||||
TrackMouseEvent(&tme);
|
TrackMouseEvent(&tme);
|
||||||
|
|
||||||
window->win32.cursorTracked = GL_TRUE;
|
window->win32.cursorTracked = GLFW_TRUE;
|
||||||
_glfwInputCursorEnter(window, GL_TRUE);
|
_glfwInputCursorEnter(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -437,8 +437,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
|
|
||||||
case WM_MOUSELEAVE:
|
case WM_MOUSELEAVE:
|
||||||
{
|
{
|
||||||
window->win32.cursorTracked = GL_FALSE;
|
window->win32.cursorTracked = GLFW_FALSE;
|
||||||
_glfwInputCursorEnter(window, GL_FALSE);
|
_glfwInputCursorEnter(window, GLFW_FALSE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,20 +466,20 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
|
|
||||||
if (!window->win32.iconified && wParam == SIZE_MINIMIZED)
|
if (!window->win32.iconified && wParam == SIZE_MINIMIZED)
|
||||||
{
|
{
|
||||||
window->win32.iconified = GL_TRUE;
|
window->win32.iconified = GLFW_TRUE;
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
leaveFullscreenMode(window);
|
leaveFullscreenMode(window);
|
||||||
|
|
||||||
_glfwInputWindowIconify(window, GL_TRUE);
|
_glfwInputWindowIconify(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
else if (window->win32.iconified &&
|
else if (window->win32.iconified &&
|
||||||
(wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED))
|
(wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED))
|
||||||
{
|
{
|
||||||
window->win32.iconified = GL_FALSE;
|
window->win32.iconified = GLFW_FALSE;
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
enterFullscreenMode(window);
|
enterFullscreenMode(window);
|
||||||
|
|
||||||
_glfwInputWindowIconify(window, GL_FALSE);
|
_glfwInputWindowIconify(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam));
|
_glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam));
|
||||||
@ -597,10 +597,10 @@ static void getFullWindowSize(_GLFWwindow* window,
|
|||||||
|
|
||||||
// Creates the GLFW window and rendering context
|
// Creates the GLFW window and rendering context
|
||||||
//
|
//
|
||||||
static int createWindow(_GLFWwindow* window,
|
static GLFWbool createWindow(_GLFWwindow* window,
|
||||||
const _GLFWwndconfig* wndconfig,
|
const _GLFWwndconfig* wndconfig,
|
||||||
const _GLFWctxconfig* ctxconfig,
|
const _GLFWctxconfig* ctxconfig,
|
||||||
const _GLFWfbconfig* fbconfig)
|
const _GLFWfbconfig* fbconfig)
|
||||||
{
|
{
|
||||||
int xpos, ypos, fullWidth, fullHeight;
|
int xpos, ypos, fullWidth, fullHeight;
|
||||||
WCHAR* wideTitle;
|
WCHAR* wideTitle;
|
||||||
@ -632,7 +632,7 @@ static int createWindow(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Win32: Failed to convert window title to UTF-16");
|
"Win32: Failed to convert window title to UTF-16");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
window->win32.handle = CreateWindowExW(getWindowExStyle(window),
|
window->win32.handle = CreateWindowExW(getWindowExStyle(window),
|
||||||
@ -651,7 +651,7 @@ static int createWindow(_GLFWwindow* window,
|
|||||||
if (!window->win32.handle)
|
if (!window->win32.handle)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to create window");
|
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to create window");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfw_ChangeWindowMessageFilterEx)
|
if (_glfw_ChangeWindowMessageFilterEx)
|
||||||
@ -675,9 +675,9 @@ static int createWindow(_GLFWwindow* window,
|
|||||||
DragAcceptFiles(window->win32.handle, TRUE);
|
DragAcceptFiles(window->win32.handle, TRUE);
|
||||||
|
|
||||||
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destroys the GLFW window and rendering context
|
// Destroys the GLFW window and rendering context
|
||||||
@ -700,7 +700,7 @@ static void destroyWindow(_GLFWwindow* window)
|
|||||||
|
|
||||||
// Registers the GLFW window class
|
// Registers the GLFW window class
|
||||||
//
|
//
|
||||||
GLboolean _glfwRegisterWindowClass(void)
|
GLFWbool _glfwRegisterWindowClass(void)
|
||||||
{
|
{
|
||||||
WNDCLASSW wc;
|
WNDCLASSW wc;
|
||||||
|
|
||||||
@ -726,10 +726,10 @@ GLboolean _glfwRegisterWindowClass(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Win32: Failed to register window class");
|
"Win32: Failed to register window class");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unregisters the GLFW window class
|
// Unregisters the GLFW window class
|
||||||
@ -752,12 +752,12 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (!createWindow(window, wndconfig, ctxconfig, fbconfig))
|
if (!createWindow(window, wndconfig, ctxconfig, fbconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
status = _glfwAnalyzeContext(window, ctxconfig, fbconfig);
|
status = _glfwAnalyzeContext(window, ctxconfig, fbconfig);
|
||||||
|
|
||||||
if (status == _GLFW_RECREATION_IMPOSSIBLE)
|
if (status == _GLFW_RECREATION_IMPOSSIBLE)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (status == _GLFW_RECREATION_REQUIRED)
|
if (status == _GLFW_RECREATION_REQUIRED)
|
||||||
{
|
{
|
||||||
@ -787,17 +787,17 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
|
|
||||||
// ...and then create them again, this time with better APIs
|
// ...and then create them again, this time with better APIs
|
||||||
if (!createWindow(window, wndconfig, ctxconfig, fbconfig))
|
if (!createWindow(window, wndconfig, ctxconfig, fbconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
{
|
{
|
||||||
_glfwPlatformShowWindow(window);
|
_glfwPlatformShowWindow(window);
|
||||||
if (!enterFullscreenMode(window))
|
if (!enterFullscreenMode(window))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||||
@ -1099,13 +1099,13 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
ReleaseDC(NULL, dc);
|
ReleaseDC(NULL, dc);
|
||||||
|
|
||||||
if (!bitmap)
|
if (!bitmap)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
mask = CreateBitmap(image->width, image->height, 1, 1, NULL);
|
mask = CreateBitmap(image->width, image->height, 1, 1, NULL);
|
||||||
if (!mask)
|
if (!mask)
|
||||||
{
|
{
|
||||||
DeleteObject(bitmap);
|
DeleteObject(bitmap);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < image->width * image->height; i++, target++, source += 4)
|
for (i = 0; i < image->width * image->height; i++, target++, source += 4)
|
||||||
@ -1129,9 +1129,9 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
DeleteObject(mask);
|
DeleteObject(mask);
|
||||||
|
|
||||||
if (!cursor->win32.handle)
|
if (!cursor->win32.handle)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
||||||
@ -1142,10 +1142,10 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Win32: Failed to create standard cursor");
|
"Win32: Failed to create standard cursor");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
||||||
|
44
src/window.c
44
src/window.c
@ -36,7 +36,7 @@
|
|||||||
////// GLFW event API //////
|
////// GLFW event API //////
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused)
|
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused)
|
||||||
{
|
{
|
||||||
if (focused)
|
if (focused)
|
||||||
{
|
{
|
||||||
@ -102,7 +102,7 @@ void _glfwInputWindowDamage(_GLFWwindow* window)
|
|||||||
|
|
||||||
void _glfwInputWindowCloseRequest(_GLFWwindow* window)
|
void _glfwInputWindowCloseRequest(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
window->closed = GL_TRUE;
|
window->closed = GLFW_TRUE;
|
||||||
|
|
||||||
if (window->callbacks.close)
|
if (window->callbacks.close)
|
||||||
window->callbacks.close((GLFWwindow*) window);
|
window->callbacks.close((GLFWwindow*) window);
|
||||||
@ -144,9 +144,9 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
|||||||
|
|
||||||
if (wndconfig.monitor)
|
if (wndconfig.monitor)
|
||||||
{
|
{
|
||||||
wndconfig.resizable = GL_TRUE;
|
wndconfig.resizable = GLFW_TRUE;
|
||||||
wndconfig.visible = GL_TRUE;
|
wndconfig.visible = GLFW_TRUE;
|
||||||
wndconfig.focused = GL_TRUE;
|
wndconfig.focused = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the OpenGL bits of the window config
|
// Check the OpenGL bits of the window config
|
||||||
@ -244,11 +244,11 @@ void glfwDefaultWindowHints(void)
|
|||||||
_glfw.hints.context.minor = 0;
|
_glfw.hints.context.minor = 0;
|
||||||
|
|
||||||
// The default is a focused, visible, resizable window with decorations
|
// The default is a focused, visible, resizable window with decorations
|
||||||
_glfw.hints.window.resizable = GL_TRUE;
|
_glfw.hints.window.resizable = GLFW_TRUE;
|
||||||
_glfw.hints.window.visible = GL_TRUE;
|
_glfw.hints.window.visible = GLFW_TRUE;
|
||||||
_glfw.hints.window.decorated = GL_TRUE;
|
_glfw.hints.window.decorated = GLFW_TRUE;
|
||||||
_glfw.hints.window.focused = GL_TRUE;
|
_glfw.hints.window.focused = GLFW_TRUE;
|
||||||
_glfw.hints.window.autoIconify = GL_TRUE;
|
_glfw.hints.window.autoIconify = GLFW_TRUE;
|
||||||
|
|
||||||
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil,
|
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil,
|
||||||
// double buffered
|
// double buffered
|
||||||
@ -258,7 +258,7 @@ void glfwDefaultWindowHints(void)
|
|||||||
_glfw.hints.framebuffer.alphaBits = 8;
|
_glfw.hints.framebuffer.alphaBits = 8;
|
||||||
_glfw.hints.framebuffer.depthBits = 24;
|
_glfw.hints.framebuffer.depthBits = 24;
|
||||||
_glfw.hints.framebuffer.stencilBits = 8;
|
_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
|
// The default is to select the highest available refresh rate
|
||||||
_glfw.hints.refreshRate = GLFW_DONT_CARE;
|
_glfw.hints.refreshRate = GLFW_DONT_CARE;
|
||||||
@ -304,34 +304,34 @@ GLFWAPI void glfwWindowHint(int target, int hint)
|
|||||||
_glfw.hints.framebuffer.auxBuffers = hint;
|
_glfw.hints.framebuffer.auxBuffers = hint;
|
||||||
break;
|
break;
|
||||||
case GLFW_STEREO:
|
case GLFW_STEREO:
|
||||||
_glfw.hints.framebuffer.stereo = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.framebuffer.stereo = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_DOUBLEBUFFER:
|
case GLFW_DOUBLEBUFFER:
|
||||||
_glfw.hints.framebuffer.doublebuffer = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.framebuffer.doublebuffer = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_SAMPLES:
|
case GLFW_SAMPLES:
|
||||||
_glfw.hints.framebuffer.samples = hint;
|
_glfw.hints.framebuffer.samples = hint;
|
||||||
break;
|
break;
|
||||||
case GLFW_SRGB_CAPABLE:
|
case GLFW_SRGB_CAPABLE:
|
||||||
_glfw.hints.framebuffer.sRGB = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.framebuffer.sRGB = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_RESIZABLE:
|
case GLFW_RESIZABLE:
|
||||||
_glfw.hints.window.resizable = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.window.resizable = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_DECORATED:
|
case GLFW_DECORATED:
|
||||||
_glfw.hints.window.decorated = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.window.decorated = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_FOCUSED:
|
case GLFW_FOCUSED:
|
||||||
_glfw.hints.window.focused = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.window.focused = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_AUTO_ICONIFY:
|
case GLFW_AUTO_ICONIFY:
|
||||||
_glfw.hints.window.autoIconify = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.window.autoIconify = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_FLOATING:
|
case GLFW_FLOATING:
|
||||||
_glfw.hints.window.floating = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.window.floating = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_VISIBLE:
|
case GLFW_VISIBLE:
|
||||||
_glfw.hints.window.visible = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.window.visible = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_CLIENT_API:
|
case GLFW_CLIENT_API:
|
||||||
_glfw.hints.context.api = hint;
|
_glfw.hints.context.api = hint;
|
||||||
@ -346,10 +346,10 @@ GLFWAPI void glfwWindowHint(int target, int hint)
|
|||||||
_glfw.hints.context.robustness = hint;
|
_glfw.hints.context.robustness = hint;
|
||||||
break;
|
break;
|
||||||
case GLFW_OPENGL_FORWARD_COMPAT:
|
case GLFW_OPENGL_FORWARD_COMPAT:
|
||||||
_glfw.hints.context.forward = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.context.forward = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_OPENGL_DEBUG_CONTEXT:
|
case GLFW_OPENGL_DEBUG_CONTEXT:
|
||||||
_glfw.hints.context.debug = hint ? GL_TRUE : GL_FALSE;
|
_glfw.hints.context.debug = hint ? GLFW_TRUE : GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
case GLFW_OPENGL_PROFILE:
|
case GLFW_OPENGL_PROFILE:
|
||||||
_glfw.hints.context.profile = hint;
|
_glfw.hints.context.profile = hint;
|
||||||
|
@ -76,9 +76,9 @@ int _glfwPlatformJoystickPresent(int joy)
|
|||||||
JOYINFO ji;
|
JOYINFO ji;
|
||||||
|
|
||||||
if (_glfw_joyGetPos(joy, &ji) != JOYERR_NOERROR)
|
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)
|
const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
|
||||||
|
@ -49,7 +49,7 @@ static void pointerHandleEnter(void* data,
|
|||||||
_glfw.wl.pointerFocus = window;
|
_glfw.wl.pointerFocus = window;
|
||||||
|
|
||||||
_glfwPlatformSetCursor(window, window->wl.currentCursor);
|
_glfwPlatformSetCursor(window, window->wl.currentCursor);
|
||||||
_glfwInputCursorEnter(window, GL_TRUE);
|
_glfwInputCursorEnter(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pointerHandleLeave(void* data,
|
static void pointerHandleLeave(void* data,
|
||||||
@ -64,7 +64,7 @@ static void pointerHandleLeave(void* data,
|
|||||||
|
|
||||||
_glfw.wl.pointerSerial = serial;
|
_glfw.wl.pointerSerial = serial;
|
||||||
_glfw.wl.pointerFocus = NULL;
|
_glfw.wl.pointerFocus = NULL;
|
||||||
_glfwInputCursorEnter(window, GL_FALSE);
|
_glfwInputCursorEnter(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pointerHandleMotion(void* data,
|
static void pointerHandleMotion(void* data,
|
||||||
@ -233,7 +233,7 @@ static void keyboardHandleEnter(void* data,
|
|||||||
_GLFWwindow* window = wl_surface_get_user_data(surface);
|
_GLFWwindow* window = wl_surface_get_user_data(surface);
|
||||||
|
|
||||||
_glfw.wl.keyboardFocus = window;
|
_glfw.wl.keyboardFocus = window;
|
||||||
_glfwInputWindowFocus(window, GL_TRUE);
|
_glfwInputWindowFocus(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keyboardHandleLeave(void* data,
|
static void keyboardHandleLeave(void* data,
|
||||||
@ -247,7 +247,7 @@ static void keyboardHandleLeave(void* data,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_glfw.wl.keyboardFocus = NULL;
|
_glfw.wl.keyboardFocus = NULL;
|
||||||
_glfwInputWindowFocus(window, GL_FALSE);
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int toGLFWKeyCode(uint32_t key)
|
static int toGLFWKeyCode(uint32_t key)
|
||||||
@ -548,7 +548,7 @@ int _glfwPlatformInit(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Failed to connect to display");
|
"Wayland: Failed to connect to display");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.wl.registry = wl_display_get_registry(_glfw.wl.display);
|
_glfw.wl.registry = wl_display_get_registry(_glfw.wl.display);
|
||||||
@ -562,7 +562,7 @@ int _glfwPlatformInit(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Failed to initialize xkb context");
|
"Wayland: Failed to initialize xkb context");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sync so we got all registry objects
|
// Sync so we got all registry objects
|
||||||
@ -572,7 +572,7 @@ int _glfwPlatformInit(void)
|
|||||||
wl_display_roundtrip(_glfw.wl.display);
|
wl_display_roundtrip(_glfw.wl.display);
|
||||||
|
|
||||||
if (!_glfwInitContextAPI())
|
if (!_glfwInitContextAPI())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
_glfwInitTimer();
|
_glfwInitTimer();
|
||||||
_glfwInitJoysticks();
|
_glfwInitJoysticks();
|
||||||
@ -584,7 +584,7 @@ int _glfwPlatformInit(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Unable to load default cursor theme\n");
|
"Wayland: Unable to load default cursor theme\n");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
_glfw.wl.defaultCursor =
|
_glfw.wl.defaultCursor =
|
||||||
wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, "left_ptr");
|
wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, "left_ptr");
|
||||||
@ -592,13 +592,13 @@ int _glfwPlatformInit(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Unable to load default left pointer\n");
|
"Wayland: Unable to load default left pointer\n");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
_glfw.wl.cursorSurface =
|
_glfw.wl.cursorSurface =
|
||||||
wl_compositor_create_surface(_glfw.wl.compositor);
|
wl_compositor_create_surface(_glfw.wl.compositor);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformTerminate(void)
|
void _glfwPlatformTerminate(void)
|
||||||
|
@ -90,7 +90,7 @@ static void done(void* data,
|
|||||||
{
|
{
|
||||||
struct _GLFWmonitor *monitor = data;
|
struct _GLFWmonitor *monitor = data;
|
||||||
|
|
||||||
monitor->wl.done = GL_TRUE;
|
monitor->wl.done = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scale(void* data,
|
static void scale(void* data,
|
||||||
@ -195,7 +195,7 @@ err:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
||||||
{
|
{
|
||||||
return first->wl.output == second->wl.output;
|
return first->wl.output == second->wl.output;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ typedef struct _GLFWvidmodeWayland _GLFWvidmodeWayland;
|
|||||||
typedef struct _GLFWwindowWayland
|
typedef struct _GLFWwindowWayland
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
GLboolean visible;
|
GLFWbool visible;
|
||||||
struct wl_surface* surface;
|
struct wl_surface* surface;
|
||||||
struct wl_egl_window* native;
|
struct wl_egl_window* native;
|
||||||
struct wl_shell_surface* shell_surface;
|
struct wl_shell_surface* shell_surface;
|
||||||
@ -118,7 +118,7 @@ typedef struct _GLFWmonitorWayland
|
|||||||
_GLFWvidmodeWayland* modes;
|
_GLFWvidmodeWayland* modes;
|
||||||
int modesCount;
|
int modesCount;
|
||||||
int modesSize;
|
int modesSize;
|
||||||
GLboolean done;
|
GLFWbool done;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
@ -72,12 +72,12 @@ static const struct wl_shell_surface_listener shellSurfaceListener = {
|
|||||||
handlePopupDone
|
handlePopupDone
|
||||||
};
|
};
|
||||||
|
|
||||||
static GLboolean createSurface(_GLFWwindow* window,
|
static GLFWbool createSurface(_GLFWwindow* window,
|
||||||
const _GLFWwndconfig* wndconfig)
|
const _GLFWwndconfig* wndconfig)
|
||||||
{
|
{
|
||||||
window->wl.surface = wl_compositor_create_surface(_glfw.wl.compositor);
|
window->wl.surface = wl_compositor_create_surface(_glfw.wl.compositor);
|
||||||
if (!window->wl.surface)
|
if (!window->wl.surface)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
wl_surface_set_user_data(window->wl.surface, window);
|
wl_surface_set_user_data(window->wl.surface, window);
|
||||||
|
|
||||||
@ -85,12 +85,12 @@ static GLboolean createSurface(_GLFWwindow* window,
|
|||||||
wndconfig->width,
|
wndconfig->width,
|
||||||
wndconfig->height);
|
wndconfig->height);
|
||||||
if (!window->wl.native)
|
if (!window->wl.native)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
window->wl.shell_surface = wl_shell_get_shell_surface(_glfw.wl.shell,
|
window->wl.shell_surface = wl_shell_get_shell_surface(_glfw.wl.shell,
|
||||||
window->wl.surface);
|
window->wl.surface);
|
||||||
if (!window->wl.shell_surface)
|
if (!window->wl.shell_surface)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
wl_shell_surface_add_listener(window->wl.shell_surface,
|
wl_shell_surface_add_listener(window->wl.shell_surface,
|
||||||
&shellSurfaceListener,
|
&shellSurfaceListener,
|
||||||
@ -99,7 +99,7 @@ static GLboolean createSurface(_GLFWwindow* window,
|
|||||||
window->wl.width = wndconfig->width;
|
window->wl.width = wndconfig->width;
|
||||||
window->wl.height = wndconfig->height;
|
window->wl.height = wndconfig->height;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -217,10 +217,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
const _GLFWfbconfig* fbconfig)
|
const _GLFWfbconfig* fbconfig)
|
||||||
{
|
{
|
||||||
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (!createSurface(window, wndconfig))
|
if (!createSurface(window, wndconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (wndconfig->monitor)
|
if (wndconfig->monitor)
|
||||||
{
|
{
|
||||||
@ -237,7 +237,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
|
|
||||||
window->wl.currentCursor = NULL;
|
window->wl.currentCursor = NULL;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||||
@ -245,12 +245,12 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
|||||||
if (window == _glfw.wl.pointerFocus)
|
if (window == _glfw.wl.pointerFocus)
|
||||||
{
|
{
|
||||||
_glfw.wl.pointerFocus = NULL;
|
_glfw.wl.pointerFocus = NULL;
|
||||||
_glfwInputCursorEnter(window, GL_FALSE);
|
_glfwInputCursorEnter(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
if (window == _glfw.wl.keyboardFocus)
|
if (window == _glfw.wl.keyboardFocus)
|
||||||
{
|
{
|
||||||
_glfw.wl.keyboardFocus = NULL;
|
_glfw.wl.keyboardFocus = NULL;
|
||||||
_glfwInputWindowFocus(window, GL_FALSE);
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfwDestroyContext(window);
|
_glfwDestroyContext(window);
|
||||||
@ -347,19 +347,19 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
|
|||||||
int _glfwPlatformWindowFocused(_GLFWwindow* window)
|
int _glfwPlatformWindowFocused(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformWindowIconified(_GLFWwindow* window)
|
int _glfwPlatformWindowIconified(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformWindowVisible(_GLFWwindow* window)
|
int _glfwPlatformWindowVisible(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformPollEvents(void)
|
void _glfwPlatformPollEvents(void)
|
||||||
@ -413,7 +413,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Creating a buffer file for %d B failed: %m\n",
|
"Wayland: Creating a buffer file for %d B failed: %m\n",
|
||||||
length);
|
length);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
data = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||||
@ -422,7 +422,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Cursor mmap failed: %m\n");
|
"Wayland: Cursor mmap failed: %m\n");
|
||||||
close(fd);
|
close(fd);
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pool = wl_shm_create_pool(_glfw.wl.shm, fd, length);
|
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.height = image->height;
|
||||||
cursor->wl.xhot = xhot;
|
cursor->wl.xhot = xhot;
|
||||||
cursor->wl.yhot = yhot;
|
cursor->wl.yhot = yhot;
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
fprintf(stderr, "_glfwPlatformCreateStandardCursor not implemented yet\n");
|
fprintf(stderr, "_glfwPlatformCreateStandardCursor not implemented yet\n");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
||||||
|
@ -323,20 +323,20 @@ static void createKeyTables(void)
|
|||||||
|
|
||||||
// Check whether the IM has a usable style
|
// Check whether the IM has a usable style
|
||||||
//
|
//
|
||||||
static GLboolean hasUsableInputMethodStyle(void)
|
static GLFWbool hasUsableInputMethodStyle(void)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
GLboolean found = GL_FALSE;
|
GLFWbool found = GLFW_FALSE;
|
||||||
XIMStyles* styles = NULL;
|
XIMStyles* styles = NULL;
|
||||||
|
|
||||||
if (XGetIMValues(_glfw.x11.im, XNQueryInputStyle, &styles, NULL) != NULL)
|
if (XGetIMValues(_glfw.x11.im, XNQueryInputStyle, &styles, NULL) != NULL)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
for (i = 0; i < styles->count_styles; i++)
|
for (i = 0; i < styles->count_styles; i++)
|
||||||
{
|
{
|
||||||
if (styles->supported_styles[i] == (XIMPreeditNothing | XIMStatusNothing))
|
if (styles->supported_styles[i] == (XIMPreeditNothing | XIMStatusNothing))
|
||||||
{
|
{
|
||||||
found = GL_TRUE;
|
found = GLFW_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -463,7 +463,7 @@ static void detectEWMH(void)
|
|||||||
|
|
||||||
// Initialize X11 display and look for supported X11 extensions
|
// Initialize X11 display and look for supported X11 extensions
|
||||||
//
|
//
|
||||||
static GLboolean initExtensions(void)
|
static GLFWbool initExtensions(void)
|
||||||
{
|
{
|
||||||
// Find or create window manager atoms
|
// Find or create window manager atoms
|
||||||
_glfw.x11.WM_PROTOCOLS = XInternAtom(_glfw.x11.display,
|
_glfw.x11.WM_PROTOCOLS = XInternAtom(_glfw.x11.display,
|
||||||
@ -501,12 +501,12 @@ static GLboolean initExtensions(void)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"X11: Failed to query RandR version");
|
"X11: Failed to query RandR version");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The GLFW RandR path requires at least version 1.3
|
// The GLFW RandR path requires at least version 1.3
|
||||||
if (_glfw.x11.randr.major == 1 && _glfw.x11.randr.minor < 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);
|
sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ static GLboolean initExtensions(void)
|
|||||||
// available
|
// available
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"X11: RandR gamma ramp support seems broken");
|
"X11: RandR gamma ramp support seems broken");
|
||||||
_glfw.x11.randr.gammaBroken = GL_TRUE;
|
_glfw.x11.randr.gammaBroken = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
XRRFreeScreenResources(sr);
|
XRRFreeScreenResources(sr);
|
||||||
@ -529,7 +529,7 @@ static GLboolean initExtensions(void)
|
|||||||
&_glfw.x11.xinerama.minor))
|
&_glfw.x11.xinerama.minor))
|
||||||
{
|
{
|
||||||
if (XineramaIsActive(_glfw.x11.display))
|
if (XineramaIsActive(_glfw.x11.display))
|
||||||
_glfw.x11.xinerama.available = GL_TRUE;
|
_glfw.x11.xinerama.available = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_GLFW_HAS_XINPUT)
|
#if defined(_GLFW_HAS_XINPUT)
|
||||||
@ -546,7 +546,7 @@ static GLboolean initExtensions(void)
|
|||||||
&_glfw.x11.xi.major,
|
&_glfw.x11.xi.major,
|
||||||
&_glfw.x11.xi.minor) != BadRequest)
|
&_glfw.x11.xi.minor) != BadRequest)
|
||||||
{
|
{
|
||||||
_glfw.x11.xi.available = GL_TRUE;
|
_glfw.x11.xi.available = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /*_GLFW_HAS_XINPUT*/
|
#endif /*_GLFW_HAS_XINPUT*/
|
||||||
@ -569,7 +569,7 @@ static GLboolean initExtensions(void)
|
|||||||
if (XkbSetDetectableAutoRepeat(_glfw.x11.display, True, &supported))
|
if (XkbSetDetectableAutoRepeat(_glfw.x11.display, True, &supported))
|
||||||
{
|
{
|
||||||
if (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.XdndFinished = XInternAtom(_glfw.x11.display, "XdndFinished", True);
|
||||||
_glfw.x11.XdndSelection = XInternAtom(_glfw.x11.display, "XdndSelection", 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
|
// Create a blank cursor for hidden and disabled cursor modes
|
||||||
@ -733,7 +733,7 @@ int _glfwPlatformInit(void)
|
|||||||
"X11: The DISPLAY environment variable is missing");
|
"X11: The DISPLAY environment variable is missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.x11.screen = DefaultScreen(_glfw.x11.display);
|
_glfw.x11.screen = DefaultScreen(_glfw.x11.display);
|
||||||
@ -741,7 +741,7 @@ int _glfwPlatformInit(void)
|
|||||||
_glfw.x11.context = XUniqueContext();
|
_glfw.x11.context = XUniqueContext();
|
||||||
|
|
||||||
if (!initExtensions())
|
if (!initExtensions())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
_glfw.x11.cursor = createNULLCursor();
|
_glfw.x11.cursor = createNULLCursor();
|
||||||
|
|
||||||
@ -761,14 +761,14 @@ int _glfwPlatformInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!_glfwInitContextAPI())
|
if (!_glfwInitContextAPI())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (!_glfwInitJoysticks())
|
if (!_glfwInitJoysticks())
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
_glfwInitTimer();
|
_glfwInitTimer();
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformTerminate(void)
|
void _glfwPlatformTerminate(void)
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
// Check whether the display mode should be included in enumeration
|
// 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;
|
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
|
// 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)
|
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken)
|
||||||
{
|
{
|
||||||
@ -112,7 +112,7 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
|||||||
best = _glfwChooseVideoMode(monitor, desired);
|
best = _glfwChooseVideoMode(monitor, desired);
|
||||||
_glfwPlatformGetVideoMode(monitor, ¤t);
|
_glfwPlatformGetVideoMode(monitor, ¤t);
|
||||||
if (_glfwCompareVideoModes(¤t, best) == 0)
|
if (_glfwCompareVideoModes(¤t, best) == 0)
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
|
|
||||||
sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);
|
sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);
|
||||||
ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);
|
ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);
|
||||||
@ -155,11 +155,11 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"X11: Monitor mode list changed");
|
"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
|
// Restore the saved (original) video mode for the specified monitor
|
||||||
@ -285,7 +285,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"X11: RandR monitor support seems broken");
|
"X11: RandR monitor support seems broken");
|
||||||
|
|
||||||
_glfw.x11.randr.monitorBroken = GL_TRUE;
|
_glfw.x11.randr.monitorBroken = GLFW_TRUE;
|
||||||
free(monitors);
|
free(monitors);
|
||||||
monitors = NULL;
|
monitors = NULL;
|
||||||
}
|
}
|
||||||
@ -306,7 +306,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
return monitors;
|
return monitors;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
||||||
{
|
{
|
||||||
return first->x11.crtc == second->x11.crtc;
|
return first->x11.crtc == second->x11.crtc;
|
||||||
}
|
}
|
||||||
|
@ -168,18 +168,18 @@ typedef struct _GLFWlibraryX11
|
|||||||
Atom GLFW_SELECTION;
|
Atom GLFW_SELECTION;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
GLboolean available;
|
GLFWbool available;
|
||||||
int eventBase;
|
int eventBase;
|
||||||
int errorBase;
|
int errorBase;
|
||||||
int major;
|
int major;
|
||||||
int minor;
|
int minor;
|
||||||
GLboolean gammaBroken;
|
GLFWbool gammaBroken;
|
||||||
GLboolean monitorBroken;
|
GLFWbool monitorBroken;
|
||||||
} randr;
|
} randr;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
GLboolean available;
|
GLFWbool available;
|
||||||
GLboolean detectable;
|
GLFWbool detectable;
|
||||||
int majorOpcode;
|
int majorOpcode;
|
||||||
int eventBase;
|
int eventBase;
|
||||||
int errorBase;
|
int errorBase;
|
||||||
@ -200,14 +200,14 @@ typedef struct _GLFWlibraryX11
|
|||||||
} xdnd;
|
} xdnd;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
GLboolean available;
|
GLFWbool available;
|
||||||
int major;
|
int major;
|
||||||
int minor;
|
int minor;
|
||||||
} xinerama;
|
} xinerama;
|
||||||
|
|
||||||
#if defined(_GLFW_HAS_XINPUT)
|
#if defined(_GLFW_HAS_XINPUT)
|
||||||
struct {
|
struct {
|
||||||
GLboolean available;
|
GLFWbool available;
|
||||||
int majorOpcode;
|
int majorOpcode;
|
||||||
int eventBase;
|
int eventBase;
|
||||||
int errorBase;
|
int errorBase;
|
||||||
@ -218,7 +218,7 @@ typedef struct _GLFWlibraryX11
|
|||||||
|
|
||||||
#if defined(_GLFW_HAS_XF86VM)
|
#if defined(_GLFW_HAS_XF86VM)
|
||||||
struct {
|
struct {
|
||||||
GLboolean available;
|
GLFWbool available;
|
||||||
int eventBase;
|
int eventBase;
|
||||||
int errorBase;
|
int errorBase;
|
||||||
} vidmode;
|
} vidmode;
|
||||||
@ -251,7 +251,7 @@ typedef struct _GLFWcursorX11
|
|||||||
} _GLFWcursorX11;
|
} _GLFWcursorX11;
|
||||||
|
|
||||||
|
|
||||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
||||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
||||||
|
|
||||||
Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
|
Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
|
||||||
|
@ -247,8 +247,8 @@ static char** parseUriList(char* text, int* count)
|
|||||||
|
|
||||||
// Create the X11 window (and its colormap)
|
// Create the X11 window (and its colormap)
|
||||||
//
|
//
|
||||||
static GLboolean createWindow(_GLFWwindow* window,
|
static GLFWbool createWindow(_GLFWwindow* window,
|
||||||
const _GLFWwndconfig* wndconfig)
|
const _GLFWwndconfig* wndconfig)
|
||||||
{
|
{
|
||||||
unsigned long wamask;
|
unsigned long wamask;
|
||||||
XSetWindowAttributes wa;
|
XSetWindowAttributes wa;
|
||||||
@ -293,7 +293,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputXError(GLFW_PLATFORM_ERROR,
|
_glfwInputXError(GLFW_PLATFORM_ERROR,
|
||||||
"X11: Failed to create window");
|
"X11: Failed to create window");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
XSaveContext(_glfw.x11.display,
|
XSaveContext(_glfw.x11.display,
|
||||||
@ -400,7 +400,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_OUT_OF_MEMORY,
|
_glfwInputError(GLFW_OUT_OF_MEMORY,
|
||||||
"X11: Failed to allocate WM hints");
|
"X11: Failed to allocate WM hints");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
hints->flags = StateHint;
|
hints->flags = StateHint;
|
||||||
@ -499,7 +499,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
_glfwPlatformGetWindowPos(window, &window->x11.xpos, &window->x11.ypos);
|
_glfwPlatformGetWindowPos(window, &window->x11.xpos, &window->x11.ypos);
|
||||||
_glfwPlatformGetWindowSize(window, &window->x11.width, &window->x11.height);
|
_glfwPlatformGetWindowSize(window, &window->x11.width, &window->x11.height);
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns whether the event is a selection event
|
// Returns whether the event is a selection event
|
||||||
@ -1078,13 +1078,13 @@ static void processEvent(XEvent *event)
|
|||||||
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
||||||
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_HIDDEN);
|
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_HIDDEN);
|
||||||
|
|
||||||
_glfwInputCursorEnter(window, GL_TRUE);
|
_glfwInputCursorEnter(window, GLFW_TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LeaveNotify:
|
case LeaveNotify:
|
||||||
{
|
{
|
||||||
_glfwInputCursorEnter(window, GL_FALSE);
|
_glfwInputCursorEnter(window, GLFW_FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1292,7 +1292,7 @@ static void processEvent(XEvent *event)
|
|||||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||||
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED);
|
_glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED);
|
||||||
|
|
||||||
_glfwInputWindowFocus(window, GL_TRUE);
|
_glfwInputWindowFocus(window, GLFW_TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1315,7 +1315,7 @@ static void processEvent(XEvent *event)
|
|||||||
if (window->monitor && window->autoIconify)
|
if (window->monitor && window->autoIconify)
|
||||||
_glfwPlatformIconifyWindow(window);
|
_glfwPlatformIconifyWindow(window);
|
||||||
|
|
||||||
_glfwInputWindowFocus(window, GL_FALSE);
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1336,14 +1336,14 @@ static void processEvent(XEvent *event)
|
|||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
leaveFullscreenMode(window);
|
leaveFullscreenMode(window);
|
||||||
|
|
||||||
_glfwInputWindowIconify(window, GL_TRUE);
|
_glfwInputWindowIconify(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
else if (state == NormalState)
|
else if (state == NormalState)
|
||||||
{
|
{
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
enterFullscreenMode(window);
|
enterFullscreenMode(window);
|
||||||
|
|
||||||
_glfwInputWindowIconify(window, GL_FALSE);
|
_glfwInputWindowIconify(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1468,10 +1468,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
const _GLFWfbconfig* fbconfig)
|
const _GLFWfbconfig* fbconfig)
|
||||||
{
|
{
|
||||||
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (!createWindow(window, wndconfig))
|
if (!createWindow(window, wndconfig))
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (wndconfig->monitor)
|
if (wndconfig->monitor)
|
||||||
{
|
{
|
||||||
@ -1479,7 +1479,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
enterFullscreenMode(window);
|
enterFullscreenMode(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||||
@ -1880,9 +1880,9 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
|||||||
{
|
{
|
||||||
cursor->x11.handle = _glfwCreateCursor(image, xhot, yhot);
|
cursor->x11.handle = _glfwCreateCursor(image, xhot, yhot);
|
||||||
if (!cursor->x11.handle)
|
if (!cursor->x11.handle)
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
||||||
@ -1893,10 +1893,10 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
|||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"X11: Failed to create standard cursor");
|
"X11: Failed to create standard cursor");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
|
||||||
|
@ -58,7 +58,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GLFW_KEY_V:
|
case GLFW_KEY_V:
|
||||||
|
@ -46,9 +46,9 @@
|
|||||||
static double cursor_x;
|
static double cursor_x;
|
||||||
static double cursor_y;
|
static double cursor_y;
|
||||||
static int swap_interval = 1;
|
static int swap_interval = 1;
|
||||||
static GLboolean wait_events = GL_FALSE;
|
static int wait_events = GLFW_FALSE;
|
||||||
static GLboolean animate_cursor = GL_FALSE;
|
static int animate_cursor = GLFW_FALSE;
|
||||||
static GLboolean track_cursor = GL_FALSE;
|
static int track_cursor = GLFW_FALSE;
|
||||||
static GLFWcursor* standard_cursors[6];
|
static GLFWcursor* standard_cursors[6];
|
||||||
|
|
||||||
static void error_callback(int error, const char* description)
|
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)
|
if (glfwGetInputMode(window, GLFW_CURSOR) != GLFW_CURSOR_DISABLED)
|
||||||
{
|
{
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.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)
|
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)
|
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||||
{
|
{
|
||||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static float nrand(void)
|
static float nrand(void)
|
||||||
@ -116,7 +116,7 @@ int main(void)
|
|||||||
glfwWaitEvents();
|
glfwWaitEvents();
|
||||||
|
|
||||||
if (glfwWindowShouldClose(window))
|
if (glfwWindowShouldClose(window))
|
||||||
running = GL_FALSE;
|
running = GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
glfwHideWindow(window);
|
glfwHideWindow(window);
|
||||||
|
@ -506,7 +506,7 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
char title[128];
|
char title[128];
|
||||||
|
|
||||||
slots[i].closeable = GL_TRUE;
|
slots[i].closeable = GLFW_TRUE;
|
||||||
slots[i].number = i + 1;
|
slots[i].number = i + 1;
|
||||||
|
|
||||||
sprintf(title, "Event Linter (Window %i)", slots[i].number);
|
sprintf(title, "Event Linter (Window %i)", slots[i].number);
|
||||||
|
@ -69,7 +69,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
{
|
{
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
{
|
{
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ static void list_extensions(int api, int major, int minor)
|
|||||||
putchar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
static GLboolean valid_version(void)
|
static int valid_version(void)
|
||||||
{
|
{
|
||||||
int major, minor, revision;
|
int major, minor, revision;
|
||||||
glfwGetVersion(&major, &minor, &revision);
|
glfwGetVersion(&major, &minor, &revision);
|
||||||
@ -198,13 +198,13 @@ static GLboolean valid_version(void)
|
|||||||
if (major != GLFW_VERSION_MAJOR)
|
if (major != GLFW_VERSION_MAJOR)
|
||||||
{
|
{
|
||||||
printf("*** ERROR: GLFW major version mismatch! ***\n");
|
printf("*** ERROR: GLFW major version mismatch! ***\n");
|
||||||
return GL_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minor != GLFW_VERSION_MINOR || revision != GLFW_VERSION_REVISION)
|
if (minor != GLFW_VERSION_MINOR || revision != GLFW_VERSION_REVISION)
|
||||||
printf("*** WARNING: GLFW version mismatch! ***\n");
|
printf("*** WARNING: GLFW version mismatch! ***\n");
|
||||||
|
|
||||||
return GL_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_version(void)
|
static void print_version(void)
|
||||||
@ -224,7 +224,7 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
int ch, api, major, minor, revision, profile;
|
int ch, api, major, minor, revision, profile;
|
||||||
GLint redbits, greenbits, bluebits, alphabits, depthbits, stencilbits;
|
GLint redbits, greenbits, bluebits, alphabits, depthbits, stencilbits;
|
||||||
GLboolean list = GL_FALSE;
|
int list = GLFW_FALSE;
|
||||||
GLFWwindow* window;
|
GLFWwindow* window;
|
||||||
|
|
||||||
enum { API, BEHAVIOR, DEBUG, FORWARD, HELP, EXTENSIONS,
|
enum { API, BEHAVIOR, DEBUG, FORWARD, HELP, EXTENSIONS,
|
||||||
@ -309,11 +309,11 @@ int main(int argc, char** argv)
|
|||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
case DEBUG:
|
case DEBUG:
|
||||||
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
|
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
case FORWARD:
|
case FORWARD:
|
||||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
case HELP:
|
case HELP:
|
||||||
@ -321,7 +321,7 @@ int main(int argc, char** argv)
|
|||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
case 'l':
|
case 'l':
|
||||||
case EXTENSIONS:
|
case EXTENSIONS:
|
||||||
list = GL_TRUE;
|
list = GLFW_TRUE;
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
case MAJOR:
|
case MAJOR:
|
||||||
@ -444,13 +444,13 @@ int main(int argc, char** argv)
|
|||||||
glfwWindowHint(GLFW_SAMPLES, atoi(optarg));
|
glfwWindowHint(GLFW_SAMPLES, atoi(optarg));
|
||||||
break;
|
break;
|
||||||
case STEREO:
|
case STEREO:
|
||||||
glfwWindowHint(GLFW_STEREO, GL_TRUE);
|
glfwWindowHint(GLFW_STEREO, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
case SRGB:
|
case SRGB:
|
||||||
glfwWindowHint(GLFW_SRGB_CAPABLE, GL_TRUE);
|
glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
case SINGLEBUFFER:
|
case SINGLEBUFFER:
|
||||||
glfwWindowHint(GLFW_DOUBLEBUFFER, GL_FALSE);
|
glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_FALSE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
@ -460,7 +460,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
print_version();
|
print_version();
|
||||||
|
|
||||||
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
|
|
||||||
window = glfwCreateWindow(200, 200, "Version", NULL, NULL);
|
window = glfwCreateWindow(200, 200, "Version", NULL, NULL);
|
||||||
if (!window)
|
if (!window)
|
||||||
|
@ -65,7 +65,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
glfwIconifyWindow(window);
|
glfwIconifyWindow(window);
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ static GLFWwindow* create_window(GLFWmonitor* monitor)
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int ch, i, window_count;
|
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;
|
GLFWwindow** windows;
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "afhn")) != -1)
|
while ((ch = getopt(argc, argv, "afhn")) != -1)
|
||||||
@ -163,7 +163,7 @@ int main(int argc, char** argv)
|
|||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case 'a':
|
case 'a':
|
||||||
all_monitors = GL_TRUE;
|
all_monitors = GLFW_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
@ -171,11 +171,11 @@ int main(int argc, char** argv)
|
|||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
fullscreen = GL_TRUE;
|
fullscreen = GLFW_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
auto_iconify = GL_FALSE;
|
auto_iconify = GLFW_FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
typedef struct Joystick
|
typedef struct Joystick
|
||||||
{
|
{
|
||||||
GLboolean present;
|
int present;
|
||||||
char* name;
|
char* name;
|
||||||
float* axes;
|
float* axes;
|
||||||
unsigned char* buttons;
|
unsigned char* buttons;
|
||||||
@ -176,7 +176,7 @@ static void refresh_joysticks(void)
|
|||||||
joystick_count++;
|
joystick_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
j->present = GL_TRUE;
|
j->present = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -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)
|
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||||
{
|
{
|
||||||
if (key == GLFW_KEY_ESCAPE)
|
if (key == GLFW_KEY_ESCAPE)
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void list_modes(GLFWmonitor* monitor)
|
static void list_modes(GLFWmonitor* monitor)
|
||||||
|
@ -97,7 +97,7 @@ int main(int argc, char** argv)
|
|||||||
printf("Requesting that MSAA not be available\n");
|
printf("Requesting that MSAA not be available\n");
|
||||||
|
|
||||||
glfwWindowHint(GLFW_SAMPLES, samples);
|
glfwWindowHint(GLFW_SAMPLES, samples);
|
||||||
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
|
|
||||||
window = glfwCreateWindow(800, 400, "Aliasing Detector", NULL, NULL);
|
window = glfwCreateWindow(800, 400, "Aliasing Detector", NULL, NULL);
|
||||||
if (!window)
|
if (!window)
|
||||||
|
@ -63,7 +63,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
{
|
{
|
||||||
case GLFW_KEY_Q:
|
case GLFW_KEY_Q:
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||||
{
|
{
|
||||||
if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE)
|
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)
|
static GLFWwindow* open_window(const char* title, GLFWwindow* share, int posX, int posY)
|
||||||
{
|
{
|
||||||
GLFWwindow* window;
|
GLFWwindow* window;
|
||||||
|
|
||||||
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
window = glfwCreateWindow(WIDTH, HEIGHT, title, NULL, share);
|
window = glfwCreateWindow(WIDTH, HEIGHT, title, NULL, share);
|
||||||
if (!window)
|
if (!window)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
|
|
||||||
static GLboolean swap_tear;
|
static int swap_tear;
|
||||||
static int swap_interval;
|
static int swap_interval;
|
||||||
static double frame_rate;
|
static double frame_rate;
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ int main(int argc, char** argv)
|
|||||||
float position;
|
float position;
|
||||||
unsigned long frame_count = 0;
|
unsigned long frame_count = 0;
|
||||||
double last_time, current_time;
|
double last_time, current_time;
|
||||||
GLboolean fullscreen = GL_FALSE;
|
int fullscreen = GLFW_FALSE;
|
||||||
GLFWmonitor* monitor = NULL;
|
GLFWmonitor* monitor = NULL;
|
||||||
GLFWwindow* window;
|
GLFWwindow* window;
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ int main(int argc, char** argv)
|
|||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
fullscreen = GL_TRUE;
|
fullscreen = GLFW_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ typedef struct
|
|||||||
thrd_t id;
|
thrd_t id;
|
||||||
} Thread;
|
} Thread;
|
||||||
|
|
||||||
static volatile GLboolean running = GL_TRUE;
|
static volatile int running = GLFW_TRUE;
|
||||||
|
|
||||||
static void error_callback(int error, const char* description)
|
static void error_callback(int error, const char* description)
|
||||||
{
|
{
|
||||||
@ -87,7 +87,7 @@ int main(void)
|
|||||||
if (!glfwInit())
|
if (!glfwInit())
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
||||||
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
@ -120,7 +120,7 @@ int main(void)
|
|||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
if (glfwWindowShouldClose(threads[i].window))
|
if (glfwWindowShouldClose(threads[i].window))
|
||||||
running = GL_FALSE;
|
running = GLFW_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
GLboolean running = GL_TRUE;
|
int running = GLFW_TRUE;
|
||||||
GLFWwindow* windows[4];
|
GLFWwindow* windows[4];
|
||||||
|
|
||||||
glfwSetErrorCallback(error_callback);
|
glfwSetErrorCallback(error_callback);
|
||||||
@ -88,8 +88,8 @@ int main(int argc, char** argv)
|
|||||||
if (!glfwInit())
|
if (!glfwInit())
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
||||||
glfwWindowHint(GLFW_DECORATED, GL_FALSE);
|
glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
|
||||||
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
@ -125,7 +125,7 @@ int main(int argc, char** argv)
|
|||||||
glfwSwapBuffers(windows[i]);
|
glfwSwapBuffers(windows[i]);
|
||||||
|
|
||||||
if (glfwWindowShouldClose(windows[i]))
|
if (glfwWindowShouldClose(windows[i]))
|
||||||
running = GL_FALSE;
|
running = GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
|
Loading…
Reference in New Issue
Block a user