25 #ifndef GRAPHICS_GRAPHICS_H 26 #define GRAPHICS_GRAPHICS_H 33 #include "glm/mat4x4.hpp" 99 void setCullFace(
bool enabled, GLenum mode = GL_BACK);
107 void setPerspective(
float viewAngle,
float clipNear,
float clipFar);
118 bool project(
float x,
float y,
float z,
float &sX,
float &sY,
float &sZ);
122 float &x1,
float &y1,
float &z1,
123 float &x2,
float &y2,
float &z2)
const;
258 void perspective(
float fovy,
float aspect,
float zNear,
float zFar);
260 void ortho(
float left,
float right,
float bottom,
float top,
float zNear,
float zFar);
293 void notifyResized(
int oldWidth,
int oldHeight,
int newWidth,
int newHeight);
299 #define GfxMan Graphics::GraphicsManager::instance() 301 #endif // GRAPHICS_GRAPHICS_H void lockFrame()
Increase the frame lock counter, disabling all frame rendering.
bool isGL3() const
Are we currently running an OpenGL 3.x context?
bool _supportMultipleTextures
Do we have support for multiple textures?
Common::Mutex _abandonMutex
A mutex protecting abandoned structures.
Cursor * _cursor
The current cursor.
Class and macro for implementing singletons.
size_t getMultipleTextureCount() const
Return the number of texture units for multiple textures.
uint32 getFPS() const
How many frames per second to we render at the moments?
Common::ScopedPtr< FPSCounter > _fpsCounter
Counts the current frames per seconds value.
void init()
Initialize the graphics subsystem.
uint32 _lastSampled
Timestamp used to advance animations.
Renderable * getObjectAt(float x, float y)
Get the object at this screen position.
bool _ready
Was the graphics subsystem successfully initialized?
bool supportMultipleTextures() const
Do we have support for multiple textures?
const glm::mat4 & getModelviewInverseMatrix() const
Return the inverse modelview matrix (camera view).
The global window manager.
bool setupSDLGL()
Setup SDL + OpenGL renderer.
Common::Mutex _renderableIDMutex
The mutex to govern renderable ID creation.
bool renderGUIShader(ScalingType scalingType, QueueType guiQueue, bool disableDepthMask)
bool renderGUIBackShader()
glm::mat4 _projectionInv
The inverse of our projection matrix.
void resumeAnimations()
Resume animation thread.
A simple scoped smart pointer template.
glm::mat4 _perspective
3D perspective projection matrix.
void rebuildGLContainers()
uint32 _renderableID
The last ID given to a renderable.
glm::mat4 _orthoInv
The inverse of our othographical matrix.
WindowManager::RenderType _renderType
bool renderGUIFrontShader()
void notifyResized(int oldWidth, int oldHeight, int newWidth, int newHeight)
glm::mat4 _perspectiveInv
The inverse of our perspective matrix.
Generic template base class for implementing the singleton design pattern.
void destroyGLContainers()
void registerAnimatedModel(Aurora::Model *model)
Register a model with the animation thread.
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.
void setGUISize(int guiWidth, int guiHeight)
Configure the original size of the GUI.
bool needManualDeS3TC() const
Do we need to do manual S3TC DXTn decompression?
bool _takeScreenshot
Should screenshot be taken?
Low-level type definitions to handle fixed width types portably.
std::list< ListID > _abandonLists
Abandoned lists.
A class that can be notified by the NotificationManager.
void recalculateObjectDistances()
Recalculate all object distances to the camera and resort the objects.
bool project(float x, float y, float z, float &sX, float &sY, float &sZ)
Map the given world coordinates onto screen coordinates.
A scoped plain pointer, allowing pointer-y access and normal deletion.
void perspective(float fovy, float aspect, float zNear, float zFar)
Set up a projection matrix.
void unregisterAnimatedModel(Aurora::Model *model)
Unregister a model from the animation thread.
void takeScreenshot()
Take a screenshot.
bool renderGUIConsoleShader()
int _fsaa
Current FSAA settings.
glm::mat4 _projection
Our projection matrix.
bool renderGUI(ScalingType scalingType, QueueType guiQueue, bool disableDepthMask)
Helper header to include boost::atomic.
uint32 createRenderableID()
Create a new unique renderable ID.
void ortho(float left, float right, float bottom, float top, float zNear, float zFar)
Set up an orthogonal projection matrix.
glm::mat4 _modelview
Our base modelview matrix (i.e camera view).
bool isRendererExperimental() const
An object that can be displayed by the graphics manager.
bool setFSAA(int level)
Set the FSAA settings.
void unlockFrame()
Decrease the frame lock counter, potentially re-enabling frame rendering.
void setCursor(Cursor *cursor=0)
Set the current cursor.
boost::atomic< bool > _frameEndSignal
Renderable * getWorldObjectAt(float x, float y) const
const glm::mat4 & getProjectionInverseMatrix() const
Return the inverse screen projection view matrix.
bool _rendererExperimental
Should we use the experimental shader based renderer?
const glm::mat4 & getModelviewMatrix() const
Return the current modelview matrix (camera view).
Renderable * getGUIObjectAt(float x, float y) const
bool ready() const
Was the graphics subsystem successfully initialized?
void deinit()
Deinitialize the graphics subsystem.
void abandon(TextureID *ids, uint32 count)
Abandon these textures.
void setPerspective(float viewAngle, float clipNear, float clipFar)
Change the perspective projection matrix.
glm::mat4 _ortho
Orthographical projection matrix.
int getCurrentFSAA() const
Return the current FSAA level.
const glm::mat4 & getProjectionMatrix() const
Return the current screen projection view matrix.
void pauseAnimations()
Pause animation thread.
void setGUIScale(ScalingType scaling)
Configure scaling type for the GUI.
boost::atomic< uint32 > _frameLock
bool _needManualDeS3TC
Do we need to do manual S3TC DXTn decompression?
bool _debugGL
Should we create an OpenGL debug context?
void renderScene()
Render one complete frame of the scene.
void setOrthogonal(float clipNear, float clipFar)
Change the projection matrix to be orthogonal.
bool _hasAbandoned
Do we have abandoned textures/lists?
size_t _multipleTextureCount
The number of texture units for multiple textures.
void setCullFace(bool enabled, GLenum mode=GL_BACK)
Enable/Disable face culling.
glm::mat4 _modelviewInv
The inverse of our modelview matrix.
Dedicated animation thread.
std::vector< TextureID > _abandonTextures
Abandoned textures.
Aurora::AnimationThread _animationThread
bool renderCursorShader()