Open CASCADE Technology 6.5.2
Public Member Functions | Static Public Member Functions
OpenGl_ResourceCleaner Class Reference

OpenGl_ResourceCleaner should be used to clean OpenGl memory resources; The reason is that the resources might be shared between the contexts and should be cleaned up only while suitable context is active;.

#include <OpenGl_ResourceCleaner.hxx>

Public Member Functions

 OpenGl_ResourceCleaner ()
 Constructor.
virtual ~OpenGl_ResourceCleaner ()
 Destructor.
void AppendContext (GLCONTEXT theContext, Standard_Boolean isShared)
 Append OpenGl context to the OpenGl_ResourceCleaner control list.
Standard_Boolean AddResource (GLCONTEXT theContext, Handle_OpenGl_Resource theResource)
 Tell the OpenGl_ResourceCleaner to clean up the OpenGl memory resource which has been created by the specified OpenGl context; The context should be in the OpenGl_ResourceCleaner control list.
void Clear ()
 Cancel clean procedure for all the resources added to the OpenGl_ResourceCleaner.
Standard_Boolean Clear (GLCONTEXT theContext)
 Cancel clean procedure for all the resources of the specific OpenGl context which were added to the OpenGl_ResourceCleaner.
void ClearShared ()
 Cancel clean procedure for all of the shared resources.
void Cleanup ()
 Clear the unused resources for active OpenGl context; You should add the cleaner resources by AddResources method; It is suggested to call this method right before the OpenGl new frame drawing procedure starts.
void RemoveContext (GLCONTEXT theContext)
 Remove the OpenGl context from the OpenGl_ResourceCleaner control list.
GLCONTEXT GetSharedContext () const
 Get any of shared contexts from the OpenGl_ResourceCleaner list to share resources with a new one.

Static Public Member Functions

static OpenGl_ResourceCleanerGetInstance ()
 Get the global instance of OpenGl_ResourceCleaner.

Constructor & Destructor Documentation

OpenGl_ResourceCleaner::OpenGl_ResourceCleaner ( )
virtual OpenGl_ResourceCleaner::~OpenGl_ResourceCleaner ( ) [inline, virtual]

Member Function Documentation

Standard_Boolean OpenGl_ResourceCleaner::AddResource ( GLCONTEXT  theContext,
Handle_OpenGl_Resource  theResource 
)
void OpenGl_ResourceCleaner::AppendContext ( GLCONTEXT  theContext,
Standard_Boolean  isShared 
)
void OpenGl_ResourceCleaner::Cleanup ( )
Standard_Boolean OpenGl_ResourceCleaner::Clear ( GLCONTEXT  theContext)
void OpenGl_ResourceCleaner::Clear ( )
void OpenGl_ResourceCleaner::ClearShared ( )
static OpenGl_ResourceCleaner* OpenGl_ResourceCleaner::GetInstance ( ) [static]
GLCONTEXT OpenGl_ResourceCleaner::GetSharedContext ( ) const
void OpenGl_ResourceCleaner::RemoveContext ( GLCONTEXT  theContext)

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines