From eee37022f2e4c589b68a3bbf573577c1b253c151 Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Mon, 27 Jan 2020 19:52:36 +0100 Subject: [PATCH] Fixes #1241 - Add a convenient Graphics Debug Option for the AppSettings (#1256) --- .../java/com/jme3/system/AppSettings.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/system/AppSettings.java b/jme3-core/src/main/java/com/jme3/system/AppSettings.java index bd8db3107..62d250c38 100644 --- a/jme3-core/src/main/java/com/jme3/system/AppSettings.java +++ b/jme3-core/src/main/java/com/jme3/system/AppSettings.java @@ -1138,7 +1138,7 @@ public final class AppSettings extends HashMap { /** * True to enable the creation of an OpenCL context. * - * @param support + * @param support whether to create the context or not */ public void setOpenCLSupport(boolean support) { putBoolean("OpenCL", support); @@ -1163,4 +1163,28 @@ public final class AppSettings extends HashMap { public String getOpenCLPlatformChooser() { return getString("OpenCLPlatformChooser"); } + + /** + * Determine if the renderer will be run in Graphics Debug mode, which means every openGL Call is checked and + * if it returns an error code, throw a {@link com.jme3.renderer.RendererException}.
+ * Without this, many openGL calls might fail without notice, so turning it on is recommended for development. + * + * @return whether the context will be run in Graphics Debug Mode or not + * @see #setGraphicsDebug(boolean) + */ + public boolean isGraphicsDebug() { + return getBoolean("GraphicsDebug"); + } + + /** + * Set whether the renderer will be run in Graphics Debug mode, which means every openGL Call is checked and + * if it returns an error code, throw a {@link com.jme3.renderer.RendererException}.
+ * Without this, many openGL calls might fail without notice, so turning it on is recommended for development. + * + * @param debug whether the context will be run in Graphics Debug Mode or not + * @see #isGraphicsDebug() + */ + public void setGraphicsDebug(boolean debug) { + putBoolean("GraphicsDebug", debug); + } }