summaryrefslogtreecommitdiff
path: root/src/render/graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-09 19:20:41 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-09 20:25:57 +0300
commit62a416d5585106c2ce8e2259036740e7ba2c70c7 (patch)
tree4036eb451cba39c6353658353cc80d42a6b9f044 /src/render/graphics.cpp
parent6e052536a2dfb7f877a356477bc86c904aae1e71 (diff)
downloadmanaverse-62a416d5585106c2ce8e2259036740e7ba2c70c7.tar.gz
manaverse-62a416d5585106c2ce8e2259036740e7ba2c70c7.tar.bz2
manaverse-62a416d5585106c2ce8e2259036740e7ba2c70c7.tar.xz
manaverse-62a416d5585106c2ce8e2259036740e7ba2c70c7.zip
Improve initial OpenGL state.
Moved shared code into separate method.
Diffstat (limited to 'src/render/graphics.cpp')
-rw-r--r--src/render/graphics.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index 4c5d1d282..2a835aeeb 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -80,6 +80,7 @@
#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#endif
+#include "render/mgldefines.h"
#endif
#include "debug.h"
@@ -638,3 +639,31 @@ const ClipRect *Graphics::getCurrentClipArea() const
return &mClipStack.top();
}
+
+#ifdef USE_OPENGL
+void Graphics::setOpenGLFlags()
+{
+ glEnable(GL_SCISSOR_TEST);
+
+ glDisable(GL_MULTISAMPLE);
+ glDisable(GL_DITHER);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LINE_SMOOTH);
+ glDisable(GL_POLYGON_SMOOTH);
+ glDisable(GL_STENCIL_TEST);
+ glDisable(GL_COLOR_LOGIC_OP);
+ glDisable(GL_DEPTH_BOUNDS_TEST_EXT);
+ glDisable(GL_DEPTH_CLAMP);
+ glDisable(GL_RASTERIZER_DISCARD);
+ glDisable(GL_SAMPLE_MASK);
+
+#ifndef ANDROID
+#ifndef __MINGW32__
+ glHint(GL_TEXTURE_COMPRESSION_HINT, GL_FASTEST);
+#endif
+#endif
+ glHint(GL_TEXTURE_COMPRESSION_HINT_ARB, GL_FASTEST);
+
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+}
+#endif