#include <juce_OpenGL_windows.h>


Classes | |
| struct | ContextDestructor |
| struct | DeviceContextDeleter |
| struct | DummyComponent |
| struct | Locker |
| class | MinSwapTimeMs |
| struct | MouseForwardingNSOpenGLViewClass |
| struct | NativeWindowReleaser |
| struct | PlaceholderComponent |
| struct | RenderContextDeleter |
| class | ScopedGLXObject |
| struct | SurfaceDestructor |
| struct | TraitsGLXContext |
| struct | TraitsGLXWindow |
Public Member Functions | |
| NativeContext (Component &c, const OpenGLPixelFormat &pixFormat, void *contextToShare, bool multisampling, OpenGLVersion version) | |
| NativeContext (Component &comp, const OpenGLPixelFormat &cPixelFormat, void *shareContext, bool useMultisamplingIn, OpenGLVersion) | |
| NativeContext (Component &comp, const OpenGLPixelFormat &pixelFormat, void *, bool useMultisamplingIn, OpenGLVersion) | |
| NativeContext (Component &component, const OpenGLPixelFormat &pixelFormat, void *contextToShareWithIn, bool, OpenGLVersion version) | |
| NativeContext (Component &component, const OpenGLPixelFormat &pixFormat, void *contextToShare, bool shouldUseMultisampling, OpenGLVersion version) | |
| ~NativeContext () | |
| ~NativeContext () | |
| ~NativeContext () | |
| ~NativeContext () override | |
| ~NativeContext () override | |
| void | addListener (NativeContextListener &) |
| void | addListener (NativeContextListener &) |
| void | addListener (NativeContextListener &) |
| void | addListener (NativeContextListener &) |
| void | addListener (NativeContextListener &l) |
| bool | createdOk () const noexcept |
| bool | createdOk () const noexcept |
| bool | createdOk () const noexcept |
| bool | createdOk () const noexcept |
| bool | createdOk () const noexcept |
| GLuint | getFrameBufferID () const noexcept |
| GLuint | getFrameBufferID () const noexcept |
| GLuint | getFrameBufferID () const noexcept |
| GLuint | getFrameBufferID () const noexcept |
| unsigned int | getFrameBufferID () const noexcept |
| HWND | getNativeHandle () |
| NSOpenGLView * | getNSView () const noexcept |
| void * | getRawContext () const noexcept |
| void * | getRawContext () const noexcept |
| void * | getRawContext () const noexcept |
| NSOpenGLContext * | getRawContext () const noexcept |
| void * | getRawContext () const noexcept |
| int | getSwapInterval () const |
| int | getSwapInterval () const |
| int | getSwapInterval () const |
| int | getSwapInterval () const |
| int | getSwapInterval () const noexcept |
| InitResult | initialiseOnRenderThread (OpenGLContext &) |
| InitResult | initialiseOnRenderThread (OpenGLContext &) |
| InitResult | initialiseOnRenderThread (OpenGLContext &c) |
| InitResult | initialiseOnRenderThread (OpenGLContext &c) |
| InitResult | initialiseOnRenderThread (OpenGLContext &ctx) |
| bool | isActive () const noexcept |
| bool | isActive () const noexcept |
| bool | isActive () const noexcept |
| bool | isActive () const noexcept |
| bool | isActive () const noexcept |
| bool | makeActive () const noexcept |
| bool | makeActive () const noexcept |
| bool | makeActive () const noexcept |
| bool | makeActive () const noexcept |
| bool | makeActive () const noexcept |
| void | notifyDidResume () |
| void | notifyWillPause () |
| void | removeListener (NativeContextListener &) |
| void | removeListener (NativeContextListener &) |
| void | removeListener (NativeContextListener &) |
| void | removeListener (NativeContextListener &) |
| void | removeListener (NativeContextListener &l) |
| void | setNominalVideoRefreshPeriodS (double periodS) |
| bool | setSwapInterval (int numFramesPerSwap) |
| bool | setSwapInterval (int numFramesPerSwap) |
| bool | setSwapInterval (int numFramesPerSwap) noexcept |
| bool | setSwapInterval (int numFramesPerSwapIn) |
| bool | setSwapInterval (int) |
| void | shutdownOnRenderThread () |
| void | shutdownOnRenderThread () |
| void | shutdownOnRenderThread () |
| void | shutdownOnRenderThread () |
| void | shutdownOnRenderThread () |
| void | surfaceChanged (LocalRef< jobject > holder, int format, int width, int height) override |
| void | surfaceCreated (LocalRef< jobject >) override |
| void | surfaceDestroyed (LocalRef< jobject >) override |
| void | swapBuffers () |
| void | swapBuffers () |
| void | swapBuffers () |
| void | swapBuffers () const noexcept |
| void | swapBuffers () noexcept |
| void | triggerRepaint () |
| void | triggerRepaint () |
| void | updateWindowPosition (Rectangle< int > bounds) |
| void | updateWindowPosition (Rectangle< int > bounds) |
| void | updateWindowPosition (Rectangle< int > bounds) |
| void | updateWindowPosition (Rectangle< int > newBounds) |
| void | updateWindowPosition (Rectangle< int >) |
Static Public Member Functions | |
| static std::vector< NSOpenGLPixelFormatAttribute > | createAttribs (OpenGLVersion version, const OpenGLPixelFormat &pixFormat, bool shouldUseMultisampling) |
| static void | deactivateCurrentContext () |
| static void | deactivateCurrentContext () |
| static void | deactivateCurrentContext () |
| static void | deactivateCurrentContext () |
| static void | deactivateCurrentContext () |
| static NSOpenGLContextParameter | getSwapIntervalParameter () |
Public Attributes | |
| Component & | component |
| double | lastSwapTime = 0 |
| MinSwapTimeMs | minSwapTimeMs |
| Component & | owner |
| NSOpenGLContext * | renderContext = nil |
| int | underrunCounter = 0 |
| NSOpenGLView * | view = nil |
| ReferenceCountedObjectPtr< ReferenceCountedObject > | viewAttachment |
Private Types | |
| using | PtrGLXContext = ScopedGLXObject< TraitsGLXContext > |
| using | PtrGLXWindow = ScopedGLXObject< TraitsGLXWindow > |
Private Member Functions | |
| void | cancelPendingUpdate () noexcept |
| This will stop any pending updates from happening. | |
| void | clear () |
| bool | createContext (EAGLRenderingAPI type, void *contextToShare) |
| void | createGLBuffers () |
| void | createNativeWindow (Component &component) |
| void | freeGLBuffers () |
| void | handleAsyncUpdate () override |
| Called back to do whatever your class needs to do. | |
| void | handleUpdateNowIfNeeded () |
| If an update has been triggered and is pending, this will invoke it synchronously. | |
| bool | initEGLDisplay (const OpenGLPixelFormat &pixelFormat, bool multisample) |
| jobject | invoke (jobject proxy, jobject method, jobjectArray args) override |
| bool | isUpdatePending () const noexcept |
| Returns true if there's an update callback in the pipeline. | |
| void | nativeScaleFactorChanged (double newScaleFactor) override |
| Called when the scale factor changes. | |
| void | triggerAsyncUpdate () |
| Causes the callback to be triggered at a later time. | |
| bool | tryChooseConfig (const std::vector< EGLint > &optionalAttribs) |
| bool | tryChooseVisual (const OpenGLPixelFormat &format, const std::vector< GLint > &optionalAttribs) |
| int | wglChoosePixelFormatExtension (const OpenGLPixelFormat &pixelFormat) const |
Static Private Member Functions | |
| static HGLRC | createRenderContext (OpenGLVersion version, HDC dcIn) |
| static void | deleteFrameBuffer (GLuint &i) |
| static void | deleteRenderBuffer (GLuint &i) |
| static void | dispatchDraw (JNIEnv *, NativeContext &t, jobject) |
| static std::unique_ptr< ANativeWindow, NativeWindowReleaser > | getNativeWindowFromSurfaceHolder (jobject holder) |
| static void | initialisePixelFormatDescriptor (PIXELFORMATDESCRIPTOR &pfd, const OpenGLPixelFormat &pixelFormat) |
| static void | initialiseWGLExtensions (HDC dcIn) |
Static Private Attributes | |
| static EGLConfig | config |
| static EGLDisplay | display = EGL_NO_DISPLAY |
| static constexpr int | embeddedWindowEventMask = ExposureMask | StructureNotifyMask |
|
inline |
References component, juce::AndroidInterfaceImplementer::CreateJavaInterface, juce::GlobalRefImpl< JavaType >::get(), juce::getAppContext(), juce::getEnv(), juce::Component::getLocalBounds(), juce::ComponentPeer::getNativeHandle(), juce::Component::getPeer(), hasInitialised, initEGLDisplay(), juce::Component::localAreaToGlobal(), surfaceHolderCallback, surfaceView, and updateWindowPosition().
|
inlineoverride |
References juce::GlobalRefImpl< JavaType >::get(), juce::getEnv(), surfaceHolderCallback, and surfaceView.
|
inline |
References jassert, jassertfalse, and JUCE_AUTORELEASEPOOL.
|
inline |
References view.
|
inline |
References bestConfig, component, display, dummy, embeddedWindow, embeddedWindowEventMask, juce::Desktop::getDisplays(), juce::Desktop::getInstance(), juce::Component::getLocalArea(), juce::Component::getLocalBounds(), juce::Component::getPeer(), juce::Component::getTopLevelComponent(), jassert, juce::jmax(), juce::juce_LinuxAddRepaintListener(), juce::Displays::logicalToPhysical(), juce::OpenGLPixelFormat::multisamplingLevel, peerListener, and tryChooseVisual().
|
inline |
|
inline |
|
inline |
References renderContext, and view.
|
inline |
References component, createNativeWindow(), createRenderContext(), dc, deactivateCurrentContext(), juce::Component::getTopLevelComponent(), initialisePixelFormatDescriptor(), initialiseWGLExtensions(), makeActive(), nativeWindow, placeholderComponent, renderContext, juce::Component::repaint(), juce::OpenGLContext::NativeContext::ScopedGLXObject< Traits >::reset(), and wglChoosePixelFormatExtension().
|
inlineoverride |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References juce::ListenerList< ListenerClass, ArrayType >::add(), and listeners.
|
noexceptinherited |
This will stop any pending updates from happening.
If called after triggerAsyncUpdate() and before the handleAsyncUpdate() callback happens, this will cancel the handleAsyncUpdate() callback.
Note that this method simply cancels the next callback - if a callback is already in progress on a different thread, this won't block until the callback finishes, so there's no guarantee that the callback isn't still running when the method returns.
Referenced by juce::detail::ConcreteScopedContentSharerImpl::~ConcreteScopedContentSharerImpl(), juce::detail::ConcreteScopedMessageBoxImpl::~ConcreteScopedMessageBoxImpl(), ~NativeContext(), juce::detail::ConcreteScopedContentSharerImpl::close(), juce::detail::ConcreteScopedMessageBoxImpl::close(), and juce::detail::MouseInputSourceImpl::setPointerState().
|
protectedinherited |
|
inlinestatic |
References juce::OpenGLPixelFormat::accumulationBufferAlphaBits, juce::OpenGLPixelFormat::accumulationBufferBlueBits, juce::OpenGLPixelFormat::accumulationBufferGreenBits, juce::OpenGLPixelFormat::accumulationBufferRedBits, juce::OpenGLPixelFormat::alphaBits, juce::OpenGLPixelFormat::blueBits, juce::OpenGLContext::defaultGLVersion, juce::OpenGLPixelFormat::depthBufferBits, juce::OpenGLPixelFormat::greenBits, juce::OpenGLPixelFormat::multisamplingLevel, juce::OpenGLContext::openGL3_2, juce::OpenGLPixelFormat::redBits, and juce::OpenGLPixelFormat::stencilBufferBits.
Referenced by NativeContext().
|
inlineprivate |
References jassert.
|
inlinenoexcept |
References hasInitialised.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
References getRawContext().
|
inlinenoexcept |
References getRawContext().
|
inlineprivate |
References jassert.
|
inlineprivate |
|
inlinestaticprivate |
References juce::OpenGLContext::defaultGLVersion, juce::OpenGLContext::openGL3_2, juce::OpenGLContext::openGL4_1, and juce::OpenGLContext::openGL4_3.
Referenced by NativeContext().
|
inlinestatic |
References display.
Referenced by NativeContext(), and shutdownOnRenderThread().
|
inlinestatic |
|
inlinestatic |
References display.
|
inlinestatic |
|
inlinestatic |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlineprivate |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
References nativeWindow.
|
inlinestaticprivate |
References juce::LocalRef< JavaType >::get(), juce::getEnv(), and juce::Thread::sleep().
|
inlinenoexcept |
References view.
|
inlinenoexcept |
References juce::GlobalRefImpl< JavaType >::get(), and surfaceView.
Referenced by createdOk().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
References renderContext.
|
inlinenoexcept |
|
inline |
|
inline |
References swapFrames.
|
inline |
References getSwapIntervalParameter(), and renderContext.
|
inline |
References isActive(), and jassert.
|
inlinenoexcept |
|
inlinestatic |
Referenced by getSwapInterval(), and setSwapInterval().
|
inlineoverrideprivatevirtual |
Called back to do whatever your class needs to do.
This method is called by the message thread at the next convenient time after the triggerAsyncUpdate() method has been called.
Implements juce::AsyncUpdater.
References nativeWindow.
|
inherited |
If an update has been triggered and is pending, this will invoke it synchronously.
Use this as a kind of "flush" operation - if an update is pending, the handleAsyncUpdate() method will be called immediately; if no update is pending, then nothing will be done.
Because this may invoke the callback, this method must only be called on the main event thread.
|
inlineprivate |
References display, jassertfalse, juce::OpenGLPixelFormat::multisamplingLevel, and tryChooseConfig().
Referenced by NativeContext().
|
inline |
|
inline |
References juce::OpenGLContext::success.
|
inline |
References bestConfig, context, contextToShareWith, juce::OpenGLContext::defaultGLVersion, display, embeddedWindow, juce::OpenGLContext::fatal, juce::OpenGLHelpers::getExtensionFunction(), glxWindow, juce::OpenGLContext::openGL3_2, juce::OpenGLContext::openGL4_1, juce::OpenGLContext::openGL4_3, renderContext, and juce::OpenGLContext::success.
|
inline |
|
inline |
|
inlinestaticprivate |
References juce::OpenGLPixelFormat::accumulationBufferAlphaBits, juce::OpenGLPixelFormat::accumulationBufferBlueBits, juce::OpenGLPixelFormat::accumulationBufferGreenBits, juce::OpenGLPixelFormat::accumulationBufferRedBits, juce::OpenGLPixelFormat::alphaBits, juce::OpenGLPixelFormat::blueBits, juce::OpenGLPixelFormat::depthBufferBits, juce::OpenGLPixelFormat::greenBits, juce::OpenGLPixelFormat::redBits, juce::OpenGLPixelFormat::stencilBufferBits, and juce::zerostruct().
Referenced by NativeContext().
|
inlinestaticprivate |
References JUCE_INIT_WGL_FUNCTION.
Referenced by NativeContext().
|
inlineoverrideprivatevirtualinherited |
Reimplemented from juce::AndroidInterfaceImplementer.
References juce::LocalRef< JavaType >::get(), juce::getEnv(), juce::AndroidInterfaceImplementer::invoke(), juce::SurfaceHolderCallback::surfaceChanged(), juce::SurfaceHolderCallback::surfaceCreated(), and juce::SurfaceHolderCallback::surfaceDestroyed().
|
inlinenoexcept |
References context, and nativeHandleMutex.
Referenced by getSwapInterval(), makeActive(), and setSwapInterval().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
References renderContext.
|
inlinenoexcept |
|
noexceptinherited |
Returns true if there's an update callback in the pipeline.
|
inlinenoexcept |
References context, display, hasInitialised, nativeHandleMutex, and surface.
Referenced by NativeContext().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
References context, jassert, renderContext, and view.
|
inlinenoexcept |
|
inlineoverrideprivatevirtual |
Called when the scale factor changes.
Implements juce::ComponentPeer::ScaleFactorListener.
References juce::approximatelyEqual(), nativeScaleFactor, safeComponent, and updateWindowPosition().
|
inline |
References juce::ListenerList< ListenerClass, ArrayType >::call(), and listeners.
|
inline |
References juce::ListenerList< ListenerClass, ArrayType >::call(), and listeners.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References listeners, and juce::ListenerList< ListenerClass, ArrayType >::remove().
|
inline |
|
inline |
|
inline |
References isActive(), and jassert.
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
References juceContext, and nativeHandleMutex.
|
inline |
|
inline |
|
inline |
References deactivateCurrentContext().
|
inline |
References context, deactivateCurrentContext(), and threadAwarenessSetter.
|
inlineoverridevirtual |
Implements juce::SurfaceHolderCallback.
Implements juce::SurfaceHolderCallback.
Implements juce::SurfaceHolderCallback.
|
inline |
References context, glResolveMultisampleFramebufferAPPLE(), and juce::roundToInt().
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
References dc, haveBuffersBeenSwapped, and juce::AsyncUpdater::triggerAsyncUpdate().
|
inherited |
Causes the callback to be triggered at a later time.
This method returns immediately, after which a callback to the handleAsyncUpdate() method will be made by the message thread as soon as possible.
If an update callback is already pending but hasn't happened yet, calling this method will have no effect.
It's thread-safe to call this method from any thread, BUT beware of calling it from a real-time (e.g. audio) thread, because it involves posting a message to the system queue, which means it may block (and in general will do on most OSes).
Referenced by juce::detail::TemporaryFilesDecorator::runAsync(), swapBuffers(), and juce::detail::MouseInputSourceImpl::triggerFakeMove().
|
inline |
|
inline |
References context.
|
inlineprivate |
References config, and display.
Referenced by initEGLDisplay().
|
inlineprivate |
References bestConfig, display, and juce::makeXFreePtr().
Referenced by NativeContext().
|
inline |
References bounds, juce::GlobalRefImpl< JavaType >::get(), juce::Desktop::getDisplays(), juce::getEnv(), juce::Desktop::getInstance(), juce::Displays::logicalToPhysical(), physicalBounds, surfaceView, juce::Rectangle< ValueType >::toFloat(), and juce::Rectangle< ValueType >::toNearestInt().
Referenced by NativeContext(), createNativeWindow(), and nativeScaleFactorChanged().
|
inline |
|
inline |
|
inline |
References bounds, display, embeddedWindow, juce::Desktop::getDisplays(), juce::Rectangle< ValueType >::getHeight(), juce::Desktop::getInstance(), juce::Rectangle< ValueType >::getWidth(), juce::Rectangle< ValueType >::getX(), juce::Rectangle< ValueType >::getY(), juce::jmax(), juce::Displays::logicalToPhysical(), and physicalBounds.
|
inline |
References juce::Component::getPeer(), juce::Component::getTopLevelComponent(), owner, and view.
|
inlineprivate |
References juce::OpenGLPixelFormat::accumulationBufferAlphaBits, juce::OpenGLPixelFormat::accumulationBufferBlueBits, juce::OpenGLPixelFormat::accumulationBufferGreenBits, juce::OpenGLPixelFormat::accumulationBufferRedBits, juce::OpenGLPixelFormat::alphaBits, juce::OpenGLPixelFormat::blueBits, dc, juce::OpenGLPixelFormat::depthBufferBits, juce::OpenGLPixelFormat::greenBits, juce::OpenGLHelpers::isExtensionSupported(), jassert, juce::OpenGLPixelFormat::multisamplingLevel, juce::numElementsInArray(), juce::OpenGLPixelFormat::redBits, and juce::OpenGLPixelFormat::stencilBufferBits.
Referenced by NativeContext().
|
privateinherited |
|
private |
Referenced by NativeContext(), initialiseOnRenderThread(), and tryChooseVisual().
|
private |
Referenced by updateWindowPosition(), and updateWindowPosition().
|
private |
| Component & juce::OpenGLContext::NativeContext::component |
Referenced by NativeContext(), NativeContext(), NativeContext(), NativeContext(), ~NativeContext(), and createNativeWindow().
|
inlinestaticprivate |
Referenced by tryChooseConfig().
|
private |
|
private |
|
private |
|
private |
Referenced by initialiseOnRenderThread().
|
private |
Referenced by NativeContext(), ~NativeContext(), createNativeWindow(), makeActive(), swapBuffers(), and wglChoosePixelFormatExtension().
|
private |
|
inlinestaticprivate |
Referenced by NativeContext(), ~NativeContext(), deactivateCurrentContext(), juce::OpenGLContext::NativeContext::TraitsGLXContext::destroy(), juce::OpenGLContext::NativeContext::TraitsGLXWindow::destroy(), initEGLDisplay(), initialiseOnRenderThread(), makeActive(), juce::OpenGLContext::NativeContext::ContextDestructor::operator()(), juce::OpenGLContext::NativeContext::SurfaceDestructor::operator()(), setSwapInterval(), swapBuffers(), swapBuffers(), tryChooseConfig(), tryChooseVisual(), and updateWindowPosition().
|
private |
|
private |
Referenced by NativeContext(), and ~NativeContext().
|
private |
Referenced by NativeContext(), ~NativeContext(), initialiseOnRenderThread(), and updateWindowPosition().
|
staticconstexprprivate |
Referenced by NativeContext(), and ~NativeContext().
|
private |
|
private |
|
private |
Referenced by initialiseOnRenderThread(), makeActive(), setSwapInterval(), shutdownOnRenderThread(), and swapBuffers().
|
private |
Referenced by NativeContext(), createdOk(), initialiseOnRenderThread(), and makeActive().
|
private |
Referenced by swapBuffers().
|
privateinherited |
|
privateinherited |
|
private |
Referenced by initialiseOnRenderThread(), and shutdownOnRenderThread().
|
private |
| double juce::OpenGLContext::NativeContext::lastSwapTime = 0 |
Referenced by swapBuffers().
|
private |
Referenced by addListener(), notifyDidResume(), notifyWillPause(), and removeListener().
| MinSwapTimeMs juce::OpenGLContext::NativeContext::minSwapTimeMs |
Referenced by setNominalVideoRefreshPeriodS(), setSwapInterval(), and swapBuffers().
|
private |
|
private |
|
private |
|
mutableprivate |
Referenced by initialiseOnRenderThread(), isActive(), makeActive(), and shutdownOnRenderThread().
|
private |
Referenced by createNativeWindow(), nativeScaleFactorChanged(), and updateWindowPosition().
|
private |
|
private |
|
private |
| Component& juce::OpenGLContext::NativeContext::owner |
Referenced by updateWindowPosition().
|
private |
Referenced by NativeContext().
|
private |
Referenced by updateWindowPosition(), and updateWindowPosition().
|
private |
Referenced by NativeContext(), and createNativeWindow().
|
private |
| NSOpenGLContext* juce::OpenGLContext::NativeContext::renderContext = nil |
|
private |
|
private |
Referenced by ~NativeContext(), createNativeWindow(), and nativeScaleFactorChanged().
|
private |
Referenced by initialiseOnRenderThread().
|
private |
Referenced by initialiseOnRenderThread(), makeActive(), and swapBuffers().
|
private |
Referenced by NativeContext(), and ~NativeContext().
|
private |
Referenced by NativeContext(), ~NativeContext(), getRawContext(), and updateWindowPosition().
|
private |
Referenced by getSwapInterval(), and setSwapInterval().
|
private |
Referenced by initialiseOnRenderThread(), and shutdownOnRenderThread().
| int juce::OpenGLContext::NativeContext::underrunCounter = 0 |
Referenced by swapBuffers().
|
private |
|
private |
|
private |
Referenced by NativeContext(), ~NativeContext(), getNSView(), makeActive(), and updateWindowPosition().
| NSOpenGLView* juce::OpenGLContext::NativeContext::view = nil |
| ReferenceCountedObjectPtr<ReferenceCountedObject> juce::OpenGLContext::NativeContext::viewAttachment |
Referenced by NativeContext().