summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-12 21:35:44 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-12 21:35:44 +0300
commitd9be27bba8941260500066cdd43ebb016356bc67 (patch)
tree884fa01ee78e6ed9a1c5ea526b1b5cd9e37df24b /src/render
parent18b2da68d0ae157778bab38d6a90f71e5bb95da2 (diff)
downloadmanaplus-d9be27bba8941260500066cdd43ebb016356bc67.tar.gz
manaplus-d9be27bba8941260500066cdd43ebb016356bc67.tar.bz2
manaplus-d9be27bba8941260500066cdd43ebb016356bc67.tar.xz
manaplus-d9be27bba8941260500066cdd43ebb016356bc67.zip
Add macro for checking OpenGL function is it null or not null.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/mglcheck.h31
-rw-r--r--src/render/mobileopenglgraphics.cpp2
-rw-r--r--src/render/modernopenglgraphics.cpp2
-rw-r--r--src/render/normalopenglgraphics.cpp2
-rw-r--r--src/render/safeopenglgraphics.cpp2
5 files changed, 35 insertions, 4 deletions
diff --git a/src/render/mglcheck.h b/src/render/mglcheck.h
new file mode 100644
index 000000000..8355d8ab9
--- /dev/null
+++ b/src/render/mglcheck.h
@@ -0,0 +1,31 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2012-2014 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef RENDER_MGLCHECK_H
+#define RENDER_MGLCHECK_H
+
+#include "main.h"
+#ifdef USE_OPENGL
+
+#define isGLNull(func) (!(func))
+#define isGLNotNull(func) ((func) != nullptr)
+
+#endif // USE_OPENGL
+#endif // RENDER_MGLCHECK_H
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp
index b0e78c534..339632f34 100644
--- a/src/render/mobileopenglgraphics.cpp
+++ b/src/render/mobileopenglgraphics.cpp
@@ -857,7 +857,7 @@ void MobileOpenGLGraphics::updateScreen()
SDL_GL_SwapBuffers();
#endif
#ifdef DEBUG_OPENGL
- if (mglFrameTerminator)
+ if (isGLNotNull(mglFrameTerminator))
mglFrameTerminator();
#endif
// may be need clear?
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp
index fc5e40062..5d87d415f 100644
--- a/src/render/modernopenglgraphics.cpp
+++ b/src/render/modernopenglgraphics.cpp
@@ -830,7 +830,7 @@ void ModernOpenGLGraphics::updateScreen()
SDL_GL_SwapBuffers();
#endif
#ifdef DEBUG_OPENGL
- if (mglFrameTerminator)
+ if (isGLNotNull(mglFrameTerminator))
mglFrameTerminator();
#endif
// may be need clear?
diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp
index f32003d49..81ed5ea71 100644
--- a/src/render/normalopenglgraphics.cpp
+++ b/src/render/normalopenglgraphics.cpp
@@ -1190,7 +1190,7 @@ void NormalOpenGLGraphics::updateScreen()
SDL_GL_SwapBuffers();
#endif
#ifdef DEBUG_OPENGL
- if (mglFrameTerminator)
+ if (isGLNotNull(mglFrameTerminator))
mglFrameTerminator();
#endif
// may be need clear?
diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp
index 1f381b2b9..c40637f68 100644
--- a/src/render/safeopenglgraphics.cpp
+++ b/src/render/safeopenglgraphics.cpp
@@ -464,7 +464,7 @@ void SafeOpenGLGraphics::updateScreen()
SDL_GL_SwapBuffers();
#endif
#ifdef DEBUG_OPENGL
- if (mglFrameTerminator)
+ if (isGLNotNull(mglFrameTerminator))
mglFrameTerminator();
#endif
BLOCK_END("Graphics::updateScreen")