#include <juce_OpenGL_win32.h>
Classes | |
struct | DummyComponent |
struct | Locker |
struct | MouseForwardingNSOpenGLViewClass |
Static Public Member Functions | |
static void | createAttribs (NSOpenGLPixelFormatAttribute *attribs, 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 |
std::atomic< int > | minSwapTimeMs { 0 } |
int | numFramesPerSwap = 0 |
NSOpenGLContext * | renderContext = nil |
int | underrunCounter = 0 |
double | videoRefreshPeriodS = 1.0 / 60.0 |
NSOpenGLView * | view = nil |
ReferenceCountedObjectPtr< ReferenceCountedObject > | viewAttachment |
Private Member Functions | |
void | attachedToWindow () |
void | clear () |
bool | createContext (EAGLRenderingAPI type, void *contextToShare) |
void | createGLBuffers () |
void | createNativeWindow (Component &component) |
void | deleteRenderContext () |
void | detachedFromWindow () |
void | dispatchDraw (jobject) |
void | freeGLBuffers () |
bool | initEGLDisplay (const OpenGLPixelFormat &pixelFormat, bool multisample) |
jobject | invoke (jobject proxy, jobject method, jobjectArray args) override |
void | nativeScaleFactorChanged (double newScaleFactor) override |
void | releaseContext () |
void | releaseDC () |
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 | initialisePixelFormatDescriptor (PIXELFORMATDESCRIPTOR &pfd, const OpenGLPixelFormat &pixelFormat) |
static void | initialiseWGLExtensions (HDC dcIn) |
Static Private Attributes | |
static EGLConfig | config |
static EGLDisplay | display |
static constexpr int | embeddedWindowEventMask = ExposureMask | StructureNotifyMask |
Friends | |
struct | AndroidGLCallbacks |
|
inline |
References bounds, component, juce::GlobalRef::get(), juce::dsp::get(), juce::getAppContext(), juce::Component::getDesktopScaleFactor(), juce::getEnv(), juce::Component::getLocalArea(), juce::Component::getLocalBounds(), juce::ComponentPeer::getNativeHandle(), juce::Component::getPeer(), juce::Component::getTopLevelComponent(), hasInitialised, initEGLDisplay(), surfaceView, and updateWindowPosition().
|
inlineoverride |
References juce::GlobalRef::get(), juce::getEnv(), and surfaceView.
|
inline |
References jassertfalse, JUCE_AUTORELEASEPOOL, juce::gl::layer, and juce::gl::loadFunctions().
|
inline |
References view.
|
inline |
References bestVisual, 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, tryChooseVisual(), and juce::windowHandleXContext.
|
inline |
|
inline |
|
inline |
|
inline |
References component, createNativeWindow(), createRenderContext(), dc, deactivateCurrentContext(), deleteRenderContext(), dummyComponent, juce::Component::getTopLevelComponent(), initialisePixelFormatDescriptor(), initialiseWGLExtensions(), makeActive(), nativeWindow, releaseDC(), renderContext, juce::Component::repaint(), and wglChoosePixelFormatExtension().
|
inlineoverride |
References deleteRenderContext(), releaseDC(), and safeComponent.
|
inlineprivate |
|
protectedinherited |
|
inlinestatic |
References juce::OpenGLPixelFormat::accumulationBufferAlphaBits, juce::OpenGLPixelFormat::accumulationBufferBlueBits, juce::OpenGLPixelFormat::accumulationBufferGreenBits, juce::OpenGLPixelFormat::accumulationBufferRedBits, juce::OpenGLPixelFormat::alphaBits, juce::gl::attribs, juce::OpenGLPixelFormat::blueBits, juce::OpenGLPixelFormat::depthBufferBits, juce::OpenGLPixelFormat::greenBits, juce::ignoreUnused(), juce::OpenGLPixelFormat::multisamplingLevel, juce::OpenGLPixelFormat::redBits, and juce::OpenGLPixelFormat::stencilBufferBits.
|
inlineprivate |
References jassert.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
References getRawContext().
|
inlinenoexcept |
|
inlinenoexcept |
References hasInitialised.
|
inlineprivate |
References juce::gl::GL_COLOR_ATTACHMENT0, juce::gl::GL_DEPTH_ATTACHMENT, juce::gl::GL_DEPTH_COMPONENT16, juce::gl::GL_FRAMEBUFFER, juce::gl::GL_FRAMEBUFFER_COMPLETE, juce::gl::GL_RENDERBUFFER, juce::gl::GL_RENDERBUFFER_HEIGHT, juce::gl::GL_RENDERBUFFER_WIDTH, juce::gl::GL_RGBA8, juce::gl::height, juce::ignoreUnused(), jassert, and juce::gl::width.
|
inlineprivate |
|
inlinestaticprivate |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
References display.
|
inlinestatic |
References display.
Referenced by NativeContext(), and shutdownOnRenderThread().
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlineprivate |
References renderContext.
Referenced by NativeContext(), and ~NativeContext().
|
inlineprivate |
|
inlineprivate |
References juceContext, and juce::OpenGLContext::triggerRepaint().
|
inlineprivate |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
References nativeWindow.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
References renderContext.
|
inlinenoexcept |
References renderContext.
|
inlinenoexcept |
References juce::GlobalRef::get(), and surfaceView.
Referenced by createdOk().
|
inline |
References isActive(), and jassert.
|
inline |
|
inline |
|
inline |
References swapFrames.
|
inlinenoexcept |
|
inlinestatic |
|
inlineprivate |
References display, jassertfalse, juce::OpenGLPixelFormat::multisamplingLevel, and tryChooseConfig().
Referenced by NativeContext().
|
inline |
|
inline |
|
inline |
|
inline |
References juce::gl::c, context, nativeWindow, and threadAwarenessSetter.
|
inline |
References bestVisual, juce::gl::c, context, contextToShareWith, display, juce::gl::GL_TRUE, and renderContext.
|
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::anonymous_namespace{juce_android_JNIHelpers.h}::juceString(), juce::SurfaceHolderCallback::surfaceChanged(), juce::SurfaceHolderCallback::surfaceCreated(), and juce::SurfaceHolderCallback::surfaceDestroyed().
|
inlinenoexcept |
References renderContext.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
References renderContext.
|
inlinenoexcept |
References context.
Referenced by getSwapInterval(), makeActive(), and setSwapInterval().
|
inlinenoexcept |
References dc, isActive(), and renderContext.
|
inlinenoexcept |
References juce::gl::GL_FRAMEBUFFER.
|
inlinenoexcept |
References display, embeddedWindow, and renderContext.
|
inlinenoexcept |
References context, display, hasInitialised, and surface.
Referenced by NativeContext().
|
inlineoverrideprivate |
References juce::approximatelyEqual(), nativeScaleFactor, safeComponent, and updateWindowPosition().
|
inlineprivate |
|
inlineprivate |
References dc, and nativeWindow.
Referenced by NativeContext(), and ~NativeContext().
|
inline |
References jassert.
References isActive(), jassert, and numFramesPerSwap.
References juce::OpenGLHelpers::getExtensionFunction(), numFramesPerSwap, and swapFrames.
References juce::isPositiveAndBelow(), and jassert.
|
inline |
References context, deactivateCurrentContext(), and threadAwarenessSetter.
|
inline |
|
inline |
|
inline |
References context, deactivateCurrentContext(), display, and renderContext.
|
inline |
References context, display, hasInitialised, jassert, and surface.
|
inlineoverridevirtual |
Implements juce::SurfaceHolderCallback.
References juce::gl::format, juce::gl::height, juce::ignoreUnused(), and juce::gl::width.
|
overridevirtual |
Implements juce::SurfaceHolderCallback.
|
overridevirtual |
Implements juce::SurfaceHolderCallback.
|
inline |
|
inline |
References juce::Time::getMillisecondCounterHiRes(), int(), and juce::Thread::sleep().
|
inline |
References display, and embeddedWindow.
|
inlinenoexcept |
References dc.
|
inlinenoexcept |
|
inline |
References context.
|
inline |
References context.
Referenced by juce::OpenGLContext::NativeContext::DummyComponent::handleCommandMessage().
|
inlineprivate |
References config, and display.
Referenced by initEGLDisplay().
|
inlineprivate |
References bestVisual, display, and juce::gl::format.
Referenced by NativeContext().
|
inline |
References bounds, juce::GlobalRef::get(), juce::Desktop::getDisplays(), juce::getEnv(), juce::Desktop::getInstance(), juce::Displays::getPrimaryDisplay(), lastBounds, juce::gl::r, juce::Displays::Display::scale, and surfaceView.
Referenced by createNativeWindow(), NativeContext(), and nativeScaleFactorChanged().
|
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::gl::format, juce::gl::GL_TRUE, juce::OpenGLPixelFormat::greenBits, juce::OpenGLHelpers::isExtensionSupported(), jassert, juce::OpenGLPixelFormat::multisamplingLevel, juce::gl::n, juce::numElementsInArray(), juce::OpenGLPixelFormat::redBits, juce::OpenGLPixelFormat::stencilBufferBits, juce::gl::WGL_ACCELERATION_ARB, juce::gl::WGL_ACCUM_ALPHA_BITS_ARB, juce::gl::WGL_ACCUM_BLUE_BITS_ARB, juce::gl::WGL_ACCUM_GREEN_BITS_ARB, juce::gl::WGL_ACCUM_RED_BITS_ARB, juce::gl::WGL_ALPHA_BITS_ARB, juce::gl::WGL_BLUE_BITS_ARB, juce::gl::WGL_COLOR_BITS_ARB, juce::gl::WGL_DEPTH_BITS_ARB, juce::gl::WGL_DOUBLE_BUFFER_ARB, juce::gl::WGL_DRAW_TO_WINDOW_ARB, juce::gl::WGL_FULL_ACCELERATION_ARB, juce::gl::WGL_GREEN_BITS_ARB, juce::gl::WGL_PIXEL_TYPE_ARB, juce::gl::WGL_RED_BITS_ARB, juce::gl::WGL_SAMPLE_BUFFERS_ARB, juce::gl::WGL_SAMPLES_ARB, juce::gl::WGL_STENCIL_BITS_ARB, juce::gl::WGL_SUPPORT_OPENGL_ARB, and juce::gl::WGL_TYPE_RGBA_ARB.
Referenced by NativeContext().
|
friend |
|
private |
Referenced by initialiseOnRenderThread(), NativeContext(), tryChooseVisual(), and ~NativeContext().
Referenced by NativeContext(), and updateWindowPosition().
|
private |
Component & juce::OpenGLContext::NativeContext::component |
Referenced by createNativeWindow(), NativeContext(), and ~NativeContext().
|
staticprivate |
Referenced by initialiseOnRenderThread(), and tryChooseConfig().
|
private |
|
private |
|
private |
Referenced by initialiseOnRenderThread(), isActive(), makeActive(), shutdownOnRenderThread(), swapBuffers(), and triggerRepaint().
|
private |
Referenced by initialiseOnRenderThread().
|
private |
Referenced by createNativeWindow(), makeActive(), NativeContext(), releaseDC(), swapBuffers(), and wglChoosePixelFormatExtension().
|
private |
|
private |
|
staticprivate |
|
private |
Referenced by NativeContext(), and ~NativeContext().
|
private |
Referenced by createNativeWindow(), and NativeContext().
|
private |
Referenced by makeActive(), NativeContext(), swapBuffers(), updateWindowPosition(), and ~NativeContext().
|
staticconstexprprivate |
Referenced by NativeContext(), and ~NativeContext().
|
private |
|
private |
|
private |
Referenced by createdOk(), initialiseOnRenderThread(), makeActive(), NativeContext(), and shutdownOnRenderThread().
|
privateinherited |
|
privateinherited |
|
private |
Referenced by dispatchDraw(), and initialiseOnRenderThread().
Referenced by updateWindowPosition().
double juce::OpenGLContext::NativeContext::lastSwapTime = 0 |
std::atomic<int> juce::OpenGLContext::NativeContext::minSwapTimeMs { 0 } |
|
private |
|
private |
|
private |
Referenced by createNativeWindow(), nativeScaleFactorChanged(), and updateWindowPosition().
|
private |
Referenced by createNativeWindow(), getNativeHandle(), initialiseOnRenderThread(), NativeContext(), releaseDC(), and updateWindowPosition().
|
private |
int juce::OpenGLContext::NativeContext::numFramesPerSwap = 0 |
Referenced by setSwapInterval().
|
private |
NSOpenGLContext* juce::OpenGLContext::NativeContext::renderContext = nil |
|
private |
Referenced by deleteRenderContext(), getRawContext(), initialiseOnRenderThread(), isActive(), makeActive(), NativeContext(), and shutdownOnRenderThread().
|
private |
|
private |
Referenced by createNativeWindow(), nativeScaleFactorChanged(), and ~NativeContext().
|
private |
Referenced by initialiseOnRenderThread(), makeActive(), shutdownOnRenderThread(), and swapBuffers().
|
private |
Referenced by attachedToWindow(), and detachedFromWindow().
|
private |
|
private |
Referenced by getSwapInterval(), and setSwapInterval().
|
private |
Referenced by initialiseOnRenderThread(), and shutdownOnRenderThread().
int juce::OpenGLContext::NativeContext::underrunCounter = 0 |
|
private |
|
private |
double juce::OpenGLContext::NativeContext::videoRefreshPeriodS = 1.0 / 60.0 |
|
private |
Referenced by ~NativeContext().
NSOpenGLView* juce::OpenGLContext::NativeContext::view = nil |
ReferenceCountedObjectPtr<ReferenceCountedObject> juce::OpenGLContext::NativeContext::viewAttachment |