JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::OpenGLContext::NativeContext Class Reference

#include <juce_OpenGL_win32.h>

Inheritance diagram for juce::OpenGLContext::NativeContext:
Collaboration diagram for juce::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 &c, const OpenGLPixelFormat &pixFormat, void *contextToShare, bool multisampling, OpenGLVersion version)
 
 NativeContext (Component &comp, const OpenGLPixelFormat &cPixelFormat, void *shareContext, bool, OpenGLVersion)
 
 NativeContext (Component &comp, const OpenGLPixelFormat &, void *, bool, OpenGLVersion)
 
 ~NativeContext ()
 
 ~NativeContext ()
 
 ~NativeContext ()
 
 ~NativeContext ()
 
 ~NativeContext ()
 
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
 
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
 
void * getRawContext () const noexcept
 
int getSwapInterval () const
 
int getSwapInterval () const noexcept
 
int getSwapInterval () const
 
int getSwapInterval () const
 
int getSwapInterval () const
 
double getWindowScaleFactor (const Rectangle< int > &screenBounds)
 
bool initialiseOnRenderThread (OpenGLContext &c)
 
bool initialiseOnRenderThread (OpenGLContext &)
 
bool initialiseOnRenderThread (OpenGLContext &)
 
bool initialiseOnRenderThread (OpenGLContext &aContext)
 
bool initialiseOnRenderThread (OpenGLContext &c)
 
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
 
bool setSwapInterval (int numFramesPerSwap)
 
bool setSwapInterval (int numFramesPerSwap) noexcept
 
bool setSwapInterval (int numFramesPerSwap)
 
bool setSwapInterval (int numFramesPerSwap)
 
bool setSwapInterval (const 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 > holder) override
 
void surfaceDestroyed (LocalRef< jobject > holder) override
 
void swapBuffers () const noexcept
 
void swapBuffers ()
 
void swapBuffers ()
 
void swapBuffers ()
 
void swapBuffers () const noexcept
 
void triggerRepaint ()
 
void triggerRepaint ()
 
void updateWindowPosition (Rectangle< int > bounds)
 
void updateWindowPosition (Rectangle< int > bounds)
 
void updateWindowPosition (Rectangle< int > newBounds)
 
void updateWindowPosition (Rectangle< int >)
 
void updateWindowPosition (Rectangle< int > bounds)
 

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

Public Attributes

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

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 ()
 
void initialiseGLExtensions ()
 
void releaseContext ()
 
void releaseDC ()
 
int wglChoosePixelFormatExtension (const OpenGLPixelFormat &pixelFormat) const
 

Static Private Member Functions

static void deleteFrameBuffer (GLuint &i)
 
static void deleteRenderBuffer (GLuint &i)
 
static void initialisePixelFormatDescriptor (PIXELFORMATDESCRIPTOR &pfd, const OpenGLPixelFormat &pixelFormat)
 

Private Attributes

XVisualInfo * bestVisual = {}
 
Rectangle< intbounds
 
GLuint colorBufferHandle = 0
 
EAGLContext * context = nil
 
OpenGLContextcontext = {}
 
EGLContext context = {}
 
void * contextToShareWith
 
HDC dc
 
GLuint depthBufferHandle = 0
 
::Display * display = {}
 
DummyComponent dummy
 
std::unique_ptr< DummyComponentdummyComponent
 
Window embeddedWindow = {}
 
GLuint frameBufferHandle = 0
 
CAEAGLLayer * glLayer = nil
 
bool hasInitialised = false
 
OpenGLContextjuceContext = nullptr
 
Rectangle< intlastBounds
 
GLuint msaaBufferHandle = 0
 
GLuint msaaColorHandle = 0
 
double nativeScaleFactor = 1.0
 
std::unique_ptr< ComponentPeernativeWindow
 
bool needToRebuildBuffers = false
 
const OpenGLVersion openGLversion
 
HGLRC renderContext
 
GLXContext renderContext = {}
 
EGLSurface surface
 
GlobalRef surfaceHolderCallback
 
GlobalRef surfaceView
 
int swapFrames = 0
 
const bool useDepthBuffer
 
const bool useMSAA
 
JuceGLViewview = nil
 

Static Private Attributes

static EGLConfig config
 
