xoreos  0.0.5
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Graphics::GraphicsManager Class Reference

The graphics manager. More...

#include <graphics.h>

Inheritance diagram for Graphics::GraphicsManager:
Inheritance graph
[legend]
Collaboration diagram for Graphics::GraphicsManager:
Collaboration graph
[legend]

Public Types

enum  ScalingType { kScalingNone = 0, kScalingWindowSize }
 

Public Member Functions

 GraphicsManager ()
 
 ~GraphicsManager ()
 
void init ()
 Initialize the graphics subsystem. More...
 
void deinit ()
 Deinitialize the graphics subsystem. More...
 
bool ready () const
 Was the graphics subsystem successfully initialized? More...
 
bool needManualDeS3TC () const
 Do we need to do manual S3TC DXTn decompression? More...
 
bool supportMultipleTextures () const
 Do we have support for multiple textures? More...
 
size_t getMultipleTextureCount () const
 Return the number of texture units for multiple textures. More...
 
bool isGL3 () const
 Are we currently running an OpenGL 3.x context? More...
 
bool isRendererExperimental () const
 
bool setFSAA (int level)
 Set the FSAA settings. More...
 
int getCurrentFSAA () const
 Return the current FSAA level. More...
 
uint32 getFPS () const
 How many frames per second to we render at the moments? More...
 
void setCullFace (bool enabled, GLenum mode=GL_BACK)
 Enable/Disable face culling. More...
 
void setGUIScale (ScalingType scaling)
 Configure scaling type for the GUI. More...
 
void setGUISize (int guiWidth, int guiHeight)
 Configure the original size of the GUI. More...
 
void setPerspective (float viewAngle, float clipNear, float clipFar)
 Change the perspective projection matrix. More...
 
void setOrthogonal (float clipNear, float clipFar)
 Change the projection matrix to be orthogonal. More...
 
void setCursor (Cursor *cursor=0)
 Set the current cursor. More...
 
void takeScreenshot ()
 Take a screenshot. More...
 
bool project (float x, float y, float z, float &sX, float &sY, float &sZ)
 Map the given world coordinates onto screen coordinates. More...
 
bool unproject (float x, float y, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2) const
 Map the given screen coordinates onto a line in world space. More...
 
RenderablegetObjectAt (float x, float y)
 Get the object at this screen position. More...
 
void recalculateObjectDistances ()
 Recalculate all object distances to the camera and resort the objects. More...
 
void lockFrame ()
 Increase the frame lock counter, disabling all frame rendering. More...
 
void unlockFrame ()
 Decrease the frame lock counter, potentially re-enabling frame rendering. More...
 
uint32 createRenderableID ()
 Create a new unique renderable ID. More...
 
void abandon (TextureID *ids, uint32 count)
 Abandon these textures. More...
 
void abandon (ListID ids, uint32 count)
 Abandon these lists. More...
 
void renderScene ()
 Render one complete frame of the scene. More...
 
const glm::mat4 & getProjectionMatrix () const
 Return the current screen projection view matrix. More...
 
glm::mat4 & getProjectionMatrix ()
 
const glm::mat4 & getProjectionInverseMatrix () const
 Return the inverse screen projection view matrix. More...
 
const glm::mat4 & getModelviewMatrix () const
 Return the current modelview matrix (camera view). More...
 
glm::mat4 & getModelviewMatrix ()
 
const glm::mat4 & getModelviewInverseMatrix () const
 Return the inverse modelview matrix (camera view). More...
 
void pauseAnimations ()
 Pause animation thread. More...
 
void resumeAnimations ()
 Resume animation thread. More...
 
void registerAnimatedModel (Aurora::Model *model)
 Register a model with the animation thread. More...
 
void unregisterAnimatedModel (Aurora::Model *model)
 Unregister a model from the animation thread. More...
 
- Public Member Functions inherited from Events::Notifyable
 Notifyable ()
 
virtual ~Notifyable ()
 

Private Types

enum  ProjectType { kProjectTypePerspective, kProjectTypeOrthogonal }
 

Private Member Functions

void setupScene ()
 
bool setupSDLGL ()
 Setup SDL + OpenGL renderer. More...
 
void checkGLExtensions ()
 
void perspective (float fovy, float aspect, float zNear, float zFar)
 Set up a projection matrix. More...
 
void ortho (float left, float right, float bottom, float top, float zNear, float zFar)
 Set up an orthogonal projection matrix. More...
 
void rebuildGLContainers ()
 
void destroyGLContainers ()
 
void destroyContext ()
 
void rebuildContext ()
 
void cleanupAbandoned ()
 
RenderablegetGUIObjectAt (float x, float y) const
 
RenderablegetWorldObjectAt (float x, float y) const
 
void buildNewTextures ()
 
void beginScene ()
 
bool playVideo ()
 
bool renderWorld ()
 
