Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
OGLTextureManager Class Reference

Class allowing to handle textures lifetime. More...

#include <OGLTextureManager.h>

Collaboration diagram for OGLTextureManager:
Collaboration graph
[legend]

Public Member Functions

QOpenGLTexture * getTexture (const std::shared_ptr< QImage > &image)
 
QOpenGLTexture * whiteTexture ()
 
QOpenGLTexture * fallbackTexture ()
 

Static Public Member Functions

static OGLTextureManagerinstance (QOpenGLContext *context)
 

Private Member Functions

 OGLTextureManager (QOpenGLContext *context)
 
 ~OGLTextureManager ()=default
 
void initializeTextures ()
 

Private Attributes

std::map< std::weak_ptr< QImage >, std::unique_ptr< QOpenGLTexture >, std::owner_less<> > imageTextures
 
QOpenGLTexture _fallbackTexture
 
QOpenGLTexture _whiteTexture
 

Static Private Attributes

static QMap< QOpenGLContext *, OGLTextureManager * > instances
 

Detailed Description

Class allowing to handle textures lifetime.

Texture manager that supports resource sharing between OpenGL contexts.

FIXME: OpenGL texture can be shared between context of a same context group, so, IN THEORY, we could have a single instance of OGLTextureManager shared between all contexts. We didn't manage to create a group containing all contexts meaning that for the moment one OGLTextureManager is instanced for each context.

Definition at line 50 of file OGLTextureManager.h.

Constructor & Destructor Documentation

◆ OGLTextureManager()

OGLTextureManager::OGLTextureManager ( QOpenGLContext *  context)
private

Definition at line 45 of file OGLTextureManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~OGLTextureManager()

OGLTextureManager::~OGLTextureManager ( )
privatedefault

Member Function Documentation

◆ fallbackTexture()

QOpenGLTexture * OGLTextureManager::fallbackTexture ( )

Definition at line 77 of file OGLTextureManager.cpp.

◆ getTexture()

QOpenGLTexture * OGLTextureManager::getTexture ( const std::shared_ptr< QImage > &  image)

Definition at line 82 of file OGLTextureManager.cpp.

◆ initializeTextures()

void OGLTextureManager::initializeTextures ( )
private

Definition at line 51 of file OGLTextureManager.cpp.

Here is the caller graph for this function:

◆ instance()

OGLTextureManager * OGLTextureManager::instance ( QOpenGLContext *  context)
static

Definition at line 34 of file OGLTextureManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ whiteTexture()

QOpenGLTexture * OGLTextureManager::whiteTexture ( )

Definition at line 72 of file OGLTextureManager.cpp.

Member Data Documentation

◆ _fallbackTexture

QOpenGLTexture OGLTextureManager::_fallbackTexture
private

Definition at line 69 of file OGLTextureManager.h.

◆ _whiteTexture

QOpenGLTexture OGLTextureManager::_whiteTexture
private

Definition at line 70 of file OGLTextureManager.h.

◆ imageTextures

std::map<std::weak_ptr<QImage>, std::unique_ptr<QOpenGLTexture>, std::owner_less<> > OGLTextureManager::imageTextures
private

Definition at line 68 of file OGLTextureManager.h.

◆ instances

QMap< QOpenGLContext *, OGLTextureManager * > OGLTextureManager::instances
staticprivate

Definition at line 72 of file OGLTextureManager.h.


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