static EGLDisplay display
 

Friends

struct AndroidGLCallbacks
 

Constructor & Destructor Documentation

◆ NativeContext() [1/5]

juce::OpenGLContext::NativeContext::NativeContext ( Component comp,
const OpenGLPixelFormat ,
void *  ,
bool  ,
OpenGLVersion   
)
inline

◆ ~NativeContext() [1/5]

juce::OpenGLContext::NativeContext::~NativeContext ( )
inline

References juce::getEnv().

◆ NativeContext() [2/5]

juce::OpenGLContext::NativeContext::NativeContext ( Component c,
const OpenGLPixelFormat pixFormat,
void *  contextToShare,
bool  multisampling,
OpenGLVersion  version 
)
inline

◆ ~NativeContext() [2/5]

juce::OpenGLContext::NativeContext::~NativeContext ( )
inline

References view.

◆ NativeContext() [3/5]

◆ ~NativeContext() [3/5]

juce::OpenGLContext::NativeContext::~NativeContext ( )
inline

◆ NativeContext() [4/5]

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

◆ ~NativeContext() [4/5]

juce::OpenGLContext::NativeContext::~NativeContext ( )
inline

References renderContext, and view.

◆ NativeContext() [5/5]

◆ ~NativeContext() [5/5]

juce::OpenGLContext::NativeContext::~NativeContext ( )
inline

Member Function Documentation

◆ attachedToWindow()

void juce::OpenGLContext::NativeContext::attachedToWindow ( )
inlineprivate

◆ clear()

void juce::AndroidInterfaceImplementer::clear ( )
protectedinherited

◆ createAttribs()

◆ createContext()

bool juce::OpenGLContext::NativeContext::createContext ( EAGLRenderingAPI  type,
void *  contextToShare 
)
inlineprivate

References jassert.

◆ createdOk() [1/5]

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

References getRawContext().

◆ createdOk() [2/5]

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

◆ createdOk() [3/5]

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

References getRawContext().

◆ createdOk() [4/5]

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

◆ createdOk() [5/5]

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

◆ createGLBuffers()

◆ createNativeWindow()

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

◆ deactivateCurrentContext() [1/5]

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

◆ deactivateCurrentContext() [2/5]

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

◆ deactivateCurrentContext() [3/5]

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

◆ deactivateCurrentContext() [4/5]

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

◆ deactivateCurrentContext() [5/5]

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

◆ deleteFrameBuffer()

static void juce::OpenGLContext::NativeContext::deleteFrameBuffer ( GLuint &  i)
inlinestaticprivate

◆ deleteRenderBuffer()

static void juce::OpenGLContext::NativeContext::deleteRenderBuffer ( GLuint &  i)
inlinestaticprivate

◆ deleteRenderContext()

void juce::OpenGLContext::NativeContext::deleteRenderContext ( )
inlineprivate

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

◆ detachedFromWindow()

void juce::OpenGLContext::NativeContext::detachedFromWindow ( )
inlineprivate

◆ dispatchDraw()

void juce::OpenGLContext::NativeContext::dispatchDraw ( jobject  )
inlineprivate

◆ freeGLBuffers()

void juce::OpenGLContext::NativeContext::freeGLBuffers ( )
inlineprivate

◆ getFrameBufferID() [1/5]

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

◆ getFrameBufferID() [2/5]

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

◆ getFrameBufferID() [3/5]

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

◆ getFrameBufferID() [4/5]

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

◆ getFrameBufferID() [5/5]

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

◆ getRawContext() [1/5]

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

References renderContext.

◆ getRawContext() [2/5]

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

◆ getRawContext() [3/5]

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

References renderContext.

◆ getRawContext() [4/5]

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

References renderContext.

◆ getRawContext() [5/5]

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

Referenced by createdOk().

◆ getSwapInterval() [1/5]

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

References isActive(), and jassert.

◆ getSwapInterval() [2/5]

int juce::OpenGLContext::NativeContext::getSwapInterval ( ) const
inlinenoexcept

◆ getSwapInterval() [3/5]

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

References renderContext.

◆ getSwapInterval() [4/5]

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

References swapFrames.

◆ getSwapInterval() [5/5]

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

◆ getWindowScaleFactor()

◆ initEGLDisplay()

