LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
OpenGLContext Class Referenceabstract

#include <OpenGLContext.hxx>

Inheritance diagram for OpenGLContext:
[legend]
Collaboration diagram for OpenGLContext:
[legend]

Public Member Functions

virtual ~OpenGLContext ()
 
 OpenGLContext (const OpenGLContext &)=delete
 
 OpenGLContext (OpenGLContext &&)=delete
 
OpenGLContextoperator= (const OpenGLContext &)=delete
 
OpenGLContextoperator= (OpenGLContext &&)=delete
 
void acquire ()
 
void release ()
 
void dispose ()
 
void requestLegacyContext ()
 
bool init (vcl::Window *pParent)
 
void reset ()
 
virtual bool isCurrent ()
 Is this GL context the current context ? More...
 
virtual bool isAnyCurrent ()
 Is any GL context the current context ? More...
 
virtual void makeCurrent ()
 make this GL context current - so it is implicit in subsequent GL calls More...
 
void registerAsCurrent ()
 Put this GL context to the end of the context list. More...
 
virtual void resetCurrent ()
 reset the GL context so this context is not implicit in subsequent GL calls. More...
 
virtual void restoreDefaultFramebuffer ()
 unbind the GL_FRAMEBUFFER to its default state, needed for gtk3 More...
 
virtual void swapBuffers ()
 
virtual void sync ()
 
void show ()
 
void setWinPosAndSize (const Point &rPos, const Size &rSize)
 
virtual const GLWindowgetOpenGLWindow () const =0
 
SystemChildWindowgetChildWindow ()
 
const SystemChildWindowgetChildWindow () const
 
bool isInitialized () const
 
virtual SystemWindowData generateWinData (vcl::Window *pParent, bool bRequestLegacyContext)
 

Static Public Member Functions

static rtl::Reference< OpenGLContextCreate ()
 
static void clearCurrent ()
 release bound resources from the current context More...
 
static void prepareForYield ()
 release contexts etc. before (potentially) allowing another thread run. More...
 
static bool hasCurrent ()
 Is there a current GL context ? More...
 

Public Attributes

OpenGLContextmpPrevContext
 
OpenGLContextmpNextContext
 

Protected Member Functions

 OpenGLContext ()
 
bool InitGL ()
 
virtual GLWindowgetModifiableOpenGLWindow ()=0
 
virtual bool ImplInit ()
 

Static Protected Member Functions

static void InitGLDebugging ()
 
static void InitChildWindow (SystemChildWindow *pChildWindow)
 
static void BuffersSwapped ()
 

Protected Attributes

VclPtr< vcl::Windowm_xWindow
 
VclPtr< vcl::WindowmpWindow
 
VclPtr< SystemChildWindowm_pChildWindow
 
bool mbInitialized
 
int mnRefCount
 
bool mbRequestLegacyContext
 

Private Member Functions

virtual void initWindow ()
 
virtual void destroyCurrentContext ()
 
virtual void adjustToNewSize ()
 

Friends

class OpenGLTests
 

Detailed Description

Definition at line 41 of file OpenGLContext.hxx.

Constructor & Destructor Documentation

◆ OpenGLContext() [1/3]

OpenGLContext::OpenGLContext ( )
protected

◆ ~OpenGLContext()

OpenGLContext::~OpenGLContext ( )
virtual

◆ OpenGLContext() [2/3]

OpenGLContext::OpenGLContext ( const OpenGLContext )
delete

◆ OpenGLContext() [3/3]

OpenGLContext::OpenGLContext ( OpenGLContext &&  )
delete

Member Function Documentation

◆ acquire()

void OpenGLContext::acquire ( )
inline

Definition at line 57 of file OpenGLContext.hxx.

◆ adjustToNewSize()

void OpenGLContext::adjustToNewSize ( )
privatevirtual

Definition at line 311 of file OpenGLContext.cxx.

References getOpenGLWindow(), GLWindow::Height, and GLWindow::Width.

Referenced by setWinPosAndSize().

◆ BuffersSwapped()

void OpenGLContext::BuffersSwapped ( )
staticprotected

Definition at line 454 of file OpenGLContext.cxx.

References nBufferSwapCounter.

Referenced by swapBuffers().

◆ clearCurrent()

void OpenGLContext::clearCurrent ( )
static

