From a8ccbdf228727d8eef7e6684b738a118610b5744 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 31 Jul 2014 00:48:40 +0200 Subject: GLDrawable: Expose getRequestedGLCapabilities() (Include to public API) In certain cases, it is required to read the user requested capabilities from places other than the user code. Hence adding public method to GLDrawable interface. This removes the need to cast to private GLDrawableImpl, which included such method. --- .../classes/javax/media/opengl/GLDrawable.java | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl/GLDrawable.java') diff --git a/src/jogl/classes/javax/media/opengl/GLDrawable.java b/src/jogl/classes/javax/media/opengl/GLDrawable.java index 57883c8ac..ac8644640 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawable.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawable.java @@ -174,17 +174,36 @@ public interface GLDrawable extends NativeSurfaceHolder { public void swapBuffers() throws GLException; /** Fetches the {@link GLCapabilitiesImmutable} corresponding to the chosen - OpenGL capabilities (pixel format / visual / GLProfile) for this drawable.
+ OpenGL capabilities (pixel format / visual / GLProfile) for this drawable. +

+ This query only returns the chosen capabilities if {@link #isRealized()}. +

+

On some platforms, the pixel format is not directly associated with the drawable; a best attempt is made to return a reasonable - value in this case.
+ value in this case. +

+

This object shall be directly associated to the attached {@link NativeSurface}'s {@link AbstractGraphicsConfiguration}, and if changes are necessary, they should reflect those as well. +

@return The immutable queried instance. + @see #getRequestedGLCapabilities() */ public GLCapabilitiesImmutable getChosenGLCapabilities(); + /** Fetches the {@link GLCapabilitiesImmutable} corresponding to the user requested + OpenGL capabilities (pixel format / visual / GLProfile) for this drawable. +

+ If {@link #isRealized() realized}, {@link #getChosenGLCapabilities() the chosen capabilities} + reflect the actual selected OpenGL capabilities. +

+ @return The immutable queried instance. + @see #getChosenGLCapabilities() + */ + public GLCapabilitiesImmutable getRequestedGLCapabilities(); + /** Fetches the {@link GLProfile} for this drawable. Returns the GLProfile object, no copy. */ -- cgit v1.2.3