bool renderGUIFront ()
 
bool renderGUIBack ()
 
bool renderGUIConsole ()
 
bool renderGUI (ScalingType scalingType, QueueType guiQueue, bool disableDepthMask)
 
bool renderCursor ()
 
bool renderWorldShader ()
 
bool renderGUIFrontShader ()
 
bool renderGUIBackShader ()
 
bool renderGUIConsoleShader ()
 
bool renderGUIShader (ScalingType scalingType, QueueType guiQueue, bool disableDepthMask)
 
bool renderCursorShader ()
 
void endScene ()
 
void notifyResized (int oldWidth, int oldHeight, int newWidth, int newHeight)
 

Private Attributes

bool _ready
 Was the graphics subsystem successfully initialized? More...
 
bool _debugGL
 Should we create an OpenGL debug context? More...
 
bool _rendererExperimental
 Should we use the experimental shader based renderer? More...
 
bool _needManualDeS3TC
 Do we need to do manual S3TC DXTn decompression? More...
 
bool _supportMultipleTextures
 Do we have support for multiple textures? More...
 
size_t _multipleTextureCount
 The number of texture units for multiple textures. More...
 
WindowManager::RenderType _renderType
 
int _fsaa
 Current FSAA settings. More...
 
bool _cullFaceEnabled
 
GLenum _cullFaceMode
 
ProjectType _projectType
 
float _viewAngle
 
float _clipNear
 
float _clipFar
 
ScalingType _scalingType
 
int _guiHeight
 
int _guiWidth
 
Common::ScopedPtr< FPSCounter_fpsCounter
 Counts the current frames per seconds value. More...
 
uint32 _lastSampled
 Timestamp used to advance animations. More...
 
glm::mat4 _perspective
 3D perspective projection matrix. More...
 
glm::mat4 _perspectiveInv
 The inverse of our perspective matrix. More...
 
glm::mat4 _ortho
 Orthographical projection matrix. More...
 
glm::mat4 _orthoInv
 The inverse of our othographical matrix. More...
 
glm::mat4 _projection
 Our projection matrix. More...
 
glm::mat4 _projectionInv
 The inverse of our projection matrix. More...
 
glm::mat4 _modelview
 Our base modelview matrix (i.e camera view). More...
 
glm::mat4 _modelviewInv
 The inverse of our modelview matrix. More...
 
boost::atomic< uint32_frameLock
 
boost::atomic< bool > _frameEndSignal
 
Cursor_cursor
 The current cursor. More...
 
bool _takeScreenshot
 Should screenshot be taken? More...
 
uint32 _renderableID
 The last ID given to a renderable. More...
 
Common::Mutex _renderableIDMutex
 The mutex to govern renderable ID creation. More...
 
bool _hasAbandoned
 Do we have abandoned textures/lists? More...
 
std::vector< TextureID_abandonTextures
 Abandoned textures. More...
 
std::list< ListID_abandonLists
 Abandoned lists. More...
 
Common::Mutex _abandonMutex
 A mutex protecting abandoned structures. More...
 
Aurora::AnimationThread _animationThread
 

Additional Inherited Members

- Static Public Member Functions inherited from Common::Singleton< GraphicsManager >
static GraphicsManager & instance ()
 
static void destroy ()
 
- Protected Types inherited from Common::Singleton< GraphicsManager >
typedef GraphicsManager SingletonBaseType
 
- Protected Member Functions inherited from Common::Singleton< GraphicsManager >
 Singleton ()
 
virtual ~Singleton ()
 

Detailed Description

The graphics manager.

Definition at line 59 of file graphics.h.

Member Enumeration Documentation

◆ ProjectType

Enumerator
kProjectTypePerspective 
kProjectTypeOrthogonal 

Definition at line 187 of file graphics.h.

◆ ScalingType

Enumerator
kScalingNone 
kScalingWindowSize 

Definition at line 61 of file graphics.h.

Constructor & Destructor Documentation

◆ GraphicsManager()

Graphics::GraphicsManager::GraphicsManager ( )

◆ ~GraphicsManager()

Graphics::GraphicsManager::~GraphicsManager ( )

Definition at line 118 of file graphics.cpp.

References deinit().

Here is the call graph for this function:

Member Function Documentation

◆ abandon() [1/2]

void Graphics::GraphicsManager::abandon ( TextureID ids,
uint32  count 
)

Abandon these textures.

Definition at line 767 of file graphics.cpp.

References _abandonMutex, _abandonTextures, and _hasAbandoned.

◆ abandon() [2/2]

void Graphics::GraphicsManager::abandon ( ListID  ids,
uint32  count 
)

Abandon these lists.

Definition at line 780 of file graphics.cpp.

References _abandonLists, _abandonMutex, and _hasAbandoned.

◆ beginScene()

void Graphics::GraphicsManager::beginScene ( )
private

