JUCE  v5.1.1-3-g1a0b28c73
JUCE API
OpenGLContext::NativeContext Class Reference

#include <juce_OpenGL_win32.h>

Collaboration diagram for OpenGLContext::NativeContext:

Classes

struct  DummyComponent
 
struct  Locker
 
struct  MouseForwardingNSOpenGLViewClass
 

Public Member Functions

 NativeContext (Component &component, const OpenGLPixelFormat &pixFormat, void *contextToShare, bool shouldUseMultisampling, OpenGLVersion version)
 
 NativeContext (Component &component, const OpenGLPixelFormat &pixelFormat, void *contextToShareWith, bool, OpenGLVersion)
 
 NativeContext (Component &comp, const OpenGLPixelFormat &, void *, bool, OpenGLVersion)
 
 NativeContext (Component &comp, const OpenGLPixelFormat &cPixelFormat, void *shareContext, bool, OpenGLVersion)
 
 ~NativeContext ()
 
 ~NativeContext ()
 
 ~NativeContext ()
 
 ~NativeContext ()
 
bool createdOk () const noexcept
 
bool createdOk () const noexcept
 
bool createdOk () const noexcept
 
bool createdOk () const noexcept
 
void dispatchDraw (jobject canvas)
 
GLuint getFrameBufferID () const noexcept
 
unsigned int getFrameBufferID () const noexcept
 
GLuint getFrameBufferID () const noexcept
 
GLuint getFrameBufferID () const noexcept
 
void * getRawContext () const noexcept
 
void * getRawContext () const noexcept
 
void * getRawContext () const noexcept
 
void * getRawContext () const noexcept
 
int getSwapInterval () const
 
int getSwapInterval () const
 
int getSwapInterval () const
 
int getSwapInterval () const
 
void initialiseOnRenderThread (OpenGLContext &c)
 
void initialiseOnRenderThread (OpenGLContext &aContext)
 
void initialiseOnRenderThread (OpenGLContext &)
 
void initialiseOnRenderThread (OpenGLContext &c)
 
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 setSwapInterval (int numFramesPerSwap)
 
bool setSwapInterval (const int)
 
bool setSwapInterval (int numFramesPerSwap)
 
bool setSwapInterval (int numFramesPerSwap)
 
void shutdownOnRenderThread ()
 
void shutdownOnRenderThread ()
 
void shutdownOnRenderThread ()
 
void shutdownOnRenderThread ()
 
void surfaceChanged (jobject holder, int format, int width, int height)
 
void surfaceCreated (jobject holder)
 
void surfaceDestroyed (jobject holder)
 
void swapBuffers () const noexcept
 
void swapBuffers ()
 
void swapBuffers () const noexcept
 
void swapBuffers ()
 
void triggerRepaint ()
 
void triggerRepaint ()
 
void updateWindowPosition (Rectangle< int > bounds)
 
void updateWindowPosition (Rectangle< int > bounds)
 
void updateWindowPosition (Rectangle< int > newBounds)
 
void updateWindowPosition (Rectangle< int >)
 

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 ()
 

Public Attributes

Componentcomponent
 
double lastSwapTime
 
int minSwapTimeMs
 
NSOpenGLContext * renderContext
 
int underrunCounter
 
NSOpenGLView * view
 
ReferenceCountedObjectPtr< ReferenceCountedObjectviewAttachment
 

Private Member Functions

void createNativeWindow (Component &component)
 
void deleteRenderContext ()
 
bool initEGLDisplay ()
 
void initialiseGLExtensions ()
 
void releaseDC ()
 
int wglChoosePixelFormatExtension (const OpenGLPixelFormat &pixelFormat) const
 

Static Private Member Functions

static void initialisePixelFormatDescriptor (PIXELFORMATDESCRIPTOR &pfd, const OpenGLPixelFormat &pixelFormat)
 

Private Attributes

XVisualInfo * bestVisual = {}
 
Rectangle< intbounds
 
OpenGLContextcontext = {}
 
EGLContext context = {}
 
void * contextToShareWith
 
HDC dc
 
::Display * display = {}
 
DummyComponent dummy
 
