Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glfw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
glfw
Commits
97892c60
Commit
97892c60
authored
Apr 7, 2024
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Cocoa: Add QuartzCore as a link-time dependency
parent
8b574030
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
docs/build.md
+3
-3
3 additions, 3 deletions
docs/build.md
src/CMakeLists.txt
+3
-2
3 additions, 2 deletions
src/CMakeLists.txt
src/cocoa_window.m
+3
-11
3 additions, 11 deletions
src/cocoa_window.m
with
10 additions
and
16 deletions
README.md
+
1
−
0
View file @
97892c60
...
@@ -123,6 +123,7 @@ information on what to include when reporting a bug.
...
@@ -123,6 +123,7 @@ information on what to include when reporting a bug.
-
Added
`GLFW_UNLIMITED_MOUSE_BUTTONS`
input mode that allows mouse buttons beyond
-
Added
`GLFW_UNLIMITED_MOUSE_BUTTONS`
input mode that allows mouse buttons beyond
the limit of the mouse button tokens to be reported (#2423)
the limit of the mouse button tokens to be reported (#2423)
-
[Cocoa] Added
`QuartzCore`
framework as link-time dependency
-
[Cocoa] Removed support for OS X 10.10 Yosemite and earlier (#2506)
-
[Cocoa] Removed support for OS X 10.10 Yosemite and earlier (#2506)
-
[Wayland] Bugfix: The fractional scaling related objects were not destroyed
-
[Wayland] Bugfix: The fractional scaling related objects were not destroyed
-
[Wayland] Bugfix:
`glfwInit`
would segfault on compositor with no seat (#2517)
-
[Wayland] Bugfix:
`glfwInit`
would segfault on compositor with no seat (#2517)
...
...
This diff is collapsed.
Click to expand it.
docs/build.md
+
3
−
3
View file @
97892c60
...
@@ -390,8 +390,8 @@ If you are using the dynamic library version of GLFW, add it to the project
...
@@ -390,8 +390,8 @@ If you are using the dynamic library version of GLFW, add it to the project
dependencies.
dependencies.
If you are using the static library version of GLFW, add it and the Cocoa,
If you are using the static library version of GLFW, add it and the Cocoa,
OpenGL
and
IOKit frameworks to the project as dependencies. They
can all be
OpenGL
,
IOKit
and QuartzCore
frameworks to the project as dependencies. They
found in
`/System/Library/Frameworks`
.
can all be
found in
`/System/Library/Frameworks`
.
### With command-line or makefile on macOS {#build_link_osx}
### With command-line or makefile on macOS {#build_link_osx}
...
@@ -405,7 +405,7 @@ command-line yourself using the `-l` and `-framework` switches.
...
@@ -405,7 +405,7 @@ command-line yourself using the `-l` and `-framework` switches.
If you are using the dynamic GLFW library, which is named
`libglfw.3.dylib`
, do:
If you are using the dynamic GLFW library, which is named
`libglfw.3.dylib`
, do:
```
sh
```
sh
cc
-o
myprog myprog.c
-lglfw
-framework
Cocoa
-framework
OpenGL
-framework
IOKit
cc
-o
myprog myprog.c
-lglfw
-framework
Cocoa
-framework
OpenGL
-framework
IOKit
-framework
QuartzCore
```
```
If you are using the static library, named
`libglfw3.a`
, substitute
`-lglfw3`
If you are using the static library, named
`libglfw3.a`
, substitute
`-lglfw3`
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
3
−
2
View file @
97892c60
...
@@ -151,10 +151,11 @@ endif()
...
@@ -151,10 +151,11 @@ endif()
if
(
GLFW_BUILD_COCOA
)
if
(
GLFW_BUILD_COCOA
)
target_link_libraries
(
glfw PRIVATE
"-framework Cocoa"
target_link_libraries
(
glfw PRIVATE
"-framework Cocoa"
"-framework IOKit"
"-framework IOKit"
"-framework CoreFoundation"
)
"-framework CoreFoundation"
"-framework QuartzCore"
)
set
(
glfw_PKG_DEPS
""
)
set
(
glfw_PKG_DEPS
""
)
set
(
glfw_PKG_LIBS
"-framework Cocoa -framework IOKit -framework CoreFoundation"
)
set
(
glfw_PKG_LIBS
"-framework Cocoa -framework IOKit -framework CoreFoundation
-framework QuartzCore
"
)
endif
()
endif
()
if
(
GLFW_BUILD_WAYLAND
)
if
(
GLFW_BUILD_WAYLAND
)
...
...
This diff is collapsed.
Click to expand it.
src/cocoa_window.m
+
3
−
11
View file @
97892c60
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
#if defined(_GLFW_COCOA)
#if defined(_GLFW_COCOA)
#import <QuartzCore/CAMetalLayer.h>
#include
<float.h>
#include
<float.h>
#include
<string.h>
#include
<string.h>
#include
<assert.h>
#include
<assert.h>
...
@@ -1948,18 +1950,8 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance,
...
@@ -1948,18 +1950,8 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance,
{
{
@autoreleasepool
{
@autoreleasepool
{
// HACK: Dynamically load Core Animation to avoid adding an extra
// dependency for the majority who don't use MoltenVK
NSBundle
*
bundle
=
[
NSBundle
bundleWithPath
:
@"/System/Library/Frameworks/QuartzCore.framework"
];
if
(
!
bundle
)
{
_glfwInputError
(
GLFW_PLATFORM_ERROR
,
"Cocoa: Failed to find QuartzCore.framework"
);
return
VK_ERROR_EXTENSION_NOT_PRESENT
;
}
// NOTE: Create the layer here as makeBackingLayer should not return nil
// NOTE: Create the layer here as makeBackingLayer should not return nil
window
->
ns
.
layer
=
[
[
bundle
classNamed
:
@"
CAMetalLayer
"
]
layer
];
window
->
ns
.
layer
=
[
CAMetalLayer
layer
];
if
(
!
window
->
ns
.
layer
)
if
(
!
window
->
ns
.
layer
)
{
{
_glfwInputError
(
GLFW_PLATFORM_ERROR
,
_glfwInputError
(
GLFW_PLATFORM_ERROR
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment