aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-core
diff options
context:
space:
mode:
authorJoshua Slack <[email protected]>2017-10-16 10:48:44 -0500
committerJoshua Slack <[email protected]>2017-10-16 12:21:24 -0500
commitca262978b95add2dae3434c5760ba6f2f1039325 (patch)
tree3fd2df0fc47d2201d8b1d675e0c0ed80e573a9cc /ardor3d-core
parent3b324b3c4dde3f18c255c59817f14f12f6467dc7 (diff)
Added some additional caps detection + divorced UIContainer standin texture size from camera. This should help in serveral situations such as window size being tiny during init, or different contexts having different window sizes.
Diffstat (limited to 'ardor3d-core')
-rw-r--r--ardor3d-core/src/main/java/com/ardor3d/renderer/ContextCapabilities.java73
1 files changed, 53 insertions, 20 deletions
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 9599e0e..dd28ee6 100644
--- a/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextCapabilities.java
+++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextCapabilities.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>.
*/
@@ -76,6 +76,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. */
@@ -159,6 +168,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;
@@ -391,7 +403,7 @@ public class ContextCapabilities {
/**
* <code>getNumberOfAuxiliaryDrawBuffers</code> returns the total number of available auxiliary draw buffers this
* context supports.
- *
+ *
* @return the number of available auxiliary draw buffers supported by the context.
*/
public int getNumberOfAuxiliaryDrawBuffers() {
@@ -400,7 +412,7 @@ public class ContextCapabilities {
/**
* <code>getTotalNumberOfUnits</code> returns the total number of texture units this context supports.
- *
+ *
* @return the total number of texture units supported by the context.
*/
public int getTotalNumberOfUnits() {
@@ -410,7 +422,7 @@ public class ContextCapabilities {
/**
* <code>getNumberOfFixedUnits</code> returns the number of texture units this context supports, for use in the
* fixed pipeline.
- *
+ *
* @return the number units.
*/
public int getNumberOfFixedTextureUnits() {
@@ -420,7 +432,7 @@ public class ContextCapabilities {
/**
* <code>getNumberOfVertexUnits</code> returns the number of texture units available to a vertex shader that this
* context supports.
- *
+ *
* @return the number of units.
*/
public int getNumberOfVertexUnits() {
@@ -430,7 +442,7 @@ public class ContextCapabilities {
/**
* <code>getNumberOfFragmentUnits</code> returns the number of texture units available to a fragment shader that
* this context supports.
- *
+ *
* @return the number of units.
*/
public int getNumberOfFragmentTextureUnits() {
@@ -440,7 +452,7 @@ public class ContextCapabilities {
/**
* <code>getNumberOfFragmentTexCoordUnits</code> returns the number of texture coordinate sets available that this
* context supports.
- *
+ *
* @return the number of units.
*/
public int getNumberOfFragmentTexCoordUnits() {
@@ -455,8 +467,29 @@ 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.
*/
public int getNumberOfTotalTextureUnits() {
@@ -465,7 +498,7 @@ public class ContextCapabilities {
/**
* <code>getMaxFBOColorAttachments</code> returns the MAX_COLOR_ATTACHMENTS for FBOs that this context supports.
- *
+ *
* @return the number of buffers.
*/
public int getMaxFBOColorAttachments() {
@@ -474,7 +507,7 @@ public class ContextCapabilities {
/**
* Returns the maximum anisotropic filter.
- *
+ *
* @return The maximum anisotropic filter.
*/
public float getMaxAnisotropic() {
@@ -525,7 +558,7 @@ public class ContextCapabilities {
/**
* Returns if S3TC compression is available for textures.
- *
+ *
* @return true if S3TC is available.
*/
public boolean isS3TCSupported() {
@@ -534,7 +567,7 @@ public class ContextCapabilities {
/**
* Returns if LATC compression is available for textures.
- *
+ *
* @return true if LATC is available.
*/
public boolean isLATCSupported() {
@@ -543,7 +576,7 @@ public class ContextCapabilities {
/**
* Returns if generic (non-specific) compression is available for textures.
- *
+ *
* @return true if available.
*/
public boolean isGenericTCSupported() {
@@ -552,7 +585,7 @@ public class ContextCapabilities {
/**
* Returns if Texture3D is available for textures.
- *
+ *
* @return true if Texture3D is available.
*/
public boolean isTexture3DSupported() {
@@ -561,7 +594,7 @@ public class ContextCapabilities {
/**
* Returns if TextureCubeMap is available for textures.
- *
+ *
* @return true if TextureCubeMap is available.
*/
public boolean isTextureCubeMapSupported() {
@@ -570,7 +603,7 @@ public class ContextCapabilities {
/**
* Returns if AutomaticMipmap generation is available for textures.
- *
+ *
* @return true if AutomaticMipmap generation is available.
*/
public boolean isAutomaticMipmapsSupported() {
@@ -652,7 +685,7 @@ public class ContextCapabilities {
/**
* Returns the vendor of the graphics adapter
- *
+ *
* @return The vendor of the graphics adapter
*/
public String getDisplayVendor() {
@@ -661,7 +694,7 @@ public class ContextCapabilities {
/**
* Returns renderer details of the adapter
- *
+ *
* @return The adapter details
*/
public String getDisplayRenderer() {
@@ -670,7 +703,7 @@ public class ContextCapabilities {
/**
* Returns the version supported
- *
+ *
* @return The version supported
*/
public String getDisplayVersion() {
@@ -679,7 +712,7 @@ public class ContextCapabilities {
/**
* Returns the supported shading language version. Needs OpenGL 2.0 support to query.
- *
+ *
* @return The shading language version supported
*/
public String getShadingLanguageVersion() {