Commit Graph

90 Commits

Author SHA1 Message Date
Ioannis Tsakpinis db85858062 Fix context API checks in native access functions
(cherry picked from commit 727db55c3a)
2021-10-28 12:29:57 +02:00
Camilla Löwy 2d3ce6eaae Make native access functions verify context API
The native access functions for context handles did not verify that the
context had been created with the same API the function was for.

This makes these functions emit GLFW_NO_WINDOW_CONTEXT on API mismatch.

(cherry picked from commit cca9008db2)
2021-10-28 12:13:19 +02:00
Camilla Löwy 6e01359e36 Cocoa: Fix call to NSWindow from non-main threads
glfwSwapBuffers may be called by any thread but NSWindow may not.

Bug introduced by c3ca88055f and reported
by @crujose.

(cherry picked from commit 949275bbed)
2020-05-19 14:33:15 +02:00
Camilla Löwy bb8ed627bf NSGL: Simulate vsync for occluded windows
This only supports a swap interval of zero or one, as that is all NSGL
supports.

(cherry picked from commit c3ca88055f)
2019-12-31 23:08:11 +01:00
Camilla Löwy ccb54c3e05 NSGL: Remove problematic swap interval workaround
Fixes #1483.

(cherry picked from commit 54e8e0b092)
2019-12-31 23:08:05 +01:00
Camilla Löwy e135210cb3 NSGL: Fix disabling of Retina resolution
It appears the default is now YES.

Fixes #1442.

(cherry picked from commit fa60269245)
2019-12-19 06:38:22 +01:00
Camilla Löwy e662492169 Cocoa: Cleanup
Readability fix, does not affect generated code.

(cherry picked from commit bd452016be)
2019-11-14 21:33:56 +01:00
Camilla Löwy b436d8e3e6 Remove pointless comments
(cherry picked from commit 84ec99bb01)
2019-05-27 16:34:23 +02:00
Camilla Löwy 04522580ad Add C dialect reminders to each source file
Files built for Win32 must use C89 style declarations for compatibility
with VS 2010 and 2012, which are still supported by GLFW.

(cherry picked from commit 56aad76b16)
2019-05-27 16:33:22 +02:00
Camilla Löwy ab118b2529 Fix copyright years (somewhat) 2019-04-15 20:50:00 +02:00
Camilla Löwy 28f118f4de NSGL: Disable swap interval
Swap interval now uses CVDisplayLink.
2019-04-15 14:36:12 +02:00
Camilla Löwy c585bf010b Fix file flags 2019-04-07 20:44:21 +02:00
Camilla Löwy 297999c9e1 Add missing SDL2 attribution 2019-04-01 17:42:27 +02:00
Camilla Löwy 1fca33b3c1 Cocoa: Remove checks for pre-10.8 SDK
OS X 10.8 is now the minimum required version but these checks were not
removed when that change was made.
2019-03-27 20:03:05 +01:00
Camilla Löwy 980fc9b52f Cocoa: Apply retina window hint to Metal layer
Related to #1340.
2019-03-27 17:14:30 +01:00
Camilla Löwy 056c5d3f90 Cleanup 2019-03-27 01:26:39 +01:00
Camilla Löwy 8d7e5cdb49 NSGL: Update current display for display link
This solution of one display link per window is far from ideal but is
still better than no solution.

As a side-effect this fixes swap interval breaking being ignored for
occluded windows on earlier versions of macOS.

Fixes #680.
Fixes #1337.
Related to #1417.
Fixes #1435.
2019-03-05 20:22:00 +01:00
Camilla Löwy f8bcc7e65c NSGL: Fix leak of condition object
Related to #1417.
2019-03-05 20:22:00 +01:00
Camilla Löwy ba761ab06e NSGL: Fix display link leaking and left running
Related to #1417.
2019-03-05 20:22:00 +01:00
Camilla Löwy d0e8d06d95 Cleanup
Related to #1417.
2019-03-05 20:22:00 +01:00
Camilla Löwy 3615d437a7 Formatting
Related to #1417.
2019-03-05 20:22:00 +01:00
amarcu5 82ca58da04 NSGL: Implement swap interval with CVDisplayLink
This fixes OpenGL swap interval (vsync) on macOS 10.14 Mojave by using
CVDisplayLink to synchronise to the monitor refresh rate rather than
setting NSOpenGLContextParameterSwapInterval.

Solution based on advice provided by @rcgordon.