Definition at line 918 of file graphics.cpp.

References _fsaa, and WindowMan.

Referenced by renderScene().

Here is the caller graph for this function:

◆ buildNewTextures()

void Graphics::GraphicsManager::buildNewTextures ( )
private

Definition at line 891 of file graphics.cpp.

References Graphics::kQueueNewShader, Graphics::kQueueNewTexture, and QueueMan.

Referenced by renderCursor(), renderCursorShader(), renderGUI(), renderGUIShader(), renderWorld(), and renderWorldShader().

Here is the caller graph for this function:

◆ checkGLExtensions()

void Graphics::GraphicsManager::checkGLExtensions ( )
private

Definition at line 314 of file graphics.cpp.

References _debugGL, _multipleTextureCount, _needManualDeS3TC, _supportMultipleTextures, Graphics::glCompressedTexImage2D, Graphics::outputGLDebug(), and warning().

Referenced by init().

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

◆ cleanupAbandoned()

void Graphics::GraphicsManager::cleanupAbandoned ( )
private

Definition at line 1336 of file graphics.cpp.

References _abandonLists, _abandonMutex, _abandonTextures, and _hasAbandoned.

Referenced by renderScene().

Here is the caller graph for this function:

◆ createRenderableID()

uint32 Graphics::GraphicsManager::createRenderableID ( )

Create a new unique renderable ID.

Definition at line 761 of file graphics.cpp.

References _renderableID, and _renderableIDMutex.

◆ deinit()

void Graphics::GraphicsManager::deinit ( )

Deinitialize the graphics subsystem.

Definition at line 161 of file graphics.cpp.

References _animationThread, _multipleTextureCount, _needManualDeS3TC, _ready, _supportMultipleTextures, Common::Thread::destroyThread(), Common::enforceMainThread(), MeshMan, Graphics::Aurora::AnimationThread::pause(), QueueMan, ShaderMan, and WindowMan.

Referenced by ~GraphicsManager().

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

◆ destroyContext()

void Graphics::GraphicsManager::destroyContext ( )
private

Definition at line 1314 of file graphics.cpp.

References destroyGLContainers().

Referenced by notifyResized(), and setFSAA().

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

◆ destroyGLContainers()

void Graphics::GraphicsManager::destroyGLContainers ( )
private

Definition at line 1304 of file graphics.cpp.

References Graphics::kQueueGLContainer, and QueueMan.

Referenced by destroyContext().

Here is the caller graph for this function:

◆ endScene()

void Graphics::GraphicsManager::endScene ( )
private

Definition at line 1199 of file graphics.cpp.

References _fpsCounter, _fsaa, _takeScreenshot, Graphics::takeScreenshot(), and WindowMan.

Referenced by renderScene().

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

◆ getCurrentFSAA()

int Graphics::GraphicsManager::getCurrentFSAA ( ) const

Return the current FSAA level.

Definition at line 199 of file graphics.cpp.

References _fsaa.

◆ getFPS()

uint32 Graphics::GraphicsManager::getFPS ( ) const

How many frames per second to we render at the moments?

Definition at line 203 of file graphics.cpp.

References _fpsCounter.

◆ getGUIObjectAt()

Renderable * Graphics::GraphicsManager::getGUIObjectAt ( float  x,
float  y 
) const
private

Definition at line 808 of file graphics.cpp.

References _guiHeight, _guiWidth, _scalingType, Graphics::Renderable::isClickable(), Graphics::Renderable::isIn(), Graphics::kQueueVisibleGUIFrontObject, kScalingNone, QueueMan, and WindowMan.

Referenced by getObjectAt().

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

◆ getModelviewInverseMatrix()

const glm::mat4 & Graphics::GraphicsManager::getModelviewInverseMatrix ( ) const

Return the inverse modelview matrix (camera view).

Definition at line 1270 of file graphics.cpp.

References _modelviewInv.

◆ getModelviewMatrix() [1/2]

const glm::mat4 & Graphics::GraphicsManager::getModelviewMatrix ( ) const

Return the current modelview matrix (camera view).

Definition at line 1262 of file graphics.cpp.

References _modelview.

◆ getModelviewMatrix() [2/2]

glm::mat4 & Graphics::GraphicsManager::getModelviewMatrix ( )

Definition at line 1266 of file graphics.cpp.

References _modelview.

◆ getMultipleTextureCount()

size_t Graphics::GraphicsManager::getMultipleTextureCount ( ) const

Return the number of texture units for multiple textures.

Definition at line 195 of file graphics.cpp.

References _multipleTextureCount.

◆ getObjectAt()

Renderable * Graphics::GraphicsManager::getObjectAt ( float  x,
float  y 
)

Get the object at this screen position.

Definition at line 879 of file graphics.cpp.

References getGUIObjectAt(), and getWorldObjectAt().

Here is the call graph for this function:

◆ getProjectionInverseMatrix()

const glm::mat4 & Graphics::GraphicsManager::getProjectionInverseMatrix ( ) const

Return the inverse screen projection view matrix.

Definition at line 1258 of file graphics.cpp.

References _projectionInv.

◆ getProjectionMatrix() [1/2]

const glm::mat4 & Graphics::GraphicsManager::getProjectionMatrix ( ) const

Return the current screen projection view matrix.

Definition at line 1250 of file graphics.cpp.

References _projection.

◆ getProjectionMatrix() [2/2]

glm::mat4 & Graphics::GraphicsManager::getProjectionMatrix ( )

Definition at line 1254 of file graphics.cpp.

References _projection.

◆ getWorldObjectAt()

Renderable * Graphics::GraphicsManager::getWorldObjectAt ( float  x,
float  y 
) const
private

Definition at line 845 of file graphics.cpp.

References Graphics::Renderable::isClickable(), Graphics::Renderable::isIn(), Graphics::kQueueVisibleWorldObject, QueueMan, unproject(), and WindowMan.

Referenced by getObjectAt().

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

◆ init()

void Graphics::GraphicsManager::init ( )

Initialize the graphics subsystem.

Definition at line 122 of file graphics.cpp.

References _animationThread, _debugGL, _fsaa, _ready, _rendererExperimental, checkGLExtensions(), ConfigMan, Common::Thread::createThread(), Common::enforceMainThread(), MaterialMan, MeshMan, setFSAA(), setupScene(), setupSDLGL(), ShaderMan, SurfaceMan, and WindowMan.

Here is the call graph for this function:

◆ isGL3()

bool Graphics::GraphicsManager::isGL3 ( ) const

Are we currently running an OpenGL 3.x context?

Definition at line 1290 of file graphics.cpp.

References _renderType, and Graphics::WindowManager::kOpenGL32Compat.

◆ isRendererExperimental()

bool Graphics::GraphicsManager::isRendererExperimental ( ) const
inline

Definition at line 87 of file graphics.h.

References _rendererExperimental.

◆ lockFrame()

void Graphics::GraphicsManager::lockFrame ( )

Increase the frame lock counter, disabling all frame rendering.

Frame locking is useful for updating several things in one batch, where only the end result should be visible and not the individual steps.

Frame locking is re-entrant: you can lock the frame multiple times without causing a deadlock. As long as the frame lock counter is at least 1, no rendering is being done.

Definition at line 702 of file graphics.cpp.

References _frameEndSignal, _frameLock, EventMan, and Common::isMainThread().

Referenced by setCursor(), and takeScreenshot().

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

◆ needManualDeS3TC()

bool Graphics::GraphicsManager::needManualDeS3TC ( ) const

Do we need to do manual S3TC DXTn decompression?

Definition at line 187 of file graphics.cpp.

References _needManualDeS3TC.

◆ notifyResized()

void Graphics::GraphicsManager::notifyResized ( int  oldWidth,
int  oldHeight,
int  newWidth,
int  newHeight 
)
privatevirtual

Reimplemented from Events::Notifyable.

Definition at line 1354 of file graphics.cpp.

References destroyContext(), and rebuildContext().

Here is the call graph for this function:

◆ ortho()

void Graphics::GraphicsManager::ortho ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)
private

Set up an orthogonal projection matrix.

Analog to glOrtho.

Definition at line 521 of file graphics.cpp.

References _ortho, _orthoInv, _projection, _projectionInv, and inverse().

Referenced by setOrthogonal(), and setupScene().

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

◆ pauseAnimations()

void Graphics::GraphicsManager::pauseAnimations ( )

Pause animation thread.

Definition at line 1274 of file graphics.cpp.

References _animationThread, and Graphics::Aurora::AnimationThread::pause().

Here is the call graph for this function:

◆ perspective()

void Graphics::GraphicsManager::perspective ( float  fovy,
float  aspect,
float  zNear,
float  zFar 
)
private

Set up a projection matrix.

Analog to gluPerspective.

Definition at line 467 of file graphics.cpp.

References _perspective, _perspectiveInv, _projection, _projectionInv, Common::deg2rad(), and inverse().

Referenced by setPerspective(), and setupScene().

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

◆ playVideo()

bool Graphics::GraphicsManager::playVideo ( )
private

Definition at line 930 of file graphics.cpp.

References Graphics::kQueueVisibleVideo, Graphics::kRenderPassAll, QueueMan, Graphics::Renderable::render(), and WindowMan.

Referenced by renderScene().

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

◆ project()

bool Graphics::GraphicsManager::project ( float  x,
float  y,
float  z,
float &  sX,
float &  sY,
float &  sZ 
)

Map the given world coordinates onto screen coordinates.

Definition at line 551 of file graphics.cpp.

References _projection, CameraMan, Common::deg2rad(), and WindowMan.

Here is the call graph for this function:

◆ ready()

bool Graphics::GraphicsManager::ready ( ) const

Was the graphics subsystem successfully initialized?

Definition at line 183 of file graphics.cpp.

References _ready.

◆ rebuildContext()

void Graphics::GraphicsManager::rebuildContext ( )
private

Definition at line 1320 of file graphics.cpp.

References rebuildGLContainers(), RequestMan, and setupScene().

Referenced by notifyResized(), and setFSAA().

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

◆ rebuildGLContainers()

void Graphics::GraphicsManager::rebuildGLContainers ( )
private

Definition at line 1294 of file graphics.cpp.

References Graphics::kQueueGLContainer, and QueueMan.

Referenced by rebuildContext().

Here is the caller graph for this function:

◆ recalculateObjectDistances()

void Graphics::GraphicsManager::recalculateObjectDistances ( )

Recalculate all object distances to the camera and resort the objects.

Definition at line 729 of file graphics.cpp.

References Graphics::kQueueVisibleGUIBackObject, Graphics::kQueueVisibleGUIFrontObject, Graphics::kQueueVisibleWorldObject, and QueueMan.

◆ registerAnimatedModel()

void Graphics::GraphicsManager::registerAnimatedModel ( Aurora::Model model)

Register a model with the animation thread.

Definition at line 1282 of file graphics.cpp.

References _animationThread, and Graphics::Aurora::AnimationThread::registerModel().

Here is the call graph for this function:

◆ renderCursor()

bool Graphics::GraphicsManager::renderCursor ( )
private

Definition at line 1068 of file graphics.cpp.

References _cursor, buildNewTextures(), Graphics::Cursor::render(), and WindowMan.

Referenced by renderScene().

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

◆ renderCursorShader()

bool Graphics::GraphicsManager::renderCursorShader ( )
private

Definition at line 1176 of file graphics.cpp.

References _cursor, buildNewTextures(), Graphics::Cursor::render(), and WindowMan.

Referenced by renderScene().

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

◆ renderGUI()

bool Graphics::GraphicsManager::renderGUI ( ScalingType  scalingType,
QueueType  guiQueue,
bool  disableDepthMask 
)
private

Definition at line 1027 of file graphics.cpp.

References _guiHeight, _guiWidth, buildNewTextures(), Graphics::kRenderPassAll, kScalingWindowSize, QueueMan, Graphics::Renderable::render(), and WindowMan.

Referenced by renderGUIBack(), renderGUIConsole(), and renderGUIFront().

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

◆ renderGUIBack()

bool Graphics::GraphicsManager::renderGUIBack ( )
private

Definition at line 1019 of file graphics.cpp.

References _scalingType, Graphics::kQueueVisibleGUIBackObject, and renderGUI().

Referenced by renderScene().

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

◆ renderGUIBackShader()

bool Graphics::GraphicsManager::renderGUIBackShader ( )
private

Definition at line 1134 of file graphics.cpp.

References _scalingType, Graphics::kQueueVisibleGUIBackObject, and renderGUIShader().

Referenced by renderScene().

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

◆ renderGUIConsole()

bool Graphics::GraphicsManager::renderGUIConsole ( )
private

Definition at line 1023 of file graphics.cpp.

References Graphics::kQueueVisibleGUIConsoleObject, kScalingNone, and renderGUI().

Referenced by renderScene().

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

◆ renderGUIConsoleShader()

bool Graphics::GraphicsManager::renderGUIConsoleShader ( )
private

Definition at line 1138 of file graphics.cpp.

References Graphics::kQueueVisibleGUIConsoleObject, kScalingNone, and renderGUIShader().

Referenced by renderScene().

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

◆ renderGUIFront()

bool Graphics::GraphicsManager::renderGUIFront ( )
private

Definition at line 1015 of file graphics.cpp.

References _scalingType, Graphics::kQueueVisibleGUIFrontObject, and renderGUI().

Referenced by renderScene().

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

◆ renderGUIFrontShader()

bool Graphics::GraphicsManager::renderGUIFrontShader ( )
private

Definition at line 1130 of file graphics.cpp.

References _scalingType, Graphics::kQueueVisibleGUIFrontObject, and renderGUIShader().

Referenced by renderScene().

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

◆ renderGUIShader()

bool Graphics::GraphicsManager::renderGUIShader ( ScalingType  scalingType,
QueueType  guiQueue,
bool  disableDepthMask 
)
private

Definition at line 1142 of file graphics.cpp.

References _guiHeight, _guiWidth, _modelview, _projection, buildNewTextures(), kScalingWindowSize, QueueMan, Graphics::Renderable::renderImmediate(), and WindowMan.

Referenced by renderGUIBackShader(), renderGUIConsoleShader(), and renderGUIFrontShader().

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

◆ renderScene()

void Graphics::GraphicsManager::renderScene ( )

◆ renderWorld()

bool Graphics::GraphicsManager::renderWorld ( )
private

◆ renderWorldShader()

bool Graphics::GraphicsManager::renderWorldShader ( )
private

◆ resumeAnimations()

void Graphics::GraphicsManager::resumeAnimations ( )

Resume animation thread.

Definition at line 1278 of file graphics.cpp.

References _animationThread, and Graphics::Aurora::AnimationThread::resume().

Here is the call graph for this function:

◆ setCullFace()

void Graphics::GraphicsManager::setCullFace ( bool  enabled,
GLenum  mode = GL_BACK 
)

Enable/Disable face culling.

Definition at line 422 of file graphics.cpp.

References _cullFaceEnabled, _cullFaceMode, Common::isMainThread(), and RequestMan.

Referenced by setupScene().

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

◆ setCursor()

void Graphics::GraphicsManager::setCursor ( Cursor cursor = 0)

Set the current cursor.

Definition at line 792 of file graphics.cpp.

References _cursor, lockFrame(), and unlockFrame().

Here is the call graph for this function:

◆ setFSAA()

bool Graphics::GraphicsManager::setFSAA ( int  level)

Set the FSAA settings.

Definition at line 207 of file graphics.cpp.

References _debugGL, _fsaa, _renderType, destroyContext(), Common::isMainThread(), rebuildContext(), RequestMan, and WindowMan.

Referenced by init().

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

◆ setGUIScale()

void Graphics::GraphicsManager::setGUIScale ( ScalingType  scaling)

Configure scaling type for the GUI.

Definition at line 441 of file graphics.cpp.

References _scalingType.

◆ setGUISize()

void Graphics::GraphicsManager::setGUISize ( int  guiWidth,
int  guiHeight 
)

Configure the original size of the GUI.

Definition at line 445 of file graphics.cpp.

References _guiHeight, and _guiWidth.

◆ setOrthogonal()

void Graphics::GraphicsManager::setOrthogonal ( float  clipNear,
float  clipFar 
)

Change the projection matrix to be orthogonal.

Definition at line 505 of file graphics.cpp.

References _clipFar, _clipNear, _projectType, Common::isMainThread(), kProjectTypeOrthogonal, ortho(), RequestMan, and WindowMan.

Here is the call graph for this function:

◆ setPerspective()

void Graphics::GraphicsManager::setPerspective ( float  viewAngle,
float  clipNear,
float  clipFar 
)

Change the perspective projection matrix.

Definition at line 450 of file graphics.cpp.

References _clipFar, _clipNear, _projectType, _viewAngle, Common::isMainThread(), kProjectTypePerspective, perspective(), RequestMan, and WindowMan.

Here is the call graph for this function:

◆ setupScene()

void Graphics::GraphicsManager::setupScene ( )
private

Definition at line 382 of file graphics.cpp.

References _clipFar, _clipNear, _cullFaceEnabled, _cullFaceMode, _projectType, _viewAngle, kProjectTypeOrthogonal, kProjectTypePerspective, ortho(), perspective(), setCullFace(), and WindowMan.

Referenced by init(), and rebuildContext().

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

◆ setupSDLGL()

bool Graphics::GraphicsManager::setupSDLGL ( )
private

Setup SDL + OpenGL renderer.

We want OpenGL 3.2 for shader-based rendering and OpenGL 2.1 for the legacy renderer.

Definition at line 242 of file graphics.cpp.

References _debugGL, _fsaa, _rendererExperimental, _renderType, Graphics::WindowManager::kOpenGL21, Graphics::WindowManager::kOpenGL21Core, Graphics::WindowManager::kOpenGL32Compat, warning(), and WindowMan.

Referenced by init().

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

◆ supportMultipleTextures()

bool Graphics::GraphicsManager::supportMultipleTextures ( ) const

Do we have support for multiple textures?

Definition at line 191 of file graphics.cpp.

References _supportMultipleTextures.

◆ takeScreenshot()

void Graphics::GraphicsManager::takeScreenshot ( )

Take a screenshot.

Definition at line 800 of file graphics.cpp.

References _takeScreenshot, lockFrame(), and unlockFrame().

Here is the call graph for this function:

◆ unlockFrame()

void Graphics::GraphicsManager::unlockFrame ( )

Decrease the frame lock counter, potentially re-enabling frame rendering.

Whereas lockFrame() increases the frame lock counter, this method decreases it again. As soon as the frame lock counter reaches 0, i.e. the frame has been unlocked the same number of times it has been locked previously, all frame rendering is re-enabled.

Definition at line 723 of file graphics.cpp.

References _frameLock.

Referenced by setCursor(), and takeScreenshot().

Here is the caller graph for this function:

◆ unproject()

bool Graphics::GraphicsManager::unproject ( float  x,
float  y,
float &  x1,
float &  y1,
float &  z1,
float &  x2,
float &  y2,
float &  z2 
) const