release bound resources from the current context

Definition at line 388 of file OpenGLContext.cxx.

Referenced by makeCurrent(), and resetCurrent().

◆ Create()

rtl::Reference< OpenGLContext > OpenGLContext::Create ( )
static

Definition at line 94 of file OpenGLContext.cxx.

References ImplGetSVData().

◆ destroyCurrentContext()

void OpenGLContext::destroyCurrentContext ( )
privatevirtual

Reimplemented in QtOpenGLContext.

Definition at line 330 of file OpenGLContext.cxx.

Referenced by reset().

◆ dispose()

void OpenGLContext::dispose ( void  )

◆ generateWinData()

SystemWindowData OpenGLContext::generateWinData ( vcl::Window pParent,
bool  bRequestLegacyContext 
)
virtual

Definition at line 351 of file OpenGLContext.cxx.

◆ getChildWindow() [1/2]

SystemChildWindow * OpenGLContext::getChildWindow ( )

Definition at line 486 of file OpenGLContext.cxx.

References m_pChildWindow.

◆ getChildWindow() [2/2]

const SystemChildWindow * OpenGLContext::getChildWindow ( ) const

Definition at line 491 of file OpenGLContext.cxx.

References m_pChildWindow.

◆ getModifiableOpenGLWindow()

virtual GLWindow & OpenGLContext::getModifiableOpenGLWindow ( )
protectedpure virtual

Implemented in QtOpenGLContext.

Referenced by setWinPosAndSize().

◆ getOpenGLWindow()

virtual const GLWindow & OpenGLContext::getOpenGLWindow ( ) const
pure virtual

Implemented in QtOpenGLContext.

Referenced by adjustToNewSize().

◆ hasCurrent()

bool OpenGLContext::hasCurrent ( )
static

Is there a current GL context ?

Definition at line 381 of file OpenGLContext.cxx.

References ImplGetSVData(), ImplSVData::maGDIData, and ImplSVGDIData::mpLastContext.

Referenced by OpenGLHelper::debugMsgPrint(), and prepareForYield().

◆ ImplInit()

bool OpenGLContext::ImplInit ( )
protectedvirtual

Reimplemented in QtOpenGLContext.

Definition at line 218 of file OpenGLContext.cxx.

References VCL_GL_INFO.

Referenced by init().

◆ init()

bool OpenGLContext::init ( vcl::Window pParent)

◆ InitChildWindow()

void OpenGLContext::InitChildWindow ( SystemChildWindow pChildWindow)
staticprotected

◆ InitGL()

bool OpenGLContext::InitGL ( )
protected

◆ InitGLDebugging()

void OpenGLContext::InitGLDebugging ( )
staticprotected

Definition at line 260 of file OpenGLContext.cxx.

References VCL_GL_INFO.

◆ initWindow()

void OpenGLContext::initWindow ( )
privatevirtual

Reimplemented in QtOpenGLContext.

Definition at line 326 of file OpenGLContext.cxx.

Referenced by init().

◆ isAnyCurrent()

bool OpenGLContext::isAnyCurrent ( )
virtual

Is any GL context the current context ?

Reimplemented in QtOpenGLContext.

Definition at line 376 of file OpenGLContext.cxx.

◆ isCurrent()

bool OpenGLContext::isCurrent ( )
virtual

Is this GL context the current context ?

Reimplemented in QtOpenGLContext.

Definition at line 356 of file OpenGLContext.cxx.

Referenced by makeCurrent(), and reset().

◆ isInitialized()

bool OpenGLContext::isInitialized ( ) const
inline

Definition at line 96 of file OpenGLContext.hxx.

References mbInitialized.

◆ makeCurrent()

void OpenGLContext::makeCurrent ( )
virtual

make this GL context current - so it is implicit in subsequent GL calls

Reimplemented in QtOpenGLContext.

Definition at line 362 of file OpenGLContext.cxx.

References clearCurrent(), isCurrent(), and registerAsCurrent().

◆ operator=() [1/2]

OpenGLContext & OpenGLContext::operator= ( const OpenGLContext )
delete

◆ operator=() [2/2]

OpenGLContext & OpenGLContext::operator= ( OpenGLContext &&  )
delete

◆ prepareForYield()

void OpenGLContext::prepareForYield ( )
static