Closes #1417.
2019-03-05 20:21:56 +01:00
Camilla Löwy 4e3204d86d Cocoa: Replace global autorelease pool with blocks
This is another small step towards having GLFW play nice with other
toolkits sharing the same process, including AppKit.

Any macOS platform function that touches Cocoa must now wrap itself in
an autoreleasepool block.

Since GLFW no longer provides an autoreleasepool outside of its
functions, THIS MAY BREAK EXISTING CODE MIXING GLFW AND COCOA.  Sorry!
Please add your own autoreleasepool blocks as needed.

Fixes #1107.
Closes #1114.
2019-03-05 20:11:20 +01:00
Camilla Löwy 6dfc12a439 Cocoa: Fix some macOS 10.14 deprecation warnings 2018-10-26 15:19:48 +02:00
Camilla Löwy 5f8108e8a9 Cocoa: Fix SDK version numbers
The pattern for version 10.10 and later was incorrectly applied to
version number for 10.8.

Fixes #1232.
2018-03-20 01:03:37 +01:00
Bailey Cosier 93e66661d3 Cleanup
This is an extract of a commit, minimally edited to ensure it compiles.

Closes #1078.
Related to #197.
2017-09-27 21:33:03 +02:00
Cem Karan ac009a5f5c Cocoa: Implement GLFW_TRANSPARENT
This is an extract of a commit, minimally edited to ensure it compiles.

Closes #663.
Related to #197.
2017-09-27 21:33:03 +02:00
Camilla Löwy 32f482a6d8 Cleanup 2017-06-08 16:38:45 +02:00
Camilla Löwy 0321bec232 Documentation work
[ci skip]
2017-06-08 16:09:17 +02:00
Camilla Löwy 14a3fe0ac0 Make glfwGetError also provide description
Related to #970.
2017-06-08 16:08:36 +02:00
Camilla Löwy aaf2800c9c Add internal TLS support
Related to #970.
2017-03-19 00:52:46 +01:00
Camilla Löwy 77a8f103d8 Add GLFW_COCOA_GRAPHICS_SWICTHING
This provides control over whether the context should participate in
macOS Automatic Graphics Switching.

Closes #377.
Closes #935.
2017-02-10 01:29:29 +01:00
Camilla Löwy d92bb41e25 Fix typo
[ci skip]
2016-12-06 13:59:04 +01:00
Camilla Löwy 69e351b44a Cleanup
[ci skip]
2016-12-06 13:58:52 +01:00
Camilla Löwy fd127d59fa Cocoa: Improve OpenGL version restriction messages
Fixes #904.
2016-12-03 20:15:26 +01:00
Camilla Löwy f4d0c83181 Paperwork done 2016-11-30 14:00:41 +01:00
Camilla Berglund 8d6f265441 Update default name from OS X to macOS
Note that earlier releases are still referred to by their proper names;
OS X <version> or Mac OS X <version>.
2016-10-20 00:53:37 +02:00
Camilla Berglund 7f9840cecf Cocoa: Fix macOS 10.12 deprecation warnings 2016-10-09 01:39:31 +02:00
Camilla Berglund 53fafad915 Start 3.3 2016-08-18 23:55:49 +02:00
Camilla Berglund d5e00e6b0f Initialize context creation APIs on demand 2016-07-20 13:10:51 +02:00
Camilla Berglund f2ba78e04b Rename static functions to allow unity build
Fixes regression introduced by GLFW_CONTEXT_CREATION_API.

Fixes #783.
2016-06-15 01:35:07 +02:00
Camilla Berglund 757eea2779 Update email address 2016-06-01 21:25:20 +02:00
Camilla Berglund 6a8e169001 Update copyright notice year 2016-06-01 21:25:19 +02:00
Camilla Berglund bda031f4ac Cleanup 2016-05-29 15:34:08 +02:00
Camilla Berglund ef80beab81 Add run-time context creation API selection
Fixes #145.
2016-05-04 17:00:07 +02:00
Camilla Berglund 45efb935c5 Use more GLFWbool 2015-12-13 15:09:33 +01:00
Camilla Berglund 12b6c56903 Add suffixes to platform specific helper functions
Also merge win32_tls.h into win32_platform.h.
2015-12-13 14:50:59 +01:00
Camilla Berglund d4079ad3a2 Move all context related members to _GLFWcontext 2015-11-09 23:52:02 +01:00
Camilla Berglund 496f559c9a Add GLFW_NO_API for creating context-less windows 2015-10-26 00:30:30 +01:00
Camilla Berglund 5fd9709a8b Remove support for OS X 10.6 2015-10-24 21:52:00 +02:00