bool juce::OpenGLContext::NativeContext::initEGLDisplay ( )
inlineprivate

References jassertfalse.

◆ initialiseGLExtensions()

void juce::OpenGLContext::NativeContext::initialiseGLExtensions ( )
inlineprivate

References JUCE_INIT_WGL_FUNCTION.

Referenced by NativeContext().

◆ initialiseOnRenderThread() [1/5]

bool juce::OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext c)
inline

References context.

◆ initialiseOnRenderThread() [2/5]

bool juce::OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext )
inline

◆ initialiseOnRenderThread() [3/5]

bool juce::OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext )
inline

◆ initialiseOnRenderThread() [4/5]

bool juce::OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext aContext)
inline

◆ initialiseOnRenderThread() [5/5]

bool juce::OpenGLContext::NativeContext::initialiseOnRenderThread ( OpenGLContext c)
inline

◆ initialisePixelFormatDescriptor()

◆ isActive() [1/5]

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

References renderContext.

◆ isActive() [2/5]

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

References renderContext.

◆ isActive() [3/5]

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

◆ isActive() [4/5]

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

References display, and renderContext.

◆ isActive() [5/5]

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

◆ makeActive() [1/5]

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

References dc, isActive(), and renderContext.

◆ makeActive() [2/5]

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

References context, jassert, renderContext, and view.

◆ makeActive() [3/5]

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

References juce::GL_FRAMEBUFFER.

◆ makeActive() [4/5]

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

◆ makeActive() [5/5]

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

Referenced by NativeContext().

◆ releaseContext()

void juce::OpenGLContext::NativeContext::releaseContext ( )
inlineprivate

◆ releaseDC()

void juce::OpenGLContext::NativeContext::releaseDC ( )
inlineprivate

References dc.

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

◆ setSwapInterval() [1/5]

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

References isActive(), and jassert.

◆ setSwapInterval() [2/5]

bool juce::OpenGLContext::NativeContext::setSwapInterval ( int  numFramesPerSwap)
inlinenoexcept

◆ setSwapInterval() [3/5]

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

References minSwapTimeMs, and renderContext.

◆ setSwapInterval() [4/5]

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

◆ setSwapInterval() [5/5]

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

◆ shutdownOnRenderThread() [1/5]

void juce::OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

◆ shutdownOnRenderThread() [2/5]

void juce::OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

◆ shutdownOnRenderThread() [3/5]

void juce::OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

◆ shutdownOnRenderThread() [4/5]

void juce::OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

◆ shutdownOnRenderThread() [5/5]

void juce::OpenGLContext::NativeContext::shutdownOnRenderThread ( )
inline

References jassert.

◆ surfaceChanged()

void juce::OpenGLContext::NativeContext::surfaceChanged ( LocalRef< jobject >  holder,
int  format,
int  width,
int  height 
)
inlineoverridevirtual

◆ surfaceCreated()

void juce::OpenGLContext::NativeContext::surfaceCreated ( LocalRef< jobject >  holder)
overridevirtual

◆ surfaceDestroyed()

void juce::OpenGLContext::NativeContext::surfaceDestroyed ( LocalRef< jobject >  holder)
overridevirtual

◆ swapBuffers() [1/5]

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

References dc.

◆ swapBuffers() [2/5]

void juce::OpenGLContext::NativeContext::swapBuffers ( )
inline

◆ swapBuffers() [3/5]

void juce::OpenGLContext::NativeContext::swapBuffers ( )
inline

◆ swapBuffers() [4/5]

void juce::OpenGLContext::NativeContext::swapBuffers ( )
inline

References display, and embeddedWindow.

◆ swapBuffers() [5/5]

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

◆ triggerRepaint() [1/2]

void juce::OpenGLContext::NativeContext::triggerRepaint ( )
inline

References context.

◆ triggerRepaint() [2/2]

◆ updateWindowPosition() [1/5]

◆ updateWindowPosition() [2/5]

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

◆ updateWindowPosition() [3/5]

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

◆ updateWindowPosition() [4/5]

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

◆ updateWindowPosition() [5/5]

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

◆ wglChoosePixelFormatExtension()

Friends And Related Function Documentation

◆ AndroidGLCallbacks

friend struct AndroidGLCallbacks
friend