ScopedPointer< DummyComponentdummyComponent
 
Window embeddedWindow = {}
 
bool hasInitialised
 
OpenGLContextjuceContext
 
Rectangle< intlastBounds
 
ScopedPointer< ComponentPeernativeWindow
 
HGLRC renderContext
 
GLXContext renderContext = {}
 
EGLSurface surface
 
GlobalRef surfaceView
 
int swapFrames = 0
 

Static Private Attributes

static EGLConfig config
 
static EGLDisplay display
 

Constructor & Destructor Documentation

◆ NativeContext() [1/4]

◆ ~NativeContext() [1/4]

OpenGLContext::NativeContext::~NativeContext ( )
inline

References GlobalRef::get(), getEnv(), and surfaceView.

Referenced by JuceGLView::layerClass.

◆ NativeContext() [2/4]

◆ ~NativeContext() [2/4]

OpenGLContext::NativeContext::~NativeContext ( )
inline

◆ NativeContext() [3/4]

OpenGLContext::NativeContext::NativeContext ( Component component,
const OpenGLPixelFormat pixFormat,
void *  contextToShare,
bool  shouldUseMultisampling,
OpenGLVersion  version 
)
inline

◆ ~NativeContext() [3/4]

OpenGLContext::NativeContext::~NativeContext ( )
inline

References renderContext, and view.

◆ NativeContext() [4/4]

◆ ~NativeContext() [4/4]

OpenGLContext::NativeContext::~NativeContext ( )
inline

Member Function Documentation

◆ createAttribs()

◆ createdOk() [1/4]

bool OpenGLContext::NativeContext::createdOk ( ) const
inlinenoexcept

References getRawContext().

◆ createdOk() [2/4]

bool OpenGLContext::NativeContext::createdOk ( ) const
inlinenoexcept

References getRawContext().

◆ createdOk() [3/4]

bool OpenGLContext::NativeContext::createdOk ( ) const
inlinenoexcept

References hasInitialised.

Referenced by JuceGLView::layerClass.

◆ createdOk() [4/4]

bool OpenGLContext::NativeContext::createdOk ( ) const
inlinenoexcept

◆ createNativeWindow()

void OpenGLContext::NativeContext::createNativeWindow ( Component component)
inlineprivate

◆ deactivateCurrentContext() [1/4]

static void OpenGLContext::NativeContext::deactivateCurrentContext ( )
inlinestatic

◆ deactivateCurrentContext() [2/4]

static void OpenGLContext::NativeContext::deactivateCurrentContext ( )
inlinestatic

◆ deactivateCurrentContext() [3/4]

static void OpenGLContext::NativeContext::deactivateCurrentContext ( )
inlinestatic

◆ deactivateCurrentContext() [4/4]

static void OpenGLContext::NativeContext::deactivateCurrentContext ( )
inlinestatic

◆ deleteRenderContext()

void OpenGLContext::NativeContext::deleteRenderContext ( )
inlineprivate

Referenced by NativeContext(), and ~NativeContext().

◆ dispatchDraw()

void OpenGLContext::NativeContext::dispatchDraw ( jobject  canvas)
inline

◆ getFrameBufferID() [1/4]

GLuint OpenGLContext::NativeContext::getFrameBufferID ( ) const
inlinenoexcept

◆ getFrameBufferID() [2/4]

unsigned int OpenGLContext::NativeContext::getFrameBufferID ( ) const
inlinenoexcept

◆ getFrameBufferID() [3/4]

GLuint OpenGLContext::NativeContext::getFrameBufferID ( ) const
inlinenoexcept

Referenced by JuceGLView::layerClass.

◆ getFrameBufferID() [4/4]

GLuint OpenGLContext::NativeContext::getFrameBufferID ( ) const
inlinenoexcept

◆ getRawContext() [1/4]

void* OpenGLContext::NativeContext::getRawContext ( ) const
inlinenoexcept

References renderContext.

◆ getRawContext() [2/4]

void* OpenGLContext::NativeContext::getRawContext ( ) const
inlinenoexcept

References renderContext.

◆ getRawContext() [3/4]

