xoreos
0.0.5
|
The graphics manager. More...
#include <graphics.h>
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... | |
Renderable * | getObjectAt (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 () |
Renderable * | getGUIObjectAt (float x, float y) const |
Renderable * | getWorldObjectAt (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 () |
The graphics manager.
Definition at line 59 of file graphics.h.
|
private |
Enumerator | |
---|---|
kProjectTypePerspective | |
kProjectTypeOrthogonal |
Definition at line 187 of file graphics.h.
Enumerator | |
---|---|
kScalingNone | |
kScalingWindowSize |
Definition at line 61 of file graphics.h.
Graphics::GraphicsManager::GraphicsManager | ( | ) |
Definition at line 73 of file graphics.cpp.
References _clipFar, _clipNear, _cullFaceEnabled, _cullFaceMode, _cursor, _debugGL, _fpsCounter, _frameLock, _fsaa, _guiHeight, _guiWidth, _hasAbandoned, _lastSampled, _multipleTextureCount, _needManualDeS3TC, _projectType, _ready, _renderableID, _rendererExperimental, _renderType, _scalingType, _supportMultipleTextures, _takeScreenshot, _viewAngle, Graphics::glCompressedTexImage2D, Graphics::WindowManager::kOpenGL32Compat, kProjectTypePerspective, and kScalingNone.
Graphics::GraphicsManager::~GraphicsManager | ( | ) |
Definition at line 118 of file graphics.cpp.
References deinit().
Abandon these textures.
Definition at line 767 of file graphics.cpp.
References _abandonMutex, _abandonTextures, and _hasAbandoned.
Abandon these lists.
Definition at line 780 of file graphics.cpp.
References _abandonLists, _abandonMutex, and _hasAbandoned.
|
private |
Definition at line 918 of file graphics.cpp.
References _fsaa, and WindowMan.
Referenced by renderScene().
|
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().
|
private |
Definition at line 314 of file graphics.cpp.
References _debugGL, _multipleTextureCount, _needManualDeS3TC, _supportMultipleTextures, Graphics::glCompressedTexImage2D, Graphics::outputGLDebug(), and warning().
Referenced by init().
|
private |
Definition at line 1336 of file graphics.cpp.
References _abandonLists, _abandonMutex, _abandonTextures, and _hasAbandoned.
Referenced by renderScene().
uint32 Graphics::GraphicsManager::createRenderableID | ( | ) |
Create a new unique renderable ID.
Definition at line 761 of file graphics.cpp.
References _renderableID, and _renderableIDMutex.
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().
|
private |
Definition at line 1314 of file graphics.cpp.
References destroyGLContainers().
Referenced by notifyResized(), and setFSAA().
|
private |
Definition at line 1304 of file graphics.cpp.
References Graphics::kQueueGLContainer, and QueueMan.
Referenced by destroyContext().
|
private |
Definition at line 1199 of file graphics.cpp.
References _fpsCounter, _fsaa, _takeScreenshot, Graphics::takeScreenshot(), and WindowMan.
Referenced by renderScene().
int Graphics::GraphicsManager::getCurrentFSAA | ( | ) | const |
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.
|
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().
const glm::mat4 & Graphics::GraphicsManager::getModelviewInverseMatrix | ( | ) | const |
Return the inverse modelview matrix (camera view).
Definition at line 1270 of file graphics.cpp.
References _modelviewInv.
const glm::mat4 & Graphics::GraphicsManager::getModelviewMatrix | ( | ) | const |
Return the current modelview matrix (camera view).
Definition at line 1262 of file graphics.cpp.
References _modelview.
glm::mat4 & Graphics::GraphicsManager::getModelviewMatrix | ( | ) |
Definition at line 1266 of file graphics.cpp.
References _modelview.
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.
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().
const glm::mat4 & Graphics::GraphicsManager::getProjectionInverseMatrix | ( | ) | const |
Return the inverse screen projection view matrix.
Definition at line 1258 of file graphics.cpp.
References _projectionInv.
const glm::mat4 & Graphics::GraphicsManager::getProjectionMatrix | ( | ) | const |
Return the current screen projection view matrix.
Definition at line 1250 of file graphics.cpp.
References _projection.
glm::mat4 & Graphics::GraphicsManager::getProjectionMatrix | ( | ) |
Definition at line 1254 of file graphics.cpp.
References _projection.
|
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().
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.
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.
|
inline |
Definition at line 87 of file graphics.h.
References _rendererExperimental.
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().
bool Graphics::GraphicsManager::needManualDeS3TC | ( | ) | const |
Do we need to do manual S3TC DXTn decompression?
Definition at line 187 of file graphics.cpp.
References _needManualDeS3TC.
|
privatevirtual |
Reimplemented from Events::Notifyable.
Definition at line 1354 of file graphics.cpp.
References destroyContext(), and rebuildContext().
|
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().
void Graphics::GraphicsManager::pauseAnimations | ( | ) |
Pause animation thread.
Definition at line 1274 of file graphics.cpp.
References _animationThread, and Graphics::Aurora::AnimationThread::pause().
|
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().
|
private |
Definition at line 930 of file graphics.cpp.
References Graphics::kQueueVisibleVideo, Graphics::kRenderPassAll, QueueMan, Graphics::Renderable::render(), and WindowMan.
Referenced by renderScene().
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.
bool Graphics::GraphicsManager::ready | ( | ) | const |
Was the graphics subsystem successfully initialized?
Definition at line 183 of file graphics.cpp.
References _ready.
|
private |
Definition at line 1320 of file graphics.cpp.
References rebuildGLContainers(), RequestMan, and setupScene().
Referenced by notifyResized(), and setFSAA().
|
private |
Definition at line 1294 of file graphics.cpp.
References Graphics::kQueueGLContainer, and QueueMan.
Referenced by rebuildContext().
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.
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().
|
private |
Definition at line 1068 of file graphics.cpp.
References _cursor, buildNewTextures(), Graphics::Cursor::render(), and WindowMan.
Referenced by renderScene().
|
private |
Definition at line 1176 of file graphics.cpp.
References _cursor, buildNewTextures(), Graphics::Cursor::render(), and WindowMan.
Referenced by renderScene().
|
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().
|
private |
Definition at line 1019 of file graphics.cpp.
References _scalingType, Graphics::kQueueVisibleGUIBackObject, and renderGUI().
Referenced by renderScene().
|
private |
Definition at line 1134 of file graphics.cpp.
References _scalingType, Graphics::kQueueVisibleGUIBackObject, and renderGUIShader().
Referenced by renderScene().
|
private |
Definition at line 1023 of file graphics.cpp.
References Graphics::kQueueVisibleGUIConsoleObject, kScalingNone, and renderGUI().
Referenced by renderScene().
|
private |
Definition at line 1138 of file graphics.cpp.
References Graphics::kQueueVisibleGUIConsoleObject, kScalingNone, and renderGUIShader().
Referenced by renderScene().
|
private |
Definition at line 1015 of file graphics.cpp.
References _scalingType, Graphics::kQueueVisibleGUIFrontObject, and renderGUI().
Referenced by renderScene().
|
private |
Definition at line 1130 of file graphics.cpp.
References _scalingType, Graphics::kQueueVisibleGUIFrontObject, and renderGUIShader().
Referenced by renderScene().
|
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().
void Graphics::GraphicsManager::renderScene | ( | ) |
Render one complete frame of the scene.
Definition at line 1213 of file graphics.cpp.
References _frameEndSignal, _frameLock, _rendererExperimental, beginScene(), cleanupAbandoned(), endScene(), Common::enforceMainThread(), EventMan, playVideo(), renderCursor(), renderCursorShader(), renderGUIBack(), renderGUIBackShader(), renderGUIConsole(), renderGUIConsoleShader(), renderGUIFront(), renderGUIFrontShader(), renderWorld(), and renderWorldShader().
|
private |
Definition at line 954 of file graphics.cpp.
References _animationThread, _modelview, _projection, buildNewTextures(), CameraMan, Common::deg2rad(), Graphics::Aurora::AnimationThread::flush(), Graphics::kQueueVisibleWorldObject, Graphics::kRenderPassOpaque, Graphics::kRenderPassTransparent, QueueMan, and Graphics::Renderable::render().
Referenced by renderScene().
|
private |
Definition at line 1091 of file graphics.cpp.
References _animationThread, _modelview, _perspective, _perspectiveInv, _projection, _projectionInv, buildNewTextures(), CameraMan, Common::deg2rad(), Graphics::Aurora::AnimationThread::flush(), Graphics::kQueueVisibleWorldObject, QueueMan, Graphics::Renderable::queueRender(), and RenderMan.
Referenced by renderScene().
void Graphics::GraphicsManager::resumeAnimations | ( | ) |
Resume animation thread.
Definition at line 1278 of file graphics.cpp.
References _animationThread, and Graphics::Aurora::AnimationThread::resume().
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().
void Graphics::GraphicsManager::setCursor | ( | Cursor * | cursor = 0 | ) |
Set the current cursor.
Definition at line 792 of file graphics.cpp.
References _cursor, lockFrame(), and unlockFrame().
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().
void Graphics::GraphicsManager::setGUIScale | ( | ScalingType | scaling | ) |
Configure scaling type for the GUI.
Definition at line 441 of file graphics.cpp.
References _scalingType.
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.
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.
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.
|
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().
|
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().
bool Graphics::GraphicsManager::supportMultipleTextures | ( | ) | const |
Do we have support for multiple textures?
Definition at line 191 of file graphics.cpp.
References _supportMultipleTextures.
void Graphics::GraphicsManager::takeScreenshot | ( | ) |
Take a screenshot.
Definition at line 800 of file graphics.cpp.
References _takeScreenshot, lockFrame(), and 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().
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().
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().
|
private |
Abandoned lists.
Definition at line 246 of file graphics.h.
Referenced by abandon(), and cleanupAbandoned().
|
private |
A mutex protecting abandoned structures.
Definition at line 248 of file graphics.h.
Referenced by abandon(), and cleanupAbandoned().
|
private |
Abandoned textures.
Definition at line 245 of file graphics.h.
Referenced by abandon(), and cleanupAbandoned().
|
private |
Definition at line 250 of file graphics.h.
Referenced by deinit(), init(), pauseAnimations(), registerAnimatedModel(), renderWorld(), renderWorldShader(), resumeAnimations(), and unregisterAnimatedModel().
|
private |
Definition at line 214 of file graphics.h.
Referenced by GraphicsManager(), setOrthogonal(), setPerspective(), setupScene(), and unproject().
|
private |
Definition at line 213 of file graphics.h.
Referenced by GraphicsManager(), setOrthogonal(), setPerspective(), setupScene(), and unproject().
|
private |
Definition at line 207 of file graphics.h.
Referenced by GraphicsManager(), setCullFace(), and setupScene().
|
private |
Definition at line 208 of file graphics.h.
Referenced by GraphicsManager(), setCullFace(), and setupScene().
|
private |
The current cursor.
Definition at line 236 of file graphics.h.
Referenced by GraphicsManager(), renderCursor(), renderCursorShader(), and setCursor().
|
private |
Should we create an OpenGL debug context?
Definition at line 194 of file graphics.h.
Referenced by checkGLExtensions(), GraphicsManager(), init(), setFSAA(), and setupSDLGL().
|
private |
Counts the current frames per seconds value.
Definition at line 220 of file graphics.h.
Referenced by endScene(), getFPS(), and GraphicsManager().
|
private |
Definition at line 234 of file graphics.h.
Referenced by lockFrame(), and renderScene().
|
private |
Definition at line 233 of file graphics.h.
Referenced by GraphicsManager(), lockFrame(), renderScene(), and unlockFrame().
|
private |
Current FSAA settings.
Definition at line 205 of file graphics.h.
Referenced by beginScene(), endScene(), getCurrentFSAA(), GraphicsManager(), init(), setFSAA(), and setupSDLGL().
|
private |
Definition at line 217 of file graphics.h.
Referenced by getGUIObjectAt(), GraphicsManager(), renderGUI(), renderGUIShader(), and setGUISize().
|
private |
Definition at line 218 of file graphics.h.
Referenced by getGUIObjectAt(), GraphicsManager(), renderGUI(), renderGUIShader(), and setGUISize().
|
private |
Do we have abandoned textures/lists?
Definition at line 243 of file graphics.h.
Referenced by abandon(), cleanupAbandoned(), and GraphicsManager().
|
private |
Timestamp used to advance animations.
Definition at line 222 of file graphics.h.
Referenced by GraphicsManager().
|
private |
Our base modelview matrix (i.e camera view).
Definition at line 230 of file graphics.h.
Referenced by getModelviewMatrix(), renderGUIShader(), renderWorld(), and renderWorldShader().
|
private |
The inverse of our modelview matrix.
Definition at line 231 of file graphics.h.
Referenced by getModelviewInverseMatrix().
|
private |
The number of texture units for multiple textures.
Definition at line 201 of file graphics.h.
Referenced by checkGLExtensions(), deinit(), getMultipleTextureCount(), and GraphicsManager().
|
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().
|
private |
|
private |
The inverse of our othographical matrix.
Definition at line 227 of file graphics.h.
Referenced by ortho().
|
private |
3D perspective projection matrix.
Definition at line 224 of file graphics.h.
Referenced by perspective(), and renderWorldShader().
|
private |
The inverse of our perspective matrix.
Definition at line 225 of file graphics.h.
Referenced by perspective(), and renderWorldShader().
|
private |
Our projection matrix.
Definition at line 228 of file graphics.h.
Referenced by getProjectionMatrix(), ortho(), perspective(), project(), renderGUIShader(), renderWorld(), and renderWorldShader().
|
private |
The inverse of our projection matrix.
Definition at line 229 of file graphics.h.
Referenced by getProjectionInverseMatrix(), ortho(), perspective(), renderWorldShader(), and unproject().
|
private |
Definition at line 210 of file graphics.h.
Referenced by GraphicsManager(), setOrthogonal(), setPerspective(), setupScene(), and unproject().
|
private |
Was the graphics subsystem successfully initialized?
Definition at line 192 of file graphics.h.
Referenced by deinit(), GraphicsManager(), init(), and ready().
|
private |
The last ID given to a renderable.
Definition at line 240 of file graphics.h.
Referenced by createRenderableID(), and GraphicsManager().
|
private |
The mutex to govern renderable ID creation.
Definition at line 241 of file graphics.h.
Referenced by createRenderableID().
|
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().
|
private |
Definition at line 203 of file graphics.h.
Referenced by GraphicsManager(), isGL3(), setFSAA(), and setupSDLGL().
|
private |
Definition at line 216 of file graphics.h.
Referenced by getGUIObjectAt(), GraphicsManager(), renderGUIBack(), renderGUIBackShader(), renderGUIFront(), renderGUIFrontShader(), and setGUIScale().
|
private |
Do we have support for multiple textures?
Definition at line 200 of file graphics.h.
Referenced by checkGLExtensions(), deinit(), GraphicsManager(), and supportMultipleTextures().
|
private |
Should screenshot be taken?
Definition at line 238 of file graphics.h.
Referenced by endScene(), GraphicsManager(), and takeScreenshot().
|
private |
Definition at line 212 of file graphics.h.
Referenced by GraphicsManager(), setPerspective(), and setupScene().