Member Data Documentation

◆ bestVisual

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

◆ bounds

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

Referenced by updateWindowPosition().

◆ colorBufferHandle

GLuint juce::OpenGLContext::NativeContext::colorBufferHandle = 0
private

◆ component

◆ config

EGLConfig juce::OpenGLContext::NativeContext::config
staticprivate

◆ context [1/3]

EAGLContext* juce::OpenGLContext::NativeContext::context = nil
private

◆ context [2/3]

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

◆ context [3/3]

◆ contextToShareWith

void* juce::OpenGLContext::NativeContext::contextToShareWith
private

◆ dc

HDC juce::OpenGLContext::NativeContext::dc
private

◆ depthBufferHandle

GLuint juce::OpenGLContext::NativeContext::depthBufferHandle = 0
private

◆ display [1/2]

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

◆ display [2/2]

EGLDisplay juce::OpenGLContext::NativeContext::display
staticprivate

◆ dummy

DummyComponent juce::OpenGLContext::NativeContext::dummy
private

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

◆ dummyComponent

std::unique_ptr<DummyComponent> juce::OpenGLContext::NativeContext::dummyComponent
private

Referenced by NativeContext().

◆ embeddedWindow

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

◆ frameBufferHandle

GLuint juce::OpenGLContext::NativeContext::frameBufferHandle = 0
private

◆ glLayer

CAEAGLLayer* juce::OpenGLContext::NativeContext::glLayer = nil
private

◆ hasInitialised

bool juce::OpenGLContext::NativeContext::hasInitialised = false
private

◆ juceContext

OpenGLContext* juce::OpenGLContext::NativeContext::juceContext = nullptr
private

◆ lastBounds

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

◆ lastSwapTime

double juce::OpenGLContext::NativeContext::lastSwapTime = 0

Referenced by swapBuffers().

◆ minSwapTimeMs

int juce::OpenGLContext::NativeContext::minSwapTimeMs = 0

Referenced by setSwapInterval(), and swapBuffers().

◆ msaaBufferHandle

GLuint juce::OpenGLContext::NativeContext::msaaBufferHandle = 0
private

◆ msaaColorHandle

GLuint juce::OpenGLContext::NativeContext::msaaColorHandle = 0
private

◆ nativeScaleFactor

double juce::OpenGLContext::NativeContext::nativeScaleFactor = 1.0
private

◆ nativeWindow

std::unique_ptr<ComponentPeer> juce::OpenGLContext::NativeContext::nativeWindow
private

◆ needToRebuildBuffers

bool juce::OpenGLContext::NativeContext::needToRebuildBuffers = false
private

◆ openGLversion

const OpenGLVersion juce::OpenGLContext::NativeContext::openGLversion
private

◆ renderContext [1/3]

HGLRC juce::OpenGLContext::NativeContext::renderContext
private

◆ renderContext [2/3]

NSOpenGLContext* juce::OpenGLContext::NativeContext::renderContext = nil

◆ renderContext [3/3]

GLXContext juce::OpenGLContext::NativeContext::renderContext = {}
private

◆ surface

EGLSurface juce::OpenGLContext::NativeContext::surface
private

◆ surfaceHolderCallback

GlobalRef juce::OpenGLContext::NativeContext::surfaceHolderCallback
private

◆ surfaceView

GlobalRef juce::OpenGLContext::NativeContext::surfaceView
private

◆ swapFrames

int juce::OpenGLContext::NativeContext::swapFrames = 0
private

Referenced by getSwapInterval(), and setSwapInterval().

◆ underrunCounter

int juce::OpenGLContext::NativeContext::underrunCounter = 0

Referenced by swapBuffers().

◆ useDepthBuffer

const bool juce::OpenGLContext::NativeContext::useDepthBuffer
private

◆ useMSAA

const bool juce::OpenGLContext::NativeContext::useMSAA
private

◆ view [1/2]

JuceGLView* juce::OpenGLContext::NativeContext::view = nil
private

◆ view [2/2]

NSOpenGLView* juce::OpenGLContext::NativeContext::view = nil

◆ viewAttachment

ReferenceCountedObjectPtr<ReferenceCountedObject> juce::OpenGLContext::NativeContext::viewAttachment

Referenced by NativeContext().


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