void* OpenGLContext::NativeContext::getRawContext ( ) const
inlinenoexcept

References GlobalRef::get(), and surfaceView.

Referenced by createdOk(), and JuceGLView::layerClass.

◆ getRawContext() [4/4]

void* OpenGLContext::NativeContext::getRawContext ( ) const
inlinenoexcept

References renderContext.

◆ getSwapInterval() [1/4]

int OpenGLContext::NativeContext::getSwapInterval ( ) const
inline

References isActive(), and jassert.

◆ getSwapInterval() [2/4]

int OpenGLContext::NativeContext::getSwapInterval ( ) const
inline

Referenced by JuceGLView::layerClass.

◆ getSwapInterval() [3/4]

int OpenGLContext::NativeContext::getSwapInterval ( ) const
inline

References renderContext.

◆ getSwapInterval() [4/4]

int OpenGLContext::NativeContext::getSwapInterval ( ) const
inline

References swapFrames.

◆ initEGLDisplay()

bool OpenGLContext::NativeContext::initEGLDisplay ( )
inlineprivate

References config, display, and jassertfalse.

Referenced by NativeContext().

◆ initialiseGLExtensions()

void OpenGLContext::NativeContext::initialiseGLExtensions ( )
inlineprivate

References JUCE_INIT_WGL_FUNCTION.

Referenced by NativeContext().

◆ initialiseOnRenderThread() [1/4]

void OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext c)
inline

References context.

◆ initialiseOnRenderThread() [2/4]

void OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext aContext)
inline

◆ initialiseOnRenderThread() [3/4]

void OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext )
inline

◆ initialiseOnRenderThread() [4/4]

void OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext c)
inline

◆ initialisePixelFormatDescriptor()

◆ isActive() [1/4]

bool OpenGLContext::NativeContext::isActive ( ) const
inlinenoexcept

References renderContext.

◆ isActive() [2/4]

bool OpenGLContext::NativeContext::isActive ( ) const
inlinenoexcept

References renderContext.

◆ isActive() [3/4]

bool OpenGLContext::NativeContext::isActive ( ) const
inlinenoexcept

◆ isActive() [4/4]

bool OpenGLContext::NativeContext::isActive ( ) const
inlinenoexcept

References renderContext.

◆ makeActive() [1/4]

bool OpenGLContext::NativeContext::makeActive ( ) const
inlinenoexcept

References dc, isActive(), and renderContext.

◆ makeActive() [2/4]

bool OpenGLContext::NativeContext::makeActive ( ) const
inlinenoexcept

References context, jassert, renderContext, and view.

◆ makeActive() [3/4]

bool OpenGLContext::NativeContext::makeActive ( ) const
inlinenoexcept

◆ makeActive() [4/4]

bool OpenGLContext::NativeContext::makeActive ( ) const
inlinenoexcept

◆ releaseDC()

void OpenGLContext::NativeContext::releaseDC ( )
inlineprivate

◆ setSwapInterval() [1/4]

bool OpenGLContext::NativeContext::setSwapInterval ( int  numFramesPerSwap)
inline

References isActive(), and jassert.

◆ setSwapInterval() [2/4]

bool OpenGLContext::NativeContext::setSwapInterval ( const int  )
inline

Referenced by JuceGLView::layerClass.

◆ setSwapInterval() [3/4]

bool OpenGLContext::NativeContext::setSwapInterval ( int  numFramesPerSwap)
inline

◆ setSwapInterval() [4/4]

bool OpenGLContext::NativeContext::setSwapInterval ( int  numFramesPerSwap)
inline

References minSwapTimeMs, and renderContext.

◆ shutdownOnRenderThread() [1/4]

void OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

◆ shutdownOnRenderThread() [2/4]

void OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

◆ shutdownOnRenderThread() [3/4]

void OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

◆ shutdownOnRenderThread() [4/4]

void OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

◆ surfaceChanged()

void OpenGLContext::NativeContext::surfaceChanged ( jobject  holder,
int  format,
int  width,
int  height 
)
inline

◆ surfaceCreated()

