mirror of
https://github.com/glfw/glfw.git
synced 2025-12-21 14:42:06 +00:00
Compare commits
14 Commits
6fc1388c02
...
f2adb9b2e5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2adb9b2e5 | ||
|
|
0d2d85d19c | ||
|
|
768e81a0eb | ||
|
|
161fb1b6f6 | ||
|
|
645a35a38e | ||
|
|
7523b0e6bd | ||
|
|
5190a30d8a | ||
|
|
ddbb8e0f2c | ||
|
|
5245180c56 | ||
|
|
7b51a8eb31 | ||
|
|
8d1ceb0153 | ||
|
|
f4f4efe53f | ||
|
|
1f5fe33e57 | ||
|
|
b9619f07a8 |
@ -68,6 +68,7 @@ video tutorials.
|
|||||||
- Jan Ekström
|
- Jan Ekström
|
||||||
- Siavash Eliasi
|
- Siavash Eliasi
|
||||||
- er-azh
|
- er-azh
|
||||||
|
- Jan Hendrik Farr
|
||||||
- Ahmad Fatoum
|
- Ahmad Fatoum
|
||||||
- Nikita Fediuchin
|
- Nikita Fediuchin
|
||||||
- Felipe Ferreira
|
- Felipe Ferreira
|
||||||
|
|||||||
@ -134,9 +134,15 @@ information on what to include when reporting a bug.
|
|||||||
- [Wayland] Bugfix: Ignore key repeat events when no window has keyboard focus (#2727)
|
- [Wayland] Bugfix: Ignore key repeat events when no window has keyboard focus (#2727)
|
||||||
- [Wayland] Bugfix: Reset key repeat timer when window destroyed (#2741,#2727)
|
- [Wayland] Bugfix: Reset key repeat timer when window destroyed (#2741,#2727)
|
||||||
- [Wayland] Bugfix: Memory would leak if reading a data offer failed midway
|
- [Wayland] Bugfix: Memory would leak if reading a data offer failed midway
|
||||||
|
- [Wayland] Bugfix: Keyboard leave event handler now processes key repeats (#2736)
|
||||||
|
- [Wayland] Bugfix: Retrieved cursor position would be incorrect when hovering over
|
||||||
|
fallback decorations
|
||||||
|
- [Wayland] Bugfix: Fallback decorations would report scroll events
|
||||||
|
- [Wayland] Bugfix: Keyboard repeat events halted when any key is released (#2568)
|
||||||
- [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
|
- [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
|
||||||
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
|
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
|
||||||
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
|
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
|
||||||
|
- [EGL] Added `GLFW_ANGLE_PLATFORM_TYPE_D3D11ON12` init hint for D3D11on12 support
|
||||||
- [EGL] Allowed native access on Wayland with `GLFW_CONTEXT_CREATION_API` set to
|
- [EGL] Allowed native access on Wayland with `GLFW_CONTEXT_CREATION_API` set to
|
||||||
`GLFW_NATIVE_CONTEXT_API` (#2518)
|
`GLFW_NATIVE_CONTEXT_API` (#2518)
|
||||||
|
|
||||||
|
|||||||
@ -109,8 +109,8 @@ request when using OpenGL ES and EGL via [ANGLE][]. If the requested platform
|
|||||||
type is unavailable, ANGLE will use its default. Possible values are one of
|
type is unavailable, ANGLE will use its default. Possible values are one of
|
||||||
`GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`,
|
`GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`,
|
||||||
`GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`,
|
`GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`,
|
||||||
`GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` and
|
`GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_D3D11ON12`,
|
||||||
`GLFW_ANGLE_PLATFORM_TYPE_METAL`.
|
`GLFW_ANGLE_PLATFORM_TYPE_VULKAN` and `GLFW_ANGLE_PLATFORM_TYPE_METAL`.
|
||||||
|
|
||||||
[ANGLE]: https://chromium.googlesource.com/angle/angle/
|
[ANGLE]: https://chromium.googlesource.com/angle/angle/
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ Initialization hint | Default value | Supported v
|
|||||||
-------------------------------- | ------------------------------- | ----------------
|
-------------------------------- | ------------------------------- | ----------------
|
||||||
@ref GLFW_PLATFORM | `GLFW_ANY_PLATFORM` | `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`
|
@ref GLFW_PLATFORM | `GLFW_ANY_PLATFORM` | `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`
|
||||||
@ref GLFW_JOYSTICK_HAT_BUTTONS | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
@ref GLFW_JOYSTICK_HAT_BUTTONS | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
@ref GLFW_ANGLE_PLATFORM_TYPE | `GLFW_ANGLE_PLATFORM_TYPE_NONE` | `GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`, `GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` or `GLFW_ANGLE_PLATFORM_TYPE_METAL`
|
@ref GLFW_ANGLE_PLATFORM_TYPE | `GLFW_ANGLE_PLATFORM_TYPE_NONE` | `GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`, `GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_D3D11ON12`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` or `GLFW_ANGLE_PLATFORM_TYPE_METAL`
|
||||||
@ref GLFW_COCOA_CHDIR_RESOURCES | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
@ref GLFW_COCOA_CHDIR_RESOURCES | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
@ref GLFW_COCOA_MENUBAR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
@ref GLFW_COCOA_MENUBAR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||||
@ref GLFW_WAYLAND_LIBDECOR | `GLFW_WAYLAND_PREFER_LIBDECOR` | `GLFW_WAYLAND_PREFER_LIBDECOR` or `GLFW_WAYLAND_DISABLE_LIBDECOR`
|
@ref GLFW_WAYLAND_LIBDECOR | `GLFW_WAYLAND_PREFER_LIBDECOR` | `GLFW_WAYLAND_PREFER_LIBDECOR` or `GLFW_WAYLAND_DISABLE_LIBDECOR`
|
||||||
|
|||||||
@ -14,6 +14,9 @@ values over 8. For compatibility with older versions, the
|
|||||||
@ref GLFW_UNLIMITED_MOUSE_BUTTONS input mode needs to be set to make use of
|
@ref GLFW_UNLIMITED_MOUSE_BUTTONS input mode needs to be set to make use of
|
||||||
this.
|
this.
|
||||||
|
|
||||||
|
On Windows 10 or newer it is now possible to specify ANGLE's D3D11on12
|
||||||
|
backend via the @ref GLFW_ANGLE_PLATFORM_TYPE_D3D11ON12 init hint.
|
||||||
|
|
||||||
## Caveats {#caveats}
|
## Caveats {#caveats}
|
||||||
|
|
||||||
## Deprecations {#deprecations}
|
## Deprecations {#deprecations}
|
||||||
@ -44,6 +47,7 @@ actively maintained and available on many platforms.
|
|||||||
### New constants {#new_constants}
|
### New constants {#new_constants}
|
||||||
|
|
||||||
- @ref GLFW_UNLIMITED_MOUSE_BUTTONS
|
- @ref GLFW_UNLIMITED_MOUSE_BUTTONS
|
||||||
|
- @ref GLFW_ANGLE_PLATFORM_TYPE_D3D11ON12
|
||||||
|
|
||||||
## Release notes for earlier versions {#news_archive}
|
## Release notes for earlier versions {#news_archive}
|
||||||
|
|
||||||
|
|||||||
@ -1174,6 +1174,7 @@ extern "C" {
|
|||||||
#define GLFW_ANGLE_PLATFORM_TYPE_OPENGLES 0x00037003
|
#define GLFW_ANGLE_PLATFORM_TYPE_OPENGLES 0x00037003
|
||||||
#define GLFW_ANGLE_PLATFORM_TYPE_D3D9 0x00037004
|
#define GLFW_ANGLE_PLATFORM_TYPE_D3D9 0x00037004
|
||||||
#define GLFW_ANGLE_PLATFORM_TYPE_D3D11 0x00037005
|
#define GLFW_ANGLE_PLATFORM_TYPE_D3D11 0x00037005
|
||||||
|
#define GLFW_ANGLE_PLATFORM_TYPE_D3D11ON12 0x00037006
|
||||||
#define GLFW_ANGLE_PLATFORM_TYPE_VULKAN 0x00037007
|
#define GLFW_ANGLE_PLATFORM_TYPE_VULKAN 0x00037007
|
||||||
#define GLFW_ANGLE_PLATFORM_TYPE_METAL 0x00037008
|
#define GLFW_ANGLE_PLATFORM_TYPE_METAL 0x00037008
|
||||||
|
|
||||||
|
|||||||
@ -110,6 +110,7 @@ typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGPROC)(GLenum);
|
|||||||
typedef void (APIENTRY * PFNGLGETINTEGERVPROC)(GLenum,GLint*);
|
typedef void (APIENTRY * PFNGLGETINTEGERVPROC)(GLenum,GLint*);
|
||||||
typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint);
|
typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint);
|
||||||
|
|
||||||
|
#define EGL_TRUE 1
|
||||||
#define EGL_SUCCESS 0x3000
|
#define EGL_SUCCESS 0x3000
|
||||||
#define EGL_NOT_INITIALIZED 0x3001
|
#define EGL_NOT_INITIALIZED 0x3001
|
||||||
#define EGL_BAD_ACCESS 0x3002
|
#define EGL_BAD_ACCESS 0x3002
|
||||||
@ -185,6 +186,7 @@ typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint);
|
|||||||
#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
|
#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
|
||||||
#define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450
|
#define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450
|
||||||
#define EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE 0x3489
|
#define EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE 0x3489
|
||||||
|
#define EGL_PLATFORM_ANGLE_D3D11ON12_ANGLE 0x3488
|
||||||
#define EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE 0x348f
|
#define EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE 0x348f
|
||||||
#define EGL_PLATFORM_SURFACELESS_MESA 0x31dd
|
#define EGL_PLATFORM_SURFACELESS_MESA 0x31dd
|
||||||
|
|
||||||
|
|||||||
@ -2450,8 +2450,18 @@ const char* _glfwGetClipboardStringWin32(void)
|
|||||||
return _glfw.win32.clipboardString;
|
return _glfw.win32.clipboardString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SET_ATTRIB(a, v) \
|
||||||
|
{ \
|
||||||
|
assert(((size_t) index + 1) < sizeof(tmp_attribs) / sizeof(tmp_attribs[0])); \
|
||||||
|
tmp_attribs[index++] = a; \
|
||||||
|
tmp_attribs[index++] = v; \
|
||||||
|
}
|
||||||
|
|
||||||
EGLenum _glfwGetEGLPlatformWin32(EGLint** attribs)
|
EGLenum _glfwGetEGLPlatformWin32(EGLint** attribs)
|
||||||
{
|
{
|
||||||
|
EGLint tmp_attribs[8];
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
if (_glfw.egl.ANGLE_platform_angle)
|
if (_glfw.egl.ANGLE_platform_angle)
|
||||||
{
|
{
|
||||||
int type = 0;
|
int type = 0;
|
||||||
@ -2470,6 +2480,11 @@ EGLenum _glfwGetEGLPlatformWin32(EGLint** attribs)
|
|||||||
type = EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE;
|
type = EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE;
|
||||||
else if (_glfw.hints.init.angleType == GLFW_ANGLE_PLATFORM_TYPE_D3D11)
|
else if (_glfw.hints.init.angleType == GLFW_ANGLE_PLATFORM_TYPE_D3D11)
|
||||||
type = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE;
|
type = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE;
|
||||||
|
else if (_glfw.hints.init.angleType == GLFW_ANGLE_PLATFORM_TYPE_D3D11ON12)
|
||||||
|
{
|
||||||
|
type = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE;
|
||||||
|
SET_ATTRIB(EGL_PLATFORM_ANGLE_D3D11ON12_ANGLE, EGL_TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfw.egl.ANGLE_platform_angle_vulkan)
|
if (_glfw.egl.ANGLE_platform_angle_vulkan)
|
||||||
@ -2480,10 +2495,10 @@ EGLenum _glfwGetEGLPlatformWin32(EGLint** attribs)
|
|||||||
|
|
||||||
if (type)
|
if (type)
|
||||||
{
|
{
|
||||||
*attribs = _glfw_calloc(3, sizeof(EGLint));
|
SET_ATTRIB(EGL_PLATFORM_ANGLE_TYPE_ANGLE, type);
|
||||||
(*attribs)[0] = EGL_PLATFORM_ANGLE_TYPE_ANGLE;
|
SET_ATTRIB(EGL_NONE, EGL_NONE);
|
||||||
(*attribs)[1] = type;
|
*attribs = _glfw_calloc(index, sizeof(EGLint));
|
||||||
(*attribs)[2] = EGL_NONE;
|
memcpy(*attribs, tmp_attribs, index * sizeof(EGLint));
|
||||||
return EGL_PLATFORM_ANGLE_ANGLE;
|
return EGL_PLATFORM_ANGLE_ANGLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2491,6 +2506,8 @@ EGLenum _glfwGetEGLPlatformWin32(EGLint** attribs)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef SET_ATTRIB
|
||||||
|
|
||||||
EGLNativeDisplayType _glfwGetEGLNativeDisplayWin32(void)
|
EGLNativeDisplayType _glfwGetEGLNativeDisplayWin32(void)
|
||||||
{
|
{
|
||||||
return GetDC(_glfw.win32.helperWindowHandle);
|
return GetDC(_glfw.win32.helperWindowHandle);
|
||||||
|
|||||||
@ -217,62 +217,62 @@ struct libdecor_configuration;
|
|||||||
|
|
||||||
enum libdecor_error
|
enum libdecor_error
|
||||||
{
|
{
|
||||||
LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE,
|
LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE,
|
||||||
LIBDECOR_ERROR_INVALID_FRAME_CONFIGURATION,
|
LIBDECOR_ERROR_INVALID_FRAME_CONFIGURATION,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum libdecor_window_state
|
enum libdecor_window_state
|
||||||
{
|
{
|
||||||
LIBDECOR_WINDOW_STATE_NONE = 0,
|
LIBDECOR_WINDOW_STATE_NONE = 0,
|
||||||
LIBDECOR_WINDOW_STATE_ACTIVE = 1,
|
LIBDECOR_WINDOW_STATE_ACTIVE = 1,
|
||||||
LIBDECOR_WINDOW_STATE_MAXIMIZED = 2,
|
LIBDECOR_WINDOW_STATE_MAXIMIZED = 2,
|
||||||
LIBDECOR_WINDOW_STATE_FULLSCREEN = 4,
|
LIBDECOR_WINDOW_STATE_FULLSCREEN = 4,
|
||||||
LIBDECOR_WINDOW_STATE_TILED_LEFT = 8,
|
LIBDECOR_WINDOW_STATE_TILED_LEFT = 8,
|
||||||
LIBDECOR_WINDOW_STATE_TILED_RIGHT = 16,
|
LIBDECOR_WINDOW_STATE_TILED_RIGHT = 16,
|
||||||
LIBDECOR_WINDOW_STATE_TILED_TOP = 32,
|
LIBDECOR_WINDOW_STATE_TILED_TOP = 32,
|
||||||
LIBDECOR_WINDOW_STATE_TILED_BOTTOM = 64
|
LIBDECOR_WINDOW_STATE_TILED_BOTTOM = 64
|
||||||
};
|
};
|
||||||
|
|
||||||
enum libdecor_capabilities
|
enum libdecor_capabilities
|
||||||
{
|
{
|
||||||
LIBDECOR_ACTION_MOVE = 1,
|
LIBDECOR_ACTION_MOVE = 1,
|
||||||
LIBDECOR_ACTION_RESIZE = 2,
|
LIBDECOR_ACTION_RESIZE = 2,
|
||||||
LIBDECOR_ACTION_MINIMIZE = 4,
|
LIBDECOR_ACTION_MINIMIZE = 4,
|
||||||
LIBDECOR_ACTION_FULLSCREEN = 8,
|
LIBDECOR_ACTION_FULLSCREEN = 8,
|
||||||
LIBDECOR_ACTION_CLOSE = 16
|
LIBDECOR_ACTION_CLOSE = 16
|
||||||
};
|
};
|
||||||
|
|
||||||
struct libdecor_interface
|
struct libdecor_interface
|
||||||
{
|
{
|
||||||
void (* error)(struct libdecor*,enum libdecor_error,const char*);
|
void (* error)(struct libdecor*,enum libdecor_error,const char*);
|
||||||
void (* reserved0)(void);
|
void (* reserved0)(void);
|
||||||
void (* reserved1)(void);
|
void (* reserved1)(void);
|
||||||
void (* reserved2)(void);
|
void (* reserved2)(void);
|
||||||
void (* reserved3)(void);
|
void (* reserved3)(void);
|
||||||
void (* reserved4)(void);
|
void (* reserved4)(void);
|
||||||
void (* reserved5)(void);
|
void (* reserved5)(void);
|
||||||
void (* reserved6)(void);
|
void (* reserved6)(void);
|
||||||
void (* reserved7)(void);
|
void (* reserved7)(void);
|
||||||
void (* reserved8)(void);
|
void (* reserved8)(void);
|
||||||
void (* reserved9)(void);
|
void (* reserved9)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct libdecor_frame_interface
|
struct libdecor_frame_interface
|
||||||
{
|
{
|
||||||
void (* configure)(struct libdecor_frame*,struct libdecor_configuration*,void*);
|
void (* configure)(struct libdecor_frame*,struct libdecor_configuration*,void*);
|
||||||
void (* close)(struct libdecor_frame*,void*);
|
void (* close)(struct libdecor_frame*,void*);
|
||||||
void (* commit)(struct libdecor_frame*,void*);
|
void (* commit)(struct libdecor_frame*,void*);
|
||||||
void (* dismiss_popup)(struct libdecor_frame*,const char*,void*);
|
void (* dismiss_popup)(struct libdecor_frame*,const char*,void*);
|
||||||
void (* reserved0)(void);
|
void (* reserved0)(void);
|
||||||
void (* reserved1)(void);
|
void (* reserved1)(void);
|
||||||
void (* reserved2)(void);
|
void (* reserved2)(void);
|
||||||
void (* reserved3)(void);
|
void (* reserved3)(void);
|
||||||
void (* reserved4)(void);
|
void (* reserved4)(void);
|
||||||
void (* reserved5)(void);
|
void (* reserved5)(void);
|
||||||
void (* reserved6)(void);
|
void (* reserved6)(void);
|
||||||
void (* reserved7)(void);
|
void (* reserved7)(void);
|
||||||
void (* reserved8)(void);
|
void (* reserved8)(void);
|
||||||
void (* reserved9)(void);
|
void (* reserved9)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct libdecor* (* PFN_libdecor_new)(struct wl_display*,const struct libdecor_interface*);
|
typedef struct libdecor* (* PFN_libdecor_new)(struct wl_display*,const struct libdecor_interface*);
|
||||||
@ -413,6 +413,8 @@ typedef struct _GLFWwindowWayland
|
|||||||
struct wl_buffer* buffer;
|
struct wl_buffer* buffer;
|
||||||
_GLFWfallbackEdgeWayland top, left, right, bottom;
|
_GLFWfallbackEdgeWayland top, left, right, bottom;
|
||||||
struct wl_surface* focus;
|
struct wl_surface* focus;
|
||||||
|
wl_fixed_t pointerX, pointerY;
|
||||||
|
const char* cursorName;
|
||||||
} fallback;
|
} fallback;
|
||||||
} _GLFWwindowWayland;
|
} _GLFWwindowWayland;
|
||||||
|
|
||||||
@ -454,7 +456,6 @@ typedef struct _GLFWlibraryWayland
|
|||||||
struct wl_cursor_theme* cursorTheme;
|
struct wl_cursor_theme* cursorTheme;
|
||||||
struct wl_cursor_theme* cursorThemeHiDPI;
|
struct wl_cursor_theme* cursorThemeHiDPI;
|
||||||
struct wl_surface* cursorSurface;
|
struct wl_surface* cursorSurface;
|
||||||
const char* cursorPreviousName;
|
|
||||||
int cursorTimerfd;
|
int cursorTimerfd;
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
uint32_t pointerEnterSerial;
|
uint32_t pointerEnterSerial;
|
||||||
|
|||||||
315
src/wl_window.c
315
src/wl_window.c
@ -275,6 +275,146 @@ static void destroyFallbackDecorations(_GLFWwindow* window)
|
|||||||
destroyFallbackEdge(&window->wl.fallback.bottom);
|
destroyFallbackEdge(&window->wl.fallback.bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void updateFallbackDecorationCursor(_GLFWwindow* window,
|
||||||
|
wl_fixed_t sx,
|
||||||
|
wl_fixed_t sy)
|
||||||
|
{
|
||||||
|
window->wl.fallback.pointerX = sx;
|
||||||
|
window->wl.fallback.pointerY = sy;
|
||||||
|
|
||||||
|
const double xpos = wl_fixed_to_double(sx);
|
||||||
|
const double ypos = wl_fixed_to_double(sy);
|
||||||
|
const char* cursorName = "left_ptr";
|
||||||
|
|
||||||
|
if (window->resizable)
|
||||||
|
{
|
||||||
|
if (window->wl.fallback.focus == window->wl.fallback.top.surface)
|
||||||
|
{
|
||||||
|
if (ypos < GLFW_BORDER_SIZE)
|
||||||
|
cursorName = "n-resize";
|
||||||
|
}
|
||||||
|
else if (window->wl.fallback.focus == window->wl.fallback.left.surface)
|
||||||
|
{
|
||||||
|
if (ypos < GLFW_BORDER_SIZE)
|
||||||
|
cursorName = "nw-resize";
|
||||||
|
else
|
||||||
|
cursorName = "w-resize";
|
||||||
|
}
|
||||||
|
else if (window->wl.fallback.focus == window->wl.fallback.right.surface)
|
||||||
|
{
|
||||||
|
if (ypos < GLFW_BORDER_SIZE)
|
||||||
|
cursorName = "ne-resize";
|
||||||
|
else
|
||||||
|
cursorName = "e-resize";
|
||||||
|
}
|
||||||
|
else if (window->wl.fallback.focus == window->wl.fallback.bottom.surface)
|
||||||
|
{
|
||||||
|
if (xpos < GLFW_BORDER_SIZE)
|
||||||
|
cursorName = "sw-resize";
|
||||||
|
else if (xpos > window->wl.width + GLFW_BORDER_SIZE)
|
||||||
|
cursorName = "se-resize";
|
||||||
|
else
|
||||||
|
cursorName = "s-resize";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window->wl.fallback.cursorName != cursorName)
|
||||||
|
{
|
||||||
|
struct wl_surface* surface = _glfw.wl.cursorSurface;
|
||||||
|
struct wl_cursor_theme* theme = _glfw.wl.cursorTheme;
|
||||||
|
int scale = 1;
|
||||||
|
|
||||||
|
if (window->wl.bufferScale > 1 && _glfw.wl.cursorThemeHiDPI)
|
||||||
|
{
|
||||||
|
// We only support up to scale=2 for now, since libwayland-cursor
|
||||||
|
// requires us to load a different theme for each size.
|
||||||
|
scale = 2;
|
||||||
|
theme = _glfw.wl.cursorThemeHiDPI;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct wl_cursor* cursor = wl_cursor_theme_get_cursor(theme, cursorName);
|
||||||
|
if (!cursor)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// TODO: handle animated cursors too.
|
||||||
|
struct wl_cursor_image* image = cursor->images[0];
|
||||||
|
if (!image)
|
||||||
|
return;
|
||||||
|
|
||||||
|
struct wl_buffer* buffer = wl_cursor_image_get_buffer(image);
|
||||||
|
if (!buffer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial,
|
||||||
|
surface,
|
||||||
|
image->hotspot_x / scale,
|
||||||
|
image->hotspot_y / scale);
|
||||||
|
wl_surface_set_buffer_scale(surface, scale);
|
||||||
|
wl_surface_attach(surface, buffer, 0, 0);
|
||||||
|
wl_surface_damage(surface, 0, 0, image->width, image->height);
|
||||||
|
wl_surface_commit(surface);
|
||||||
|
|
||||||
|
window->wl.fallback.cursorName = cursorName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void handleFallbackDecorationButton(_GLFWwindow* window,
|
||||||
|
uint32_t serial,
|
||||||
|
uint32_t button)
|
||||||
|
{
|
||||||
|
const double xpos = wl_fixed_to_double(window->wl.fallback.pointerX);
|
||||||
|
const double ypos = wl_fixed_to_double(window->wl.fallback.pointerY);
|
||||||
|
|
||||||
|
if (button == BTN_LEFT)
|
||||||
|
{
|
||||||
|
uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE;
|
||||||
|
|
||||||
|
if (window->wl.fallback.focus == window->wl.fallback.top.surface)
|
||||||
|
{
|
||||||
|
if (ypos < GLFW_BORDER_SIZE)
|
||||||
|
edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP;
|
||||||
|
else
|
||||||
|
xdg_toplevel_move(window->wl.xdg.toplevel, _glfw.wl.seat, serial);
|
||||||
|
}
|
||||||
|
else if (window->wl.fallback.focus == window->wl.fallback.left.surface)
|
||||||
|
{
|
||||||
|
if (ypos < GLFW_BORDER_SIZE)
|
||||||
|
edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT;
|
||||||
|
else
|
||||||
|
edges = XDG_TOPLEVEL_RESIZE_EDGE_LEFT;
|
||||||
|
}
|
||||||
|
else if (window->wl.fallback.focus == window->wl.fallback.right.surface)
|
||||||
|
{
|
||||||
|
if (ypos < GLFW_BORDER_SIZE)
|
||||||
|
edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT;
|
||||||
|
else
|
||||||
|
edges = XDG_TOPLEVEL_RESIZE_EDGE_RIGHT;
|
||||||
|
}
|
||||||
|
else if (window->wl.fallback.focus == window->wl.fallback.bottom.surface)
|
||||||
|
{
|
||||||
|
if (xpos < GLFW_BORDER_SIZE)
|
||||||
|
edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT;
|
||||||
|
else if (xpos > window->wl.width + GLFW_BORDER_SIZE)
|
||||||
|
edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT;
|
||||||
|
else
|
||||||
|
edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (edges != XDG_TOPLEVEL_RESIZE_EDGE_NONE)
|
||||||
|
xdg_toplevel_resize(window->wl.xdg.toplevel, _glfw.wl.seat, serial, edges);
|
||||||
|
}
|
||||||
|
else if (button == BTN_RIGHT)
|
||||||
|
{
|
||||||
|
if (window->wl.xdg.toplevel)
|
||||||
|
{
|
||||||
|
xdg_toplevel_show_window_menu(window->wl.xdg.toplevel,
|
||||||
|
_glfw.wl.seat, serial,
|
||||||
|
window->wl.cursorPosX,
|
||||||
|
window->wl.cursorPosY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void xdgDecorationHandleConfigure(void* userData,
|
static void xdgDecorationHandleConfigure(void* userData,
|
||||||
struct zxdg_toplevel_decoration_v1* decoration,
|
struct zxdg_toplevel_decoration_v1* decoration,
|
||||||
uint32_t mode)
|
uint32_t mode)
|
||||||
@ -1417,7 +1557,6 @@ static void pointerHandleLeave(void* userData,
|
|||||||
|
|
||||||
_glfw.wl.serial = serial;
|
_glfw.wl.serial = serial;
|
||||||
_glfw.wl.pointerFocus = NULL;
|
_glfw.wl.pointerFocus = NULL;
|
||||||
_glfw.wl.cursorPreviousName = NULL;
|
|
||||||
|
|
||||||
if (window->wl.hovered)
|
if (window->wl.hovered)
|
||||||
{
|
{
|
||||||
@ -1427,7 +1566,10 @@ static void pointerHandleLeave(void* userData,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (window->wl.fallback.decorations)
|
if (window->wl.fallback.decorations)
|
||||||
|
{
|
||||||
window->wl.fallback.focus = NULL;
|
window->wl.fallback.focus = NULL;
|
||||||
|
window->wl.fallback.cursorName = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1444,92 +1586,16 @@ static void pointerHandleMotion(void* userData,
|
|||||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const double xpos = wl_fixed_to_double(sx);
|
|
||||||
const double ypos = wl_fixed_to_double(sy);
|
|
||||||
window->wl.cursorPosX = xpos;
|
|
||||||
window->wl.cursorPosY = ypos;
|
|
||||||
|
|
||||||
if (window->wl.hovered)
|
if (window->wl.hovered)
|
||||||
{
|
{
|
||||||
_glfw.wl.cursorPreviousName = NULL;
|
window->wl.cursorPosX = wl_fixed_to_double(sx);
|
||||||
_glfwInputCursorPos(window, xpos, ypos);
|
window->wl.cursorPosY = wl_fixed_to_double(sy);
|
||||||
return;
|
_glfwInputCursorPos(window, window->wl.cursorPosX, window->wl.cursorPosY);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (window->wl.fallback.decorations)
|
|
||||||
{
|
{
|
||||||
const char* cursorName = "left_ptr";
|
if (window->wl.fallback.decorations)
|
||||||
|
updateFallbackDecorationCursor(window, sx, sy);
|
||||||
if (window->resizable)
|
|
||||||
{
|
|
||||||
if (window->wl.fallback.focus == window->wl.fallback.top.surface)
|
|
||||||
{
|
|
||||||
if (ypos < GLFW_BORDER_SIZE)
|
|
||||||
cursorName = "n-resize";
|
|
||||||
}
|
|
||||||
else if (window->wl.fallback.focus == window->wl.fallback.left.surface)
|
|
||||||
{
|
|
||||||
if (ypos < GLFW_BORDER_SIZE)
|
|
||||||
cursorName = "nw-resize";
|
|
||||||
else
|
|
||||||
cursorName = "w-resize";
|
|
||||||
}
|
|
||||||
else if (window->wl.fallback.focus == window->wl.fallback.right.surface)
|
|
||||||
{
|
|
||||||
if (ypos < GLFW_BORDER_SIZE)
|
|
||||||
cursorName = "ne-resize";
|
|
||||||
else
|
|
||||||
cursorName = "e-resize";
|
|
||||||
}
|
|
||||||
else if (window->wl.fallback.focus == window->wl.fallback.bottom.surface)
|
|
||||||
{
|
|
||||||
if (xpos < GLFW_BORDER_SIZE)
|
|
||||||
cursorName = "sw-resize";
|
|
||||||
else if (xpos > window->wl.width + GLFW_BORDER_SIZE)
|
|
||||||
cursorName = "se-resize";
|
|
||||||
else
|
|
||||||
cursorName = "s-resize";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_glfw.wl.cursorPreviousName != cursorName)
|
|
||||||
{
|
|
||||||
struct wl_surface* surface = _glfw.wl.cursorSurface;
|
|
||||||
struct wl_cursor_theme* theme = _glfw.wl.cursorTheme;
|
|
||||||
int scale = 1;
|
|
||||||
|
|
||||||
if (window->wl.bufferScale > 1 && _glfw.wl.cursorThemeHiDPI)
|
|
||||||
{
|
|
||||||
// We only support up to scale=2 for now, since libwayland-cursor
|
|
||||||
// requires us to load a different theme for each size.
|
|
||||||
scale = 2;
|
|
||||||
theme = _glfw.wl.cursorThemeHiDPI;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct wl_cursor* cursor = wl_cursor_theme_get_cursor(theme, cursorName);
|
|
||||||
if (!cursor)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// TODO: handle animated cursors too.
|
|
||||||
struct wl_cursor_image* image = cursor->images[0];
|
|
||||||
if (!image)
|
|
||||||
return;
|
|
||||||
|
|
||||||
struct wl_buffer* buffer = wl_cursor_image_get_buffer(image);
|
|
||||||
if (!buffer)
|
|
||||||
return;
|
|
||||||
|
|
||||||
wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial,
|
|
||||||
surface,
|
|
||||||
image->hotspot_x / scale,
|
|
||||||
image->hotspot_y / scale);
|
|
||||||
wl_surface_set_buffer_scale(surface, scale);
|
|
||||||
wl_surface_attach(surface, buffer, 0, 0);
|
|
||||||
wl_surface_damage(surface, 0, 0, image->width, image->height);
|
|
||||||
wl_surface_commit(surface);
|
|
||||||
|
|
||||||
_glfw.wl.cursorPreviousName = cursorName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1552,62 +1618,11 @@ static void pointerHandleButton(void* userData,
|
|||||||
button - BTN_LEFT,
|
button - BTN_LEFT,
|
||||||
state == WL_POINTER_BUTTON_STATE_PRESSED,
|
state == WL_POINTER_BUTTON_STATE_PRESSED,
|
||||||
_glfw.wl.xkb.modifiers);
|
_glfw.wl.xkb.modifiers);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (window->wl.fallback.decorations)
|
|
||||||
{
|
{
|
||||||
if (button == BTN_LEFT)
|
if (window->wl.fallback.decorations)
|
||||||
{
|
handleFallbackDecorationButton(window, serial, button);
|
||||||
uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE;
|
|
||||||
|
|
||||||
if (window->wl.fallback.focus == window->wl.fallback.top.surface)
|
|
||||||
{
|
|
||||||
if (window->wl.cursorPosY < GLFW_BORDER_SIZE)
|
|
||||||
edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP;
|
|
||||||
else
|
|
||||||
xdg_toplevel_move(window->wl.xdg.toplevel, _glfw.wl.seat, serial);
|
|
||||||
}
|
|
||||||
else if (window->wl.fallback.focus == window->wl.fallback.left.surface)
|
|
||||||
{
|
|
||||||
if (window->wl.cursorPosY < GLFW_BORDER_SIZE)
|
|
||||||
edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT;
|
|
||||||
else
|
|
||||||
edges = XDG_TOPLEVEL_RESIZE_EDGE_LEFT;
|
|
||||||
}
|
|
||||||
else if (window->wl.fallback.focus == window->wl.fallback.right.surface)
|
|
||||||
{
|
|
||||||
if (window->wl.cursorPosY < GLFW_BORDER_SIZE)
|
|
||||||
edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT;
|
|
||||||
else
|
|
||||||
edges = XDG_TOPLEVEL_RESIZE_EDGE_RIGHT;
|
|
||||||
}
|
|
||||||
else if (window->wl.fallback.focus == window->wl.fallback.bottom.surface)
|
|
||||||
{
|
|
||||||
if (window->wl.cursorPosX < GLFW_BORDER_SIZE)
|
|
||||||
edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT;
|
|
||||||
else if (window->wl.cursorPosX > window->wl.width + GLFW_BORDER_SIZE)
|
|
||||||
edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT;
|
|
||||||
else
|
|
||||||
edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (edges != XDG_TOPLEVEL_RESIZE_EDGE_NONE)
|
|
||||||
{
|
|
||||||
xdg_toplevel_resize(window->wl.xdg.toplevel, _glfw.wl.seat,
|
|
||||||
serial, edges);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (button == BTN_RIGHT)
|
|
||||||
{
|
|
||||||
if (window->wl.xdg.toplevel)
|
|
||||||
{
|
|
||||||
xdg_toplevel_show_window_menu(window->wl.xdg.toplevel,
|
|
||||||
_glfw.wl.seat, serial,
|
|
||||||
window->wl.cursorPosX,
|
|
||||||
window->wl.cursorPosY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1621,11 +1636,14 @@ static void pointerHandleAxis(void* userData,
|
|||||||
if (!window)
|
if (!window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// NOTE: 10 units of motion per mouse wheel step seems to be a common ratio
|
if (window->wl.hovered)
|
||||||
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL)
|
{
|
||||||
_glfwInputScroll(window, -wl_fixed_to_double(value) / 10.0, 0.0);
|
// NOTE: 10 units of motion per mouse wheel step seems to be a common ratio
|
||||||
else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL)
|
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL)
|
||||||
_glfwInputScroll(window, 0.0, -wl_fixed_to_double(value) / 10.0);
|
_glfwInputScroll(window, -wl_fixed_to_double(value) / 10.0, 0.0);
|
||||||
|
else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL)
|
||||||
|
_glfwInputScroll(window, 0.0, -wl_fixed_to_double(value) / 10.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wl_pointer_listener pointerListener =
|
static const struct wl_pointer_listener pointerListener =
|
||||||
@ -1802,11 +1820,12 @@ static void keyboardHandleKey(void* userData,
|
|||||||
|
|
||||||
timer.it_value.tv_sec = _glfw.wl.keyRepeatDelay / 1000;
|
timer.it_value.tv_sec = _glfw.wl.keyRepeatDelay / 1000;
|
||||||
timer.it_value.tv_nsec = (_glfw.wl.keyRepeatDelay % 1000) * 1000000;
|
timer.it_value.tv_nsec = (_glfw.wl.keyRepeatDelay % 1000) * 1000000;
|
||||||
|
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
||||||
}
|
}
|
||||||
|
} else if (scancode == _glfw.wl.keyRepeatScancode) {
|
||||||
|
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
|
||||||
|
|
||||||
_glfwInputKey(window, key, scancode, action, _glfw.wl.xkb.modifiers);
|
_glfwInputKey(window, key, scancode, action, _glfw.wl.xkb.modifiers);
|
||||||
|
|
||||||
if (action == GLFW_PRESS)
|
if (action == GLFW_PRESS)
|
||||||
@ -2189,12 +2208,12 @@ void _glfwDestroyWindowWayland(_GLFWwindow* window)
|
|||||||
_glfw.wl.pointerFocus = NULL;
|
_glfw.wl.pointerFocus = NULL;
|
||||||
|
|
||||||
if (window == _glfw.wl.keyboardFocus)
|
if (window == _glfw.wl.keyboardFocus)
|
||||||
{
|
{
|
||||||
struct itimerspec timer = {0};
|
struct itimerspec timer = {0};
|
||||||
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
||||||
|
|
||||||
_glfw.wl.keyboardFocus = NULL;
|
_glfw.wl.keyboardFocus = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->wl.fractionalScale)
|
if (window->wl.fractionalScale)
|
||||||
wp_fractional_scale_v1_destroy(window->wl.fractionalScale);
|
wp_fractional_scale_v1_destroy(window->wl.fractionalScale);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ add_executable(allocator allocator.c ${GLAD_GL})
|
|||||||
add_executable(clipboard clipboard.c ${GETOPT} ${GLAD_GL})
|
add_executable(clipboard clipboard.c ${GETOPT} ${GLAD_GL})
|
||||||
add_executable(events events.c ${GETOPT} ${GLAD_GL})
|
add_executable(events events.c ${GETOPT} ${GLAD_GL})
|
||||||
add_executable(msaa msaa.c ${GETOPT} ${GLAD_GL})
|
add_executable(msaa msaa.c ${GETOPT} ${GLAD_GL})
|
||||||
add_executable(glfwinfo glfwinfo.c ${GETOPT} ${GLAD_GL} ${GLAD_VULKAN})
|
add_executable(glfwinfo glfwinfo.c glfwinfo.manifest ${GETOPT} ${GLAD_GL} ${GLAD_VULKAN})
|
||||||
add_executable(iconify iconify.c ${GETOPT} ${GLAD_GL})
|
add_executable(iconify iconify.c ${GETOPT} ${GLAD_GL})
|
||||||
add_executable(monitors monitors.c ${GETOPT} ${GLAD_GL})
|
add_executable(monitors monitors.c ${GETOPT} ${GLAD_GL})
|
||||||
add_executable(reopen reopen.c ${GLAD_GL})
|
add_executable(reopen reopen.c ${GLAD_GL})
|
||||||
|
|||||||
@ -61,6 +61,7 @@
|
|||||||
#define ANGLE_TYPE_OPENGLES "es"
|
#define ANGLE_TYPE_OPENGLES "es"
|
||||||
#define ANGLE_TYPE_D3D9 "d3d9"
|
#define ANGLE_TYPE_D3D9 "d3d9"
|
||||||
#define ANGLE_TYPE_D3D11 "d3d11"
|
#define ANGLE_TYPE_D3D11 "d3d11"
|
||||||
|
#define ANGLE_TYPE_D3D11ON12 "d3d11on12"
|
||||||
#define ANGLE_TYPE_VULKAN "vk"
|
#define ANGLE_TYPE_VULKAN "vk"
|
||||||
#define ANGLE_TYPE_METAL "mtl"
|
#define ANGLE_TYPE_METAL "mtl"
|
||||||
|
|
||||||
@ -129,6 +130,7 @@ static void usage(void)
|
|||||||
ANGLE_TYPE_OPENGLES ", "
|
ANGLE_TYPE_OPENGLES ", "
|
||||||
ANGLE_TYPE_D3D9 ", "
|
ANGLE_TYPE_D3D9 ", "
|
||||||
ANGLE_TYPE_D3D11 ", "
|
ANGLE_TYPE_D3D11 ", "
|
||||||
|
ANGLE_TYPE_D3D11ON12 ", "
|
||||||
ANGLE_TYPE_VULKAN " or "
|
ANGLE_TYPE_VULKAN " or "
|
||||||
ANGLE_TYPE_METAL ")\n");
|
ANGLE_TYPE_METAL ")\n");
|
||||||
printf(" --graphics-switching request macOS graphics switching\n");
|
printf(" --graphics-switching request macOS graphics switching\n");
|
||||||
@ -638,6 +640,8 @@ int main(int argc, char** argv)
|
|||||||
angle_type = GLFW_ANGLE_PLATFORM_TYPE_D3D9;
|
angle_type = GLFW_ANGLE_PLATFORM_TYPE_D3D9;
|
||||||
else if (strcmp(optarg, ANGLE_TYPE_D3D11) == 0)
|
else if (strcmp(optarg, ANGLE_TYPE_D3D11) == 0)
|
||||||
angle_type = GLFW_ANGLE_PLATFORM_TYPE_D3D11;
|
angle_type = GLFW_ANGLE_PLATFORM_TYPE_D3D11;
|
||||||
|
else if (strcmp(optarg, ANGLE_TYPE_D3D11ON12) == 0)
|
||||||
|
angle_type = GLFW_ANGLE_PLATFORM_TYPE_D3D11ON12;
|
||||||
else if (strcmp(optarg, ANGLE_TYPE_VULKAN) == 0)
|
else if (strcmp(optarg, ANGLE_TYPE_VULKAN) == 0)
|
||||||
angle_type = GLFW_ANGLE_PLATFORM_TYPE_VULKAN;
|
angle_type = GLFW_ANGLE_PLATFORM_TYPE_VULKAN;
|
||||||
else if (strcmp(optarg, ANGLE_TYPE_METAL) == 0)
|
else if (strcmp(optarg, ANGLE_TYPE_METAL) == 0)
|
||||||
|
|||||||
40
tests/glfwinfo.manifest
Normal file
40
tests/glfwinfo.manifest
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<assemblyIdentity
|
||||||
|
type="win32"
|
||||||
|
name="glfw.glfw.glfwinfo"
|
||||||
|
version="3.4.0.0"
|
||||||
|
processorArchitecture="x86"
|
||||||
|
/>
|
||||||
|
<description>GLFW context creation and information tool</description>
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- Windows 10 and Windows 11 -->
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||||
|
<!-- Windows 8 -->
|
||||||
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||||
|
<!-- Windows Vista -->
|
||||||
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges>
|
||||||
|
<!--
|
||||||
|
UAC settings:
|
||||||
|
- app should run at same integrity level as calling process
|
||||||
|
- app does not need to manipulate windows belonging to
|
||||||
|
higher-integrity-level processes
|
||||||
|
-->
|
||||||
|
<requestedExecutionLevel
|
||||||
|
level="asInvoker"
|
||||||
|
uiAccess="false"
|
||||||
|
/>
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
</assembly>
|
||||||
Loading…
Reference in New Issue
Block a user