Map the given screen coordinates onto a line in world space.

Definition at line 607 of file graphics.cpp.

References _clipFar, _clipNear, _projectionInv, _projectType, CameraMan, Common::deg2rad(), Common::exceptionDispatcherWarning(), kProjectTypeOrthogonal, kProjectTypePerspective, and WindowMan.

Referenced by getWorldObjectAt().

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

◆ unregisterAnimatedModel()

void Graphics::GraphicsManager::unregisterAnimatedModel ( Aurora::Model model)

Unregister a model from the animation thread.

Definition at line 1286 of file graphics.cpp.

References _animationThread, and Graphics::Aurora::AnimationThread::unregisterModel().

Here is the call graph for this function:

Member Data Documentation

◆ _abandonLists

std::list<ListID> Graphics::GraphicsManager::_abandonLists
private

Abandoned lists.

Definition at line 246 of file graphics.h.

Referenced by abandon(), and cleanupAbandoned().

◆ _abandonMutex

Common::Mutex Graphics::GraphicsManager::_abandonMutex
private

A mutex protecting abandoned structures.

Definition at line 248 of file graphics.h.

Referenced by abandon(), and cleanupAbandoned().

◆ _abandonTextures

std::vector<TextureID> Graphics::GraphicsManager::_abandonTextures
private

Abandoned textures.

Definition at line 245 of file graphics.h.

Referenced by abandon(), and cleanupAbandoned().

◆ _animationThread

Aurora::AnimationThread Graphics::GraphicsManager::_animationThread
private

◆ _clipFar

float Graphics::GraphicsManager::_clipFar
private

Definition at line 214 of file graphics.h.

Referenced by GraphicsManager(), setOrthogonal(), setPerspective(), setupScene(), and unproject().

◆ _clipNear

float Graphics::GraphicsManager::_clipNear
private

Definition at line 213 of file graphics.h.

Referenced by GraphicsManager(), setOrthogonal(), setPerspective(), setupScene(), and unproject().

◆ _cullFaceEnabled

bool Graphics::GraphicsManager::_cullFaceEnabled
private

Definition at line 207 of file graphics.h.

Referenced by GraphicsManager(), setCullFace(), and setupScene().

◆ _cullFaceMode

GLenum Graphics::GraphicsManager::_cullFaceMode
private

Definition at line 208 of file graphics.h.

Referenced by GraphicsManager(), setCullFace(), and setupScene().

◆ _cursor

Cursor* Graphics::GraphicsManager::_cursor
private

The current cursor.

Definition at line 236 of file graphics.h.

Referenced by GraphicsManager(), renderCursor(), renderCursorShader(), and setCursor().

◆ _debugGL

bool Graphics::GraphicsManager::_debugGL
private

Should we create an OpenGL debug context?

Definition at line 194 of file graphics.h.

Referenced by checkGLExtensions(), GraphicsManager(), init(), setFSAA(), and setupSDLGL().

◆ _fpsCounter

Common::ScopedPtr<FPSCounter> Graphics::GraphicsManager::_fpsCounter
private

Counts the current frames per seconds value.

Definition at line 220 of file graphics.h.

Referenced by endScene(), getFPS(), and GraphicsManager().

◆ _frameEndSignal

boost::atomic<bool> Graphics::GraphicsManager::_frameEndSignal
private

Definition at line 234 of file graphics.h.

Referenced by lockFrame(), and renderScene().

◆ _frameLock

boost::atomic<uint32> Graphics::GraphicsManager::_frameLock
private

Definition at line 233 of file graphics.h.

Referenced by GraphicsManager(), lockFrame(), renderScene(), and unlockFrame().

◆ _fsaa

int Graphics::GraphicsManager::_fsaa
private

Current FSAA settings.

Definition at line 205 of file graphics.h.

Referenced by beginScene(), endScene(), getCurrentFSAA(), GraphicsManager(), init(), setFSAA(), and setupSDLGL().

◆ _guiHeight

int Graphics::GraphicsManager::_guiHeight
private

Definition at line 217 of file graphics.h.

Referenced by getGUIObjectAt(), GraphicsManager(), renderGUI(), renderGUIShader(), and setGUISize().

◆ _guiWidth

int Graphics::GraphicsManager::_guiWidth
private

Definition at line 218 of file graphics.h.

Referenced by getGUIObjectAt(), GraphicsManager(), renderGUI(), renderGUIShader(), and setGUISize().

◆ _hasAbandoned

bool Graphics::GraphicsManager::_hasAbandoned
private

Do we have abandoned textures/lists?

Definition at line 243 of file graphics.h.

Referenced by abandon(), cleanupAbandoned(), and GraphicsManager().

◆ _lastSampled

uint32 Graphics::GraphicsManager::_lastSampled
private