void OpenGLContext::NativeContext::surfaceCreated ( jobject  holder)

◆ surfaceDestroyed()

void OpenGLContext::NativeContext::surfaceDestroyed ( jobject  holder)

◆ swapBuffers() [1/4]

void OpenGLContext::NativeContext::swapBuffers ( ) const
inlinenoexcept

References dc.

◆ swapBuffers() [2/4]

void OpenGLContext::NativeContext::swapBuffers ( )
inline

◆ swapBuffers() [3/4]

void OpenGLContext::NativeContext::swapBuffers ( ) const
inlinenoexcept

References display, and surface.

Referenced by JuceGLView::layerClass.

◆ swapBuffers() [4/4]

void OpenGLContext::NativeContext::swapBuffers ( )
inline

References display, and embeddedWindow.

◆ triggerRepaint() [1/2]

void OpenGLContext::NativeContext::triggerRepaint ( )
inline

References context.

◆ triggerRepaint() [2/2]

void OpenGLContext::NativeContext::triggerRepaint ( )
inline

◆ updateWindowPosition() [1/4]

◆ updateWindowPosition() [2/4]

◆ updateWindowPosition() [3/4]

void OpenGLContext::NativeContext::updateWindowPosition ( Rectangle< int newBounds)
inline

◆ updateWindowPosition() [4/4]

void OpenGLContext::NativeContext::updateWindowPosition ( Rectangle< int )
inline

◆ wglChoosePixelFormatExtension()

Member Data Documentation

◆ bestVisual

XVisualInfo* OpenGLContext::NativeContext::bestVisual = {}
private

◆ bounds

Rectangle<int> OpenGLContext::NativeContext::bounds
private

◆ component

◆ config

EGLConfig OpenGLContext::NativeContext::config
staticprivate

◆ context [1/2]

OpenGLContext* OpenGLContext::NativeContext::context = {}
private

◆ context [2/2]

◆ contextToShareWith

void* OpenGLContext::NativeContext::contextToShareWith
private

◆ dc

HDC OpenGLContext::NativeContext::dc
private

◆ display [1/2]

::Display* OpenGLContext::NativeContext::display = {}
private

◆ display [2/2]

◆ dummy

DummyComponent OpenGLContext::NativeContext::dummy
private

Referenced by NativeContext(), and ~NativeContext().

◆ dummyComponent

ScopedPointer<DummyComponent> OpenGLContext::NativeContext::dummyComponent
private

Referenced by NativeContext().

◆ embeddedWindow

Window OpenGLContext::NativeContext::embeddedWindow = {}
private

◆ hasInitialised

bool OpenGLContext::NativeContext::hasInitialised
private

◆ juceContext

OpenGLContext* OpenGLContext::NativeContext::juceContext
private

◆ lastBounds

Rectangle<int> OpenGLContext::NativeContext::lastBounds
private

◆ lastSwapTime

double OpenGLContext::NativeContext::lastSwapTime

Referenced by swapBuffers().

◆ minSwapTimeMs

int OpenGLContext::NativeContext::minSwapTimeMs

Referenced by setSwapInterval(), and swapBuffers().

◆ nativeWindow

ScopedPointer<ComponentPeer> OpenGLContext::NativeContext::nativeWindow
private

◆ renderContext [1/3]

HGLRC OpenGLContext::NativeContext::renderContext
private

◆ renderContext [2/3]

NSOpenGLContext* OpenGLContext::NativeContext::renderContext

◆ renderContext [3/3]

◆ surface

EGLSurface OpenGLContext::NativeContext::surface
private

◆ surfaceView

GlobalRef OpenGLContext::NativeContext::surfaceView
private

◆ swapFrames

int OpenGLContext::NativeContext::swapFrames = 0
private

◆ underrunCounter

int OpenGLContext::NativeContext::underrunCounter

Referenced by swapBuffers().

◆ view

NSOpenGLView* OpenGLContext::NativeContext::view

◆ viewAttachment

ReferenceCountedObjectPtr<ReferenceCountedObject> OpenGLContext::NativeContext::viewAttachment

Referenced by NativeContext().


The documentation for this class was generated from the following files: