1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
Commit graph

164 commits

Author SHA1 Message Date
reuk
f2d0d9cde8
OpenGL: Add back CVDisplayLink-driven drawing 2022-12-14 11:12:32 +00:00
reuk
0fbd7d7b3f
Functional: Add ScopeGuard implementation 2022-11-02 11:38:29 +00:00
reuk
7e404118b5
OpenGL: Correctly report OpenGL rendering scale in Pro Tools 2022.7 on Windows 2022-09-27 15:18:21 +01:00
reuk
19175ff698
OpenGL: Ensure that macOS uses the same (sRGB) colour space everywhere 2022-09-27 15:18:21 +01:00
reuk
2ae87f95f1
OpenGL: Carry out all GL rendering on a single thread 2022-09-27 15:18:21 +01:00
reuk
ae3bfdb1d2
OpenGL: Avoid occasional deadlock when destroying contexts 2022-09-26 18:03:47 +01:00
reuk
ff1d5d6da4
OpenGL: Only assert on high-severity errors 2022-09-26 18:03:47 +01:00
reuk
8ec8e36f5c OpenGLContext: Swap buffers on the main thread
This change fixes an issue where opening multiple OpenGLContexts on
certain versions of macOS (observed on 10.13) could cause a deadlock.

The issue can be reproduced by:
- Attaching an OpenGL context to the AudioPluginDemo editor
- Opening multiple copies of the editor simultaneously in a plugin host.
  I tested with Live 10.

I also observed the issue in a standalone app that opened new windows
containing OpenGLContexts on a timer.
2022-08-31 17:42:48 +01:00
reuk
322aa64459 OpenGLContext: Share CVDisplayLinks with NSViewComponentPeer 2022-08-31 17:42:47 +01:00
reuk
b27af5def9 OpenGL: Tidying 2022-08-31 17:42:47 +01:00
reuk
e64f87b26c OpenGL: Allow setting window bounds from repaint callback
On Windows, the OpenGL context window sometimes receives a repaint
request after moving between screens with different scale factors.
If the screen has changed size/scale since the last paint operation,
failing to invalidate the painted area may cause the screen contents
to be drawn at the wrong scale until paint is next called.
2022-08-31 17:42:47 +01:00
reuk
02b5ab748a OpenGL: Add support for a few more OpenGL profiles
- 4.1 and 4.3 contexts can now be requested
- The requested context version is no longer ignored on Linux
- Debugging contexts are now enabled in Debug builds with GL 4.3
- Fixes a bug where glEnable(GL_TEXTURE_2D) was called in core profiles
2022-08-31 17:42:47 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
reuk
45ae98effd
OpenGLContext: Correctly size GL view when using a non-unity global scale 2022-02-23 10:56:12 +00:00
reuk
d3c4017685
OpenGLContext: Only create and use a VAO in contexts using the core profile 2022-02-18 16:43:27 +00:00
reuk
01e71bc351
OpenGL: Avoid races on viewportArea and scale data members 2022-01-27 18:43:22 +00:00
reuk
1ff05d3333
OpenGL: Avoid querying the native view hierarchy from a background thread on macOS 2021-12-15 14:14:07 +00:00
reuk
48c6087faf Thread: Update macOS thread priority calculation
The Apple threading documentation [^1] says the following:

> The second argument to pthread_setschedparam is the desired policy,
  which can currently be one of SCHED_FIFO (first in, first out),
  SCHED_RR (round-robin), or SCHED_OTHER. The SCHED_OTHER policy is
  generally used for extra policies that are specific to a given
  operating system, and should thus be avoided when writing portable
  code.

This appears to differ from the policy semantics on Linux and BSD, where
FIFO and RR are both explicitly real-time policies.

Therefore, on Linux/BSD we only enable the RR policy if the requested
priority is 8 or higher. Meanwhile, on macOS, we map all thread
priorities (0 - 10) onto the RR policy with an appropriate priority.

[^1]: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html
2021-12-14 22:50:09 +00:00
reuk
c5c9f080d3
OpenGL: Ensure context is initially drawn with correct scale on macOS 2021-12-03 10:15:51 +00:00
reuk
ea8b0a2d32
OpenGL: Ensure that GL views display at the correct scale on macOS 12
Previously, we were using the window's top-left position to determine
the scale to use for the OpenGLContext. However, on macOS the
backingScaleFactor of the window is not strictly related to the top-left
corner of the window, so the OpenGL view's scale could end up differing
from the backing scale factor when slowly moving a window between
displays with different backing scale factors.

