28 #include <boost/bind.hpp> 30 #include "glm/gtc/type_ptr.hpp" 31 #include "glm/gtc/matrix_transform.hpp" 67 static glm::mat4
inverse(
const glm::mat4 &m);
141 GLenum glewErr = glewInit();
142 if (glewErr != GLEW_OK)
143 throw Common::Exception(
"Failed initializing glew: %s", glewGetErrorString(glewErr));
235 return _fsaa == level;
248 warning(
"Your graphics card hardware or driver does not support OpenGL 3.2. " 249 "Usage of experimental renderer is not possible");
267 static void outputGLDebug(GLenum source, GLenum type, GLuint
id, GLenum severity,
268 GLsizei
UNUSED(length),
const GLchar *message,
269 const void *
UNUSED(userParam)) {
271 static const uint32 kSourceLookup[] = {
280 static const uint32 kTypeLookup[] = {
289 static const uint32 kLevelLookup[] = {
290 GL_DEBUG_SEVERITY_HIGH_ARB , 1,
291 GL_DEBUG_SEVERITY_MEDIUM_ARB , 2,
292 GL_DEBUG_SEVERITY_LOW_ARB , 3,
293 GL_DEBUG_SEVERITY_NOTIFICATION, 4
297 for (
size_t i = 0; i <
ARRAYSIZE(kSourceLookup); i += 2)
298 if (source == (GLenum) kSourceLookup[i + 0])
302 for (
size_t i = 0; i <
ARRAYSIZE(kTypeLookup); i += 2)
303 if (type == (GLenum) kTypeLookup[i + 0])
307 for (
size_t i = 0; i <
ARRAYSIZE(kLevelLookup); i += 2)
308 if (severity == (GLenum) kLevelLookup[i + 0])
309 debugLevel = kLevelLookup[i + 1];
311 DebugMan.logDebugGL(debugChannel, debugLevel, debugType,
id, message);
315 if (!GLEW_EXT_texture_compression_s3tc) {
316 warning(
"Your graphics card does not support the needed extension " 317 "for S3TC DXT1, DXT3 and DXT5 texture decompression");
318 warning(
"Switching to manual S3TC DXTn decompression. " 319 "This will be slower and will take up more video memory");
326 (PFNGLCOMPRESSEDTEXIMAGE2DPROC)GLEW_GET_FUN(__glewCompressedTexImage2D) :
327 (PFNGLCOMPRESSEDTEXIMAGE2DPROC)GLEW_GET_FUN(__glewCompressedTexImage2DARB);
330 warning(
"Your graphics card doesn't support the compressed texture API");
331 warning(
"Switching to manual S3TC DXTn decompression. " 332 "This will be slower and will take up more video memory");
339 if (!GLEW_ARB_multitexture) {
343 GLint maxTextureCoords = -1;
344 glGetIntegerv(GL_MAX_TEXTURE_COORDS, &maxTextureCoords);
351 warning(
"Your graphics card does no support applying multiple textures onto " 353 warning(
"xoreos will only use one texture. Certain surfaces may look weird");
356 if (
_debugGL && GLEW_ARB_debug_output) {
357 warning(
"Enabled OpenGL debug output");
359 glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, 0, GL_TRUE);
378 glDebugMessageCallbackARB((GLDEBUGPROCARB) &
outputGLDebug, 0);
383 glClearColor(0, 0, 0, 0);
384 glMatrixMode(GL_PROJECTION);
388 glMatrixMode(GL_MODELVIEW);
391 glShadeModel(GL_SMOOTH);
392 glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
395 glEnable(GL_DEPTH_TEST);
396 glDepthFunc(GL_LEQUAL);
397 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
400 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
402 glAlphaFunc(GL_GREATER, 0.1f);
403 glEnable(GL_ALPHA_TEST);
431 glEnable(GL_CULL_FACE);
433 glDisable(GL_CULL_FACE);
468 assert(fabs(fovy) > 0.001f);
471 assert(zFar > zNear);
472 assert((zFar - zNear) > 0.001f);
476 const float t1 = (zFar + zNear) / (zNear - zFar);
477 const float t2 = (2 * zFar * zNear) / (zNear - zFar);
522 assert(zFar > zNear);
523 assert((zFar - zNear) > 0.001f);
528 _projection[3][0] = - ((right + left) / (right - left));
533 _projection[3][1] = - ((top + bottom) / (top - bottom));
538 _projection[3][2] = - ((zFar + zNear) / (zFar - zNear));
563 memcpy(cPos ,
CameraMan.getPosition (), 3 *
sizeof(float));
564 memcpy(cOrient,
CameraMan.getOrientation(), 3 *
sizeof(float));
567 model = glm::rotate(model,
Common::deg2rad(-cOrient[0]), glm::vec3(1.0f, 0.0f, 0.0f));
568 model = glm::rotate(model,
Common::deg2rad(-cOrient[1]), glm::vec3(0.0f, 1.0f, 0.0f));
569 model = glm::rotate(model,
Common::deg2rad(-cOrient[2]), glm::vec3(0.0f, 0.0f, 1.0f));
572 model = glm::translate(model, glm::vec3(-cPos[0], -cPos[1], -cPos[2]));
575 glm::vec4 coords(x, y, z, 1);
578 glm::vec4 v(proj * model * coords);
585 float divider = 1.0f / v.w;
598 sX = view[0] + view[2] * (v.x + 1.0f) / 2.0f;
599 sY = view[1] + view[3] * (v.y + 1.0f) / 2.0f;
600 sZ = (v.z + 1.0f) / 2.0f;
602 sX -= view[2] / 2.0f;
603 sY -= view[3] / 2.0f;
608 float &x1,
float &y1,
float &z1,
609 float &x2,
float &y2,
float &z2)
const {
619 memcpy(cPos ,
CameraMan.getPosition (), 3 *
sizeof(float));
620 memcpy(cOrient,
CameraMan.getOrientation(), 3 *
sizeof(float));
623 model = glm::translate(model, glm::vec3(cPos[0], cPos[1], cPos[2]));
626 model = glm::rotate(model,
Common::deg2rad(cOrient[2]), glm::vec3(0.0f, 0.0f, 1.0f));
627 model = glm::rotate(model,
Common::deg2rad(cOrient[1]), glm::vec3(0.0f, 1.0f, 0.0f));
628 model = glm::rotate(model,
Common::deg2rad(cOrient[0]), glm::vec3(1.0f, 0.0f, 0.0f));
636 glm::vec4 coordsNear, coordsFar;
642 const float view[4] = { 0.0f, 0.0f, (float)
WindowMan.getWindowWidth(), (float)
WindowMan.getWindowHeight() };
643 const float zNear = 0.0f;
644 const float zFar = 1.0f;
646 coordsNear.x = ((2 * (x - view[0])) / (view[2])) - 1.0f;
647 coordsNear.y = ((2 * (y - view[1])) / (view[3])) - 1.0f;
648 coordsNear.z = (2 * zNear) - 1.0f;
651 coordsFar.x = ((2 * (x - view[0])) / (view[2])) - 1.0f;
652 coordsFar.y = ((2 * (y - view[1])) / (view[3])) - 1.0f;
653 coordsFar.z = (2 * zFar) - 1.0f;
674 glm::vec4 oNear(model * coordsNear);
675 glm::vec4 oFar (model * coordsFar );
676 if ((oNear.w == 0.0f) || (oFar.w == 0.0f))
682 oNear.w = 1.0f / oNear.w;
684 x1 = oNear.x * oNear.w;
685 y1 = oNear.y * oNear.w;
686 z1 = oNear.z * oNear.w;
688 oFar.w = 1.0f / oFar.w;
690 x2 = oFar.x * oFar.w;
691 y2 = oFar.y * oFar.w;
692 z2 = oFar.z * oFar.w;
705 assert(lock != 0xFFFFFFFF);
734 for (std::list<Queueable *>::const_iterator o = objects.begin(); o != objects.end(); ++o)
735 static_cast<Renderable *>(*o)->calculateDistance();
744 for (std::list<Queueable *>::const_iterator g = guiFront.begin(); g != guiFront.end(); ++g)
745 static_cast<Renderable *>(*g)->calculateDistance();
754 for (std::list<Queueable *>::const_iterator g = guiBack.begin(); g != guiBack.end(); ++g)
755 static_cast<Renderable *>(*g)->calculateDistance();
814 x = x - (
WindowMan.getWindowWidth() / 2.0f);
827 for (std::list<Queueable *>::const_iterator g = gui.begin(); g != gui.end(); ++g) {
852 float x1, y1, z1, x2, y2, z2;
853 if (!
unproject(x, y, x1, y1, z1, x2, y2, z2))
861 for (std::list<Queueable *>::const_iterator o = objects.begin(); o != objects.end(); ++o) {
869 if (r.
isIn(x1, y1, z1, x2, y2, z2)) {
897 for (std::list<Queueable *>::const_iterator t = shadq.begin(); t != shadq.end(); ++t)
898 static_cast<GLContainer *>(*t)->rebuild();
911 for (std::list<Queueable *>::const_iterator t = text.begin(); t != text.end(); ++t)
912 static_cast<GLContainer *>(*t)->rebuild();
922 glEnable(GL_MULTISAMPLE_ARB);
925 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
927 glEnable(GL_TEXTURE_2D);
934 glMatrixMode(GL_PROJECTION);
936 glScalef(2.0f /
WindowMan.getWindowWidth(), 2.0f /
WindowMan.getWindowHeight(), 0.0f);
938 glMatrixMode(GL_MODELVIEW);
944 for (std::list<Queueable *>::const_iterator v = videos.begin(); v != videos.end(); ++v) {
961 memcpy(cPos ,
CameraMan.getPosition (), 3 *
sizeof(float));
962 memcpy(cOrient,
CameraMan.getOrientation(), 3 *
sizeof(float));
964 glMatrixMode(GL_PROJECTION);
969 glMatrixMode(GL_MODELVIEW);
973 glRotatef(-cOrient[0], 1.0f, 0.0f, 0.0f);
974 glRotatef(-cOrient[1], 0.0f, 1.0f, 0.0f);
975 glRotatef(-cOrient[2], 0.0f, 0.0f, 1.0f);
978 glTranslatef(-cPos[0], -cPos[1], -cPos[2]);
994 for (std::list<Queueable *>::const_reverse_iterator o = objects.rbegin();
995 o != objects.rend(); ++o) {
1003 for (std::list<Queueable *>::const_reverse_iterator o = objects.rbegin();
1004 o != objects.rend(); ++o) {
1028 if (
QueueMan.isQueueEmpty(guiQueue))
1031 glDisable(GL_DEPTH_TEST);
1032 if (disableDepthMask)
1033 glDepthMask(GL_FALSE);
1035 glMatrixMode(GL_PROJECTION);
1038 int windowWidth =
WindowMan.getWindowWidth();
1039 int windowHeight =
WindowMan.getWindowHeight();
1042 glScalef(2.0f / rasterWidth, 2.0f / rasterHeight, 0.0f);
1044 glMatrixMode(GL_MODELVIEW);
1048 const std::list<Queueable *> &gui =
QueueMan.getQueue(guiQueue);
1052 for (std::list<Queueable *>::const_reverse_iterator g = gui.rbegin();
1053 g != gui.rend(); ++g) {
1062 if (disableDepthMask)
1063 glDepthMask(GL_TRUE);
1064 glEnable(GL_DEPTH_TEST);
1074 glDisable(GL_DEPTH_TEST);
1075 glMatrixMode(GL_PROJECTION);
1077 glScalef(2.0f /
WindowMan.getWindowWidth(), 2.0f /
WindowMan.getWindowHeight(), 0.0f);
1078 glTranslatef(- (
WindowMan.getWindowWidth() / 2.0f),
WindowMan.getWindowHeight() / 2.0f, 0.0f);
1080 glMatrixMode(GL_TEXTURE);
1083 glMatrixMode(GL_MODELVIEW);
1087 glEnable(GL_DEPTH_TEST);
1101 memcpy(cPos ,
CameraMan.getPosition (), 3 *
sizeof(float));
1102 memcpy(cOrient,
CameraMan.getOrientation(), 3 *
sizeof(float));
1119 for (std::list<Queueable *>::const_reverse_iterator o = objects.rbegin();
1120 o != objects.rend(); ++o) {
1143 if (
QueueMan.isQueueEmpty(guiQueue))
1146 glDisable(GL_DEPTH_TEST);
1147 if (disableDepthMask)
1148 glDepthMask(GL_FALSE);
1150 int windowWidth =
WindowMan.getWindowWidth();
1151 int windowHeight =
WindowMan.getWindowHeight();
1154 _projection = glm::scale(glm::mat4(), glm::vec3(2.0f / rasterWidth, 2.0f / rasterHeight, 0.0f));
1157 const std::list<Queueable *> &gui =
QueueMan.getQueue(guiQueue);
1163 for (std::list<Queueable *>::const_reverse_iterator g = gui.rbegin();
1164 g != gui.rend(); ++g) {
1170 if (disableDepthMask)
1171 glDepthMask(GL_TRUE);
1172 glEnable(GL_DEPTH_TEST);
1182 glDisable(GL_DEPTH_TEST);
1183 glMatrixMode(GL_PROJECTION);
1185 glScalef(2.0f /
WindowMan.getWindowWidth(), 2.0f /
WindowMan.getWindowHeight(), 0.0f);
1186 glTranslatef(- (
WindowMan.getWindowWidth() / 2.0f),
WindowMan.getWindowHeight() / 2.0f, 0.0f);
1188 glMatrixMode(GL_TEXTURE);
1191 glMatrixMode(GL_MODELVIEW);
1195 glEnable(GL_DEPTH_TEST);
1210 glDisable(GL_MULTISAMPLE_ARB);
1218 if (
EventMan.quitRequested() || (
_frameLock.load(boost::memory_order_acquire) > 0)) {
1298 for (std::list<Queueable *>::const_iterator c = cont.begin(); c != cont.end(); ++c)
1299 static_cast<GLContainer *>(*c)->rebuild();
1308 for (std::list<Queueable *>::const_iterator c = cont.begin(); c != cont.end(); ++c)
1309 static_cast<GLContainer *>(*c)->destroy();
1322 GLenum glewErr = glewInit();
1323 if (glewErr != GLEW_OK)
1324 throw Common::Exception(
"Failed initializing glew: %s", glewGetErrorString(glewErr));
1346 glDeleteLists(*l, 1);
1364 float A0 = (m[0][0] * m[1][1]) - (m[0][1] * m[1][0]);
1365 float A1 = (m[0][0] * m[1][2]) - (m[0][2] * m[1][0]);
1366 float A2 = (m[0][0] * m[1][3]) - (m[0][3] * m[1][0]);
1367 float A3 = (m[0][1] * m[1][2]) - (m[0][2] * m[1][1]);
1368 float A4 = (m[0][1] * m[1][3]) - (m[0][3] * m[1][1]);
1369 float A5 = (m[0][2] * m[1][3]) - (m[0][3] * m[1][2]);
1370 float B0 = (m[2][0] * m[3][1]) - (m[2][1] * m[3][0]);
1371 float B1 = (m[2][0] * m[3][2]) - (m[2][2] * m[3][0]);
1372 float B2 = (m[2][0] * m[3][3]) - (m[2][3] * m[3][0]);
1373 float B3 = (m[2][1] * m[3][2]) - (m[2][2] * m[3][1]);
1374 float B4 = (m[2][1] * m[3][3]) - (m[2][3] * m[3][1]);
1375 float B5 = (m[2][2] * m[3][3]) - (m[2][3] * m[3][2]);
1377 float det = A0*B5 -
A1*B4 +
A2*B3 +
A3*B2 -
A4*B1 + A5*B0;
1379 if (fabs(det) <= 0.00001f)
1385 t[0][0] = (m[1][1] * B5 - m[1][2] * B4 + m[1][3] * B3) * det;
1386 t[1][0] = (m[1][2] * B2 - m[1][3] * B1 - m[1][0] * B5) * det;
1387 t[2][0] = (m[1][0] * B4 - m[1][1] * B2 + m[1][3] * B0) * det;
1388 t[3][0] = (m[1][1] * B1 - m[1][0] * B3 - m[1][2] * B0) * det;
1389 t[0][1] = (m[0][2] * B4 - m[0][3] * B3 - m[0][1] * B5) * det;
1390 t[1][1] = (m[0][0] * B5 - m[0][2] * B2 + m[0][3] * B1) * det;
1391 t[2][1] = (m[0][1] * B2 - m[0][3] * B0 - m[0][0] * B4) * det;
1392 t[3][1] = (m[0][0] * B3 - m[0][1] * B1 + m[0][2] * B0) * det;
1393 t[0][2] = (m[3][1] * A5 - m[3][2] *
A4 + m[3][3] *
A3) * det;
1394 t[1][2] = (m[3][2] *
A2 - m[3][3] *
A1 - m[3][0] * A5) * det;
1395 t[2][2] = (m[3][0] *
A4 - m[3][1] *
A2 + m[3][3] * A0) * det;
1396 t[3][2] = (m[3][1] *
A1 - m[3][0] *
A3 - m[3][2] * A0) * det;
1397 t[0][3] = (m[2][2] *
A4 - m[2][3] *
A3 - m[2][1] * A5) * det;
1398 t[1][3] = (m[2][0] * A5 - m[2][2] *
A2 + m[2][3] *
A1) * det;
1399 t[2][3] = (m[2][1] *
A2 - m[2][3] * A0 - m[2][0] *
A4) * det;
1400 t[3][3] = (m[2][0] *
A3 - m[2][1] *
A1 + m[2][2] * A0) * det;
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.
static void outputGLDebug(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
Generic image decoder interface.
bool takeScreenshot()
Saves a screenshot to a file.
Inter-thread request events.
Make the render window display our icon.
Cursor * _cursor
The current cursor.
size_t getMultipleTextureCount() const
Return the number of texture units for multiple textures.
Only render transparent parts.
The global graphics manager.
Behavior that has been marked for deprecation.
An object containing shader information.
"GGLAPI", OpenGL debug message generated by the GL.
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.
An object containing OpenGL structures.
void init()
Initialize the graphics subsystem.
"GGLWindow", OpenGL debug message generated by the windowing system.
Template specialization for a MainThreadFunctor returning void.
The global config manager.
#define SurfaceMan
Shortcut for accessing the shader manager.
A visible Debug Console object, in front of the Front GUI.
bool isMainThread()
Returns true if called from the main thread, false otherwise.
uint32 _lastSampled
Timestamp used to advance animations.
A visible GUI object, in front of the world objects.
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).
bool setupSDLGL()
Setup SDL + OpenGL renderer.
#define ARRAYSIZE(x)
Macro which determines the number of entries in a fixed size array.
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.
#define QueueMan
Shortcut for accessing the graphics queue manager.
Exception that provides a stack of explanations.
glm::mat4 _perspective
3D perspective projection matrix.
void rebuildGLContainers()
A container of OpenGL elements.
void exceptionDispatcherWarning(const char *s,...)
Exception dispatcher that prints the exception as a warning, and adds another reason on top...
A class counting frames per second.
uint32 _renderableID
The last ID given to a renderable.
The notification manager, handling all notifications.
glm::mat4 _orthoInv
The inverse of our othographical matrix.
WindowManager::RenderType _renderType
void unregisterModel(Model *model)
Remove a model from the processing pool.
Basic exceptions to throw.
virtual void renderImmediate(const glm::mat4 &parentTransform)
For shader based systems, don't sort anything, render this right_now.
bool renderGUIFrontShader()
Threading system helpers.
virtual void queueRender(const glm::mat4 &parentTransform)
Queue the object for later rendering.
void notifyResized(int oldWidth, int oldHeight, int newWidth, int newHeight)
glm::mat4 _perspectiveInv
The inverse of our perspective matrix.
bool createThread(const UString &name="")
The debug manager, managing debug channels.
The global shader manager.
#define ConfigMan
Shortcut for accessing the config manager.
Utility templates and functions.
void destroyGLContainers()
Basic xoreos version information.
#define DECLARE_SINGLETON(T)
Note that you need to use this macro from the global namespace.
void registerAnimatedModel(Aurora::Model *model)
Register a model with the animation thread.
The global events manager.
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.
"GGLApp", OpenGL debug message generated by the application.
DebugGLType
Types of OpenGL debug messages.
bool needManualDeS3TC() const
Do we need to do manual S3TC DXTn decompression?
A visible object in 3D space.
Events that generated an error.
bool _takeScreenshot
Should screenshot be taken?
The global shader material manager.
The global shader surface manager.
std::list< ListID > _abandonLists
Abandoned lists.
void recalculateObjectDistances()
Recalculate all object distances to the camera and resort the objects.
#define MaterialMan
Shortcut for accessing the shader material manager.
void registerModel(Model *model)
Add a model to the processing pool.
bool project(float x, float y, float z, float &sX, float &sY, float &sZ)
Map the given world coordinates onto screen coordinates.
virtual void render()=0
Render the cursor.
void perspective(float fovy, float aspect, float zNear, float zFar)
Set up a projection matrix.
The graphics queue manager.
void unregisterAnimatedModel(Aurora::Model *model)
Unregister a model from the animation thread.
A currently playing video.
void warning(const char *s,...)
virtual bool isIn(float x, float y) const
Is that point within the object?
void takeScreenshot()
Take a screenshot.
void flush()
Apply changes to position and geometry of all models in the processing pool.
bool renderGUIConsoleShader()
int _fsaa
Current FSAA settings.
glm::mat4 _projection
Our projection matrix.
Behavior that is undefined according to the specification.
bool renderGUI(ScalingType scalingType, QueueType guiQueue, bool disableDepthMask)
Convenience class that locks a mutex on creation and unlocks it on destruction.
#define DebugMan
Shortcut for accessing the debug manager.
#define EventMan
Shortcut for accessing the events manager.
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).
#define MeshMan
Shortcut for accessing the shader manager.
An object that can be displayed by the graphics manager.
bool setFSAA(int level)
Set the FSAA settings.
#define WindowMan
Shortcut for accessing the window manager.
DebugChannel
All debug channels.
void unlockFrame()
Decrease the frame lock counter, potentially re-enabling frame rendering.
void setCursor(Cursor *cursor=0)
Set the current cursor.
void enforceMainThread()
Throws an Exception if called from a non-main thread.
boost::atomic< bool > _frameEndSignal
Renderable * getWorldObjectAt(float x, float y) const
const glm::mat4 & getProjectionInverseMatrix() const
Return the inverse screen projection view matrix.
"GGLOther", OpenGL debug message generated by other sources.
#define ShaderMan
Shortcut for accessing the shader manager.
bool _rendererExperimental
Should we use the experimental shader based renderer?
static glm::mat4 inverse(const glm::mat4 &m)
const glm::mat4 & getModelviewMatrix() const
Return the current modelview matrix (camera view).
Types of events that do not fit any of the ones listed above.
Renderable * getGUIObjectAt(float x, float y) const
bool ready() const
Was the graphics subsystem successfully initialized?
void deinit()
Deinitialize the graphics subsystem.
#define RequestMan
Shortcut for accessing the request manager.
#define CameraMan
Shortcut for accessing the camera manager.
void abandon(TextureID *ids, uint32 count)
Abandon these textures.
Use of extensions or shaders in a way that is highly vendor-specific.
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?
"GGL3rd", OpenGL debug message generated by third party middleware.
A visible GUI object, behind the world objects.
static float deg2rad(float deg)
An object that can be displayed by the graphics manager.
A functor for a function that needs to be called in the main thread.
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.
"GGLShader", OpenGL debug message generated by the shader compiler.
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.
Only render opaque parts.
bool isClickable() const
Is the object clickable?
PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D
glm::mat4 _modelviewInv
The inverse of our modelview matrix.
virtual void render(RenderPass pass)=0
Render the object.
std::vector< TextureID > _abandonTextures
Abandoned textures.
Aurora::AnimationThread _animationThread
Implementation-dependent performance warnings.
#define RenderMan
Shortcut for accessing the render manager.
bool renderCursorShader()