diff options
author | Julien Gouesse <[email protected]> | 2018-01-27 16:40:51 +0100 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2018-01-27 16:40:51 +0100 |
commit | 484a7bc1b7354f80027e45d0fd0d97473cc454dd (patch) | |
tree | 8522c4fa7d8759c0b89d6bdf478a57469edb9642 /ardor3d-core | |
parent | b476eeed7ebee18a310ba02b3a740fe34b87cec2 (diff) | |
parent | 3725d8321774e80b84f302eb16089dde387822e1 (diff) |
Merges several Renanse's commits
Diffstat (limited to 'ardor3d-core')
4 files changed, 72 insertions, 13 deletions
diff --git a/ardor3d-core/src/main/java/com/ardor3d/framework/Canvas.java b/ardor3d-core/src/main/java/com/ardor3d/framework/Canvas.java index 2c1cc3a..ba739d9 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/framework/Canvas.java +++ b/ardor3d-core/src/main/java/com/ardor3d/framework/Canvas.java @@ -13,6 +13,7 @@ package com.ardor3d.framework; import java.util.concurrent.CountDownLatch; import com.ardor3d.annotation.MainThread; +import com.ardor3d.input.MouseManager; /** * This interface defines the View, and should maybe be called the ViewUpdater. It owns the rendering phase, and @@ -29,7 +30,7 @@ public interface Canvas { /** * Ask the canvas to render itself. Note that this may occur in another thread and therefore a latch is given so the * caller may know when the draw has completed. - * + * * @param latch * a counter that should be decremented once drawing has completed. */ @@ -40,4 +41,17 @@ public interface Canvas { * @return the CanvasRenderer associated with this Canvas. */ CanvasRenderer getCanvasRenderer(); + + /** + * @return the MouseManager associated with this Canvas, if any + */ + MouseManager getMouseManager(); + + /** + * Sets a MouseManager to be associated with this Canvas. + * + * @param manager + * the manager to associate + */ + void setMouseManager(MouseManager manager); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java b/ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java index 14a0047..181f48d 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java +++ b/ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * 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>. */ @@ -32,13 +32,13 @@ public class Texture1D extends Texture { /** * <code>setWrap</code> sets the wrap mode of this texture for a particular axis. - * + * * @param axis * the texture axis to define a wrapmode on. * @param mode * the wrap mode for the given axis of the texture. * @throws IllegalArgumentException - * if axis or mode are null + * if axis or mode are null or invalid */ @Override public void setWrap(final WrapAxis axis, final WrapMode mode) { @@ -51,12 +51,16 @@ public class Texture1D extends Texture { case S: _wrapS = mode; break; + case R: + case T: + default: + throw new IllegalArgumentException("invalid WrapAxis: " + axis); } } /** * <code>setWrap</code> sets the wrap mode of this texture for all axis. - * + * * @param mode * the wrap mode for the given axis of the texture. * @throws IllegalArgumentException @@ -72,7 +76,7 @@ public class Texture1D extends Texture { /** * <code>getWrap</code> returns the wrap mode for a given coordinate axis on this texture. - * + * * @param axis * the axis to return for * @return the wrap mode of the texture. @@ -84,8 +88,11 @@ public class Texture1D extends Texture { switch (axis) { case S: return _wrapS; + case R: + case T: + default: + throw new IllegalArgumentException("invalid WrapAxis: " + axis); } - throw new IllegalArgumentException("invalid WrapAxis: " + axis); } @Override diff --git a/ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java b/ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java index ddd01ba..3144478 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java +++ b/ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * 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>. */ @@ -34,13 +34,13 @@ public class Texture2D extends Texture { /** * <code>setWrap</code> sets the wrap mode of this texture for a particular axis. - * + * * @param axis * the texture axis to define a wrapmode on. * @param mode * the wrap mode for the given axis of the texture. * @throws IllegalArgumentException - * if axis or mode are null + * if axis or mode are null or invalid */ @Override public void setWrap(final WrapAxis axis, final WrapMode mode) { @@ -56,12 +56,15 @@ public class Texture2D extends Texture { case T: _wrapT = mode; break; + case R: + default: + throw new IllegalArgumentException("invalid WrapAxis: " + axis); } } /** * <code>setWrap</code> sets the wrap mode of this texture for all axis. - * + * * @param mode * the wrap mode for the given axis of the texture. * @throws IllegalArgumentException @@ -78,7 +81,7 @@ public class Texture2D extends Texture { /** * <code>getWrap</code> returns the wrap mode for a given coordinate axis on this texture. - * + * * @param axis * the axis to return for * @return the wrap mode of the texture. @@ -92,8 +95,10 @@ public class Texture2D extends Texture { return _wrapS; case T: return _wrapT; + case R: + default: + throw new IllegalArgumentException("invalid WrapAxis: " + axis); } - throw new IllegalArgumentException("invalid WrapAxis: " + axis); } @Override diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextCapabilities.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextCapabilities.java index 3d65cda..ac99dab 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextCapabilities.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextCapabilities.java @@ -77,6 +77,15 @@ public class ContextCapabilities { /** The max side of a texture supported. */ protected int _maxTextureSize = -1; + /** The max width of a viewport supported. */ + protected int _maxViewportWidth = -1; + + /** The max height of a viewport supported. */ + protected int _maxViewportHeight = -1; + + /** The max height of a viewport supported. */ + protected int _maxRenderBufferSize = -1; + protected float _maxAnisotropic = -1.0f; /** True if multitexturing is supported. */ @@ -161,6 +170,9 @@ public class ContextCapabilities { _maxGLSLVertexAttribs = source._maxGLSLVertexAttribs; _maxTextureLodBias = source._maxTextureLodBias; _maxTextureSize = source._maxTextureSize; + _maxViewportWidth = source._maxViewportWidth; + _maxViewportHeight = source._maxViewportHeight; + _maxRenderBufferSize = source._maxRenderBufferSize; _maxUserClipPlanes = source._maxUserClipPlanes; _numAuxDrawBuffers = source._numAuxDrawBuffers; _numFixedTexUnits = source._numFixedTexUnits; @@ -465,6 +477,27 @@ public class ContextCapabilities { } /** + * @return the max width of viewport that this context supports. + */ + public int getMaxViewportWidth() { + return _maxViewportWidth; + } + + /** + * @return the max height of viewport that this context supports. + */ + public int getMaxViewportHeight() { + return _maxViewportHeight; + } + + /** + * @return the max size (in terms of # pixels) of renderbuffer that this context supports. + */ + public int getMaxRenderBufferSize() { + return _maxRenderBufferSize; + } + + /** * <code>getNumberOfTotalUnits</code> returns the number of texture units this context supports. * * @return the number of units. |