aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-jogl/src/main/java
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2013-02-28 23:34:14 +0100
committerJulien Gouesse <[email protected]>2013-02-28 23:34:14 +0100
commit7d3eee4b0bfc75b366a024a93e5bda7f07640544 (patch)
tree604fdd66c70ee0279db00294a6366610814333f2 /ardor3d-jogl/src/main/java
parent790fd229cc0e42fe1f1a36d587ca71a8610c205e (diff)
Improves the debug pipeline
Diffstat (limited to 'ardor3d-jogl/src/main/java')
-rw-r--r--ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvasRenderer.java38
1 files changed, 37 insertions, 1 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvasRenderer.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvasRenderer.java
index d77edb0..9c3b304 100644
--- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvasRenderer.java
+++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvasRenderer.java
@@ -13,6 +13,12 @@ package com.ardor3d.framework.jogl;
import java.util.logging.Logger;
import javax.media.opengl.DebugGL2;
+import javax.media.opengl.DebugGL3;
+import javax.media.opengl.DebugGL3bc;
+import javax.media.opengl.DebugGL4;
+import javax.media.opengl.DebugGL4bc;
+import javax.media.opengl.DebugGLES1;
+import javax.media.opengl.DebugGLES2;
import javax.media.opengl.GL;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawableFactory;
@@ -193,7 +199,37 @@ public class JoglCanvasRenderer implements CanvasRenderer {
// Enable Debugging if requested.
if (_useDebug != _debugEnabled) {
- _context.setGL(new DebugGL2(_context.getGL().getGL2()));
+ if (_context.getGL().isGLES()) {
+ if (_context.getGL().isGLES1()) {
+ _context.setGL(new DebugGLES1(_context.getGL().getGLES1()));
+ } else {
+ if (_context.getGL().isGLES2()) {
+ _context.setGL(new DebugGLES2(_context.getGL().getGLES2()));
+ } else {
+ // TODO ES3
+ }
+ }
+ } else {
+ if (_context.getGL().isGL4bc()) {
+ _context.setGL(new DebugGL4bc(_context.getGL().getGL4bc()));
+ } else {
+ if (_context.getGL().isGL4()) {
+ _context.setGL(new DebugGL4(_context.getGL().getGL4()));
+ } else {
+ if (_context.getGL().isGL3bc()) {
+ _context.setGL(new DebugGL3bc(_context.getGL().getGL3bc()));
+ } else {
+ if (_context.getGL().isGL3()) {
+ _context.setGL(new DebugGL3(_context.getGL().getGL3()));
+ } else {
+ if (_context.getGL().isGL2()) {
+ _context.setGL(new DebugGL2(_context.getGL().getGL2()));
+ }
+ }
+ }
+ }
+ }
+ }
_debugEnabled = true;
LOGGER.info("DebugGL Enabled");