diff options
author | Julien Gouesse <[email protected]> | 2013-03-22 00:00:14 +0100 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2013-03-22 00:00:14 +0100 |
commit | d664910383e7520e259ad13f0d204e1840e26a8e (patch) | |
tree | 27f55da682dff477a239af81e44054442ed72560 /ardor3d-jogl/src/main | |
parent | c8c544dbfea4e7047d5a91577c637bd757e6ac0b (diff) |
Adds OpenGL-ES 2.0 support, prepares the use of PMVMatrix (work in progress)
Diffstat (limited to 'ardor3d-jogl/src/main')
3 files changed, 38 insertions, 2 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 9c3b304..843970c 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 @@ -38,6 +38,7 @@ import com.ardor3d.renderer.ContextManager; import com.ardor3d.renderer.RenderContext; import com.ardor3d.renderer.Renderer; import com.ardor3d.renderer.jogl.JoglContextCapabilities; +import com.ardor3d.renderer.jogl.JoglRenderContext; import com.ardor3d.renderer.jogl.JoglRenderer; import com.ardor3d.util.Ardor3dException; @@ -143,7 +144,7 @@ public class JoglCanvasRenderer implements CanvasRenderer { } final ContextCapabilities caps = createContextCapabilities(); - _currentContext = new RenderContext(_context, caps, sharedContext); + _currentContext = new JoglRenderContext(_context, caps, sharedContext); ContextManager.addContext(_context, _currentContext); ContextManager.switchContext(_context); diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglPbufferTextureRenderer.java b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglPbufferTextureRenderer.java index a33664a..edfe5b5 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglPbufferTextureRenderer.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglPbufferTextureRenderer.java @@ -279,7 +279,7 @@ public class JoglPbufferTextureRenderer extends AbstractPbufferTextureRenderer { final JoglContextCapabilities contextCaps = new JoglContextCapabilities(_pbuffer.getGL()); ContextManager.addContext(_context, - new RenderContext(_context, contextCaps, ContextManager.getCurrentContext())); + new JoglRenderContext(_context, contextCaps, ContextManager.getCurrentContext())); } catch (final Exception e) { logger.logp(Level.SEVERE, this.getClass().toString(), "initPbuffer()", "Exception", e); diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderContext.java b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderContext.java new file mode 100644 index 0000000..6bf2aeb --- /dev/null +++ b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderContext.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2008-2010 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.renderer.jogl; + +import com.ardor3d.renderer.ContextCapabilities; +import com.ardor3d.renderer.RenderContext; +import com.ardor3d.renderer.state.record.RendererRecord; + +public class JoglRenderContext extends RenderContext { + + public JoglRenderContext(final Object key, final ContextCapabilities caps) { + this(key, caps, null); + } + + public JoglRenderContext(final Object key, final ContextCapabilities caps, final RenderContext shared) { + super(key, caps, shared); + } + + @Override + protected RendererRecord createRendererRecord() { + // TODO create a renderer record that performs glMatrixMode, glOrtho, glPushMatrix, glLoadMatrix, glPopMatrix, + // glMultMatrixf and glLoadMatrixf. Use PMVMatrix in a delegate + final RendererRecord rendererRecord = new RendererRecord(); + return rendererRecord; + } + +} |