release contexts etc. before (potentially) allowing another thread run.

Definition at line 392 of file OpenGLContext.cxx.

References hasCurrent(), ImplGetSVData(), ImplSVData::maGDIData, ImplSVGDIData::mpLastContext, and SAL_INFO.

◆ registerAsCurrent()

void OpenGLContext::registerAsCurrent ( )

Put this GL context to the end of the context list.

Definition at line 422 of file OpenGLContext.cxx.

References ImplGetSVData(), ImplSVData::maGDIData, ImplSVGDIData::mpLastContext, mpNextContext, mpPrevContext, and VCL_GL_INFO.

Referenced by makeCurrent().

◆ release()

void OpenGLContext::release ( )
inline

Definition at line 58 of file OpenGLContext.hxx.

◆ requestLegacyContext()

void OpenGLContext::requestLegacyContext ( )

Definition at line 99 of file OpenGLContext.cxx.

References mbRequestLegacyContext.

◆ reset()

void OpenGLContext::reset ( )

Definition at line 335 of file OpenGLContext.cxx.

References destroyCurrentContext(), isCurrent(), mbInitialized, and resetCurrent().

Referenced by dispose(), and ~OpenGLContext().

◆ resetCurrent()

void OpenGLContext::resetCurrent ( )
virtual

reset the GL context so this context is not implicit in subsequent GL calls.

Reimplemented in QtOpenGLContext.

Definition at line 442 of file OpenGLContext.cxx.

References clearCurrent().

Referenced by reset().

◆ restoreDefaultFramebuffer()

void OpenGLContext::restoreDefaultFramebuffer ( )
virtual

unbind the GL_FRAMEBUFFER to its default state, needed for gtk3

Definition at line 293 of file OpenGLContext.cxx.

◆ setWinPosAndSize()

void OpenGLContext::setWinPosAndSize ( const Point rPos,
const Size rSize 
)

◆ show()

void OpenGLContext::show ( )

Definition at line 478 of file OpenGLContext.cxx.

References m_pChildWindow, m_xWindow, and vcl::Window::Show().

◆ swapBuffers()

void OpenGLContext::swapBuffers ( )
virtual

Reimplemented in QtOpenGLContext.

Definition at line 448 of file OpenGLContext.cxx.

References BuffersSwapped().

◆ sync()

void OpenGLContext::sync ( )
virtual

Definition at line 472 of file OpenGLContext.cxx.

Friends And Related Function Documentation

◆ OpenGLTests

friend class OpenGLTests
friend

Definition at line 43 of file OpenGLContext.hxx.

Member Data Documentation

◆ m_pChildWindow

VclPtr<SystemChildWindow> OpenGLContext::m_pChildWindow
protected

Definition at line 118 of file OpenGLContext.hxx.

Referenced by dispose(), getChildWindow(), init(), setWinPosAndSize(), show(), and ~OpenGLContext().

◆ m_xWindow

VclPtr<vcl::Window> OpenGLContext::m_xWindow
protected

Definition at line 116 of file OpenGLContext.hxx.

Referenced by init(), setWinPosAndSize(), and show().

◆ mbInitialized

bool OpenGLContext::mbInitialized
protected

Definition at line 119 of file OpenGLContext.hxx.

Referenced by init(), InitGL(), and reset().

◆ mbRequestLegacyContext

bool OpenGLContext::mbRequestLegacyContext
protected

Definition at line 121 of file OpenGLContext.hxx.

Referenced by requestLegacyContext().

◆ mnRefCount

int OpenGLContext::mnRefCount
protected

Definition at line 120 of file OpenGLContext.hxx.

Referenced by ~OpenGLContext().

◆ mpNextContext

OpenGLContext* OpenGLContext::mpNextContext

Definition at line 127 of file OpenGLContext.hxx.

Referenced by OpenGLContext(), registerAsCurrent(), and ~OpenGLContext().

◆ mpPrevContext

OpenGLContext* OpenGLContext::mpPrevContext

Definition at line 126 of file OpenGLContext.hxx.

Referenced by OpenGLContext(), registerAsCurrent(), and ~OpenGLContext().

◆ mpWindow

VclPtr<vcl::Window> OpenGLContext::mpWindow
protected

Definition at line 117 of file OpenGLContext.hxx.

Referenced by init().


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