Timestamp used to advance animations.

Definition at line 222 of file graphics.h.

Referenced by GraphicsManager().

◆ _modelview

glm::mat4 Graphics::GraphicsManager::_modelview
private

Our base modelview matrix (i.e camera view).

Definition at line 230 of file graphics.h.

Referenced by getModelviewMatrix(), renderGUIShader(), renderWorld(), and renderWorldShader().

◆ _modelviewInv

glm::mat4 Graphics::GraphicsManager::_modelviewInv
private

The inverse of our modelview matrix.

Definition at line 231 of file graphics.h.

Referenced by getModelviewInverseMatrix().

◆ _multipleTextureCount

size_t Graphics::GraphicsManager::_multipleTextureCount
private

The number of texture units for multiple textures.

Definition at line 201 of file graphics.h.

Referenced by checkGLExtensions(), deinit(), getMultipleTextureCount(), and GraphicsManager().

◆ _needManualDeS3TC

bool Graphics::GraphicsManager::_needManualDeS3TC
private

Do we need to do manual S3TC DXTn decompression?

Definition at line 199 of file graphics.h.

Referenced by checkGLExtensions(), deinit(), GraphicsManager(), and needManualDeS3TC().

◆ _ortho

glm::mat4 Graphics::GraphicsManager::_ortho
private

Orthographical projection matrix.

Definition at line 226 of file graphics.h.

Referenced by ortho().

◆ _orthoInv

glm::mat4 Graphics::GraphicsManager::_orthoInv
private

The inverse of our othographical matrix.

Definition at line 227 of file graphics.h.

Referenced by ortho().

◆ _perspective

glm::mat4 Graphics::GraphicsManager::_perspective
private

3D perspective projection matrix.

Definition at line 224 of file graphics.h.

Referenced by perspective(), and renderWorldShader().

◆ _perspectiveInv

glm::mat4 Graphics::GraphicsManager::_perspectiveInv
private

The inverse of our perspective matrix.

Definition at line 225 of file graphics.h.

Referenced by perspective(), and renderWorldShader().

◆ _projection

glm::mat4 Graphics::GraphicsManager::_projection
private

Our projection matrix.

Definition at line 228 of file graphics.h.

Referenced by getProjectionMatrix(), ortho(), perspective(), project(), renderGUIShader(), renderWorld(), and renderWorldShader().

◆ _projectionInv

glm::mat4 Graphics::GraphicsManager::_projectionInv
private

The inverse of our projection matrix.

Definition at line 229 of file graphics.h.

Referenced by getProjectionInverseMatrix(), ortho(), perspective(), renderWorldShader(), and unproject().

◆ _projectType

ProjectType Graphics::GraphicsManager::_projectType
private

Definition at line 210 of file graphics.h.

Referenced by GraphicsManager(), setOrthogonal(), setPerspective(), setupScene(), and unproject().

◆ _ready

bool Graphics::GraphicsManager::_ready
private

Was the graphics subsystem successfully initialized?

Definition at line 192 of file graphics.h.

Referenced by deinit(), GraphicsManager(), init(), and ready().

◆ _renderableID

uint32 Graphics::GraphicsManager::_renderableID
private

The last ID given to a renderable.

Definition at line 240 of file graphics.h.

Referenced by createRenderableID(), and GraphicsManager().

◆ _renderableIDMutex

Common::Mutex Graphics::GraphicsManager::_renderableIDMutex
private

The mutex to govern renderable ID creation.

Definition at line 241 of file graphics.h.

Referenced by createRenderableID().

◆ _rendererExperimental

bool Graphics::GraphicsManager::_rendererExperimental
private

Should we use the experimental shader based renderer?

Definition at line 196 of file graphics.h.

Referenced by GraphicsManager(), init(), isRendererExperimental(), renderScene(), and setupSDLGL().

◆ _renderType

WindowManager::RenderType Graphics::GraphicsManager::_renderType
private

Definition at line 203 of file graphics.h.

Referenced by GraphicsManager(), isGL3(), setFSAA(), and setupSDLGL().

◆ _scalingType

ScalingType Graphics::GraphicsManager::_scalingType
private

◆ _supportMultipleTextures

bool Graphics::GraphicsManager::_supportMultipleTextures
private

Do we have support for multiple textures?

Definition at line 200 of file graphics.h.

Referenced by checkGLExtensions(), deinit(), GraphicsManager(), and supportMultipleTextures().

◆ _takeScreenshot

bool Graphics::GraphicsManager::_takeScreenshot
private

Should screenshot be taken?

Definition at line 238 of file graphics.h.

Referenced by endScene(), GraphicsManager(), and takeScreenshot().

◆ _viewAngle

float Graphics::GraphicsManager::_viewAngle
private

Definition at line 212 of file graphics.h.

Referenced by GraphicsManager(), setPerspective(), and setupScene().


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