On macOS, we now use the backing scale factor of the window's screen (as
maintained by AppKit), rather than trying to work out the correct
display and scale ourselves.
2021-12-01 15:44:07 +00:00
reuk
e97f7d1c6c
OpenGLContext: Use high-priority thread for OpenGL renderer to smooth animations on M1 machines 2021-11-24 16:20:37 +00:00
reuk
6d3504adfa
OpenGLContext: Fix thread/consistency warnings on macOS
Previously, Xcode's main thread checker would complain when selecting
the "OpenGL Renderer" in the DemoRunner on macOS.
2021-10-25 09:51:20 +01:00
reuk
f0d11f961b
OpenGLContext: Avoid reading from component on background thread 2021-09-22 10:23:05 +01:00
attila
5c933d4c4e macOS OpenGL: Use display refresh rate when rate limiting swapBuffers() 2021-09-10 17:47:00 +02:00
ed
f0002845d5 OpenGL: Correctly reset repaintEvent 2021-09-08 11:22:18 +01:00
reuk
90ad1877af
OpenGL: Only use vertex arrays if the GL version is greater or equal to 3 2021-07-14 14:49:15 +01:00
reuk
d64c4277b4
OpenGL: Reinstate ifdef which was removed accidentally 2021-07-14 14:47:56 +01:00
reuk
280d97eb79 OpenGL: Check at runtime whether non-power-of-two textures are supported 2021-07-05 12:21:36 +01:00
ed
dc61bd63e7 macOS: Manually reset repaint WaitableEvent when using CVDisplayLink 2021-06-15 10:15:02 +01:00
reuk
54423f6583
OpenGL: Add GLEW-inspired dynamic function loading 2021-05-26 11:23:49 +01:00
ed
b7e28541ca Replaced deprecated Displays methods 2020-10-27 12:38:59 +00:00
ed
009d685179 Updated all license headers 2020-06-29 08:30:22 +01:00
ed
05602341fc OpenGL: Take global scale factor into account when setting rendering scale on Windows 2020-05-29 16:55:56 +01:00
ed
281ae0b067 macOS: Render OpenGL frames on ThreadPoolJob instead of directly on the CVDisplayLink thread to avoid a deadlock 2020-05-20 11:45:44 +01:00
ed
270237be9b macOS: Disable CVDisplayLink driver when continuous repainting is false 2020-05-12 16:46:06 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00
ed
d77dae186d Windows: Fixed an OpenGL scale issue in high-DPI plug-ins 2020-03-17 16:22:19 +00:00
ed
99a17ad3a9 Windows: Fixed an issue with OpenGL rendering scale in plug-ins 2020-03-03 18:37:35 +00:00
ed
18523101be Windows: Refactored DPI handling in the VST wrapper and hosting code 2020-03-02 15:41:08 +00:00
ed
b2d8f45e14 Fixed a potential data race in OpenGLContext::CachedImage 2020-01-14 18:16:32 +00:00
Tom Poole
26027ca9c3 macOS: Use CVDisplayLink to drive OpenGL 2019-12-31 13:30:11 +00:00
ed
558ca3e5e6 OpenGL: Update native context window position when viewport size or scale changes in OpenGLContext::CachedImage::updateViewportSize() 2019-10-15 14:06:12 +01:00
ed
6dda52b98b OpenGL: Check frame buffer completeness in OpenGLContext::copyTexture() to avoid an GL_INVALID_FRAMEBUFFER_OPERATION error 2019-07-15 16:56:22 +01:00
Tom Poole
670f77f80c Fixed some Android compiler warnings 2019-06-06 16:50:12 +01:00
Tom Poole
16dd26649a Fixed some GCC compiler warnings and removed deprecated functions 2019-06-04 16:48:44 +01:00
Tom Poole
cbdf5e6d21 Fixed some compiler warnings 2019-03-08 18:01:17 +00:00
ed
853ec552f1 OpenGL: Use width and height when calculating transform 2019-01-23 10:59:51 +00:00
ed
eaf0f990d4 Replaced all uses of static_cast<Type&&> with std::move 2018-11-28 17:29:20 +00:00