Instances of this class are immutable. An example of the expected way to set
the PixelFormat property values is the following:
PixelFormat pf = new PixelFormat().withDepth(24).withSamples(4);
Attributes that correspond to EGL extensions will be silently ignored if those extensions are not supported by the EGLDisplay.
| Modifier and Type | Class and Description |
|---|---|
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PixelFormat(int
the EGL_ALPHA_SIZE value alphaSize, int the EGL_DEPTH_SIZE value depthSize, int the EGL_STENCIL_SIZE value stencilSize)Creates a new PixelFormat with rgbSize = 8 and the specified alphaSize, depthSize and stencilSize. |
| public | PixelFormat(int
the EGL_ALPHA_SIZE value alphaSize, int the EGL_DEPTH_SIZE value depthSize, int the EGL_STENCIL_SIZE value stencilSize, int the EGL_SAMPLE_SIZE value samples)Creates a new PixelFormat with rgbSize = 8 and the specified alphaSize, depthSize, stencilSize and samples. |
| public | PixelFormat(int
the RGB sizes rgbSize, int the EGL_ALPHA_SIZE value alphaSize, int the EGL_LUMINANCE_SIZE value luminanceSize, int the EGL_DEPTH_SIZE value depthSize, int the EGL_STENCIL_SIZE value stencilSize, int the EGL_SAMPLE_SIZE value samples)Creates a new PixelFormat with the specified RGB sizes, EGL_ALPHA_SIZE, EGL_LUMINANCE_SIZE, EGL_DEPTH_SIZE, EGL_STENCIL_SIZE, EGL_SAMPLES. |
| private | PixelFormat(final PixelFormat
the source PixelFormat pf)Creates a new PixelFormat that is a copy of the specified PixelFormat. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the attribute's valuethe attribute to retrieve attribReturns the value of the specified attribute. |
| public IntBuffer | Returns: the IntBufferthe EGL display from which the EGLConfig is going to be retrieved display, int surfaceType, final int[] the LWJGL attributes lwjglAttribs)Returns an IntBuffer that can be used to get/choose EGLConfigs. |
| public EGLConfig | Returns: the best matchthe EGL configs configs)Returns the EGL config from the specified array that best matches this PixelFormat. |
| private boolean | Returns: true if the two attributes matchthe requested attribute attrib,the EGL config config)Returns true if the requested attribute matches the attribute in the specified EGL config. |
| private boolean | Returns: true if the two attributes matchthe requested attribute attrib,the EGL config config)Returns true if the requested attribute matches the attribute in the specified EGL config. |
| private static int | |
| private void | setAttrib(final PixelFormat.
the attribute attrib,the new value value)Sets the value of an attribute to the current configuration. |
| private void | |
| public void | setSurfaceAttribs(final EGLSurface
the EGL surface surface)Applies this PixelFormat's surface attributes to the specified EGL surface. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_ALPHA_SIZE alphaSize)Returns a new PixelFormat with the specified EGL_ALPHA_SIZE. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_SAMPLES value samples)Returns a new PixelFormat with the specified number of EGL_COVERAGE_SAMPLES_NV. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_DEPTH_ENCODING_NONLINEAR_NV value depthEncoding)Returns a new PixelFormat with the specified EGL_DEPTH_ENCODING_NONLINEAR_NV. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_DEPTH_SIZE depthSize)Returns a new PixelFormat with the specified EGL_DEPTH_SIZE. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_LUMINANCE_SIZE luminanceSize)Returns a new PixelFormat with the specified EGL_LUMINANCE_SIZE. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_MAX_SWAP_INTERVAL value maxSwapInterval)Returns a new PixelFormat with the specified EGL_MAX_SWAP_INTERVAL. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_MIN_SWAP_INTERVAL value minSwapInterval)Returns a new PixelFormat with the specified EGL_MIN_SWAP_INTERVAL. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_MULTISAMPLE_RESOLVE value multisampleResolve)Returns a new PixelFormat with the specified EGL_MULTISAMPLE_RESOLVE value. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_RED_SIZE, EGL_GREEN_SIZE and EGL_BLUE_SIZE rgb)Returns a new PixelFormat with the specified RGB sizes. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_RED_SIZE r, final int the new EGL_GREEN_SIZE g, final int the new EGL_BLUE_SIZE b)Returns a new PixelFormat with the specified EGL_RED_SIZE, EGL_GREEN_SIZE and EGL_BLUE_SIZE. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_SAMPLES value samples)Returns a new PixelFormat with the specified number of EGL_SAMPLES. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_STENCIL_SIZE stencilSize)Returns a new PixelFormat with the specified EGL_STENCIL_SIZE. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_SWAP_BEHAVIOR value swapBehavior)Returns a new PixelFormat with the specified EGL_SWAP_BEHAVIOR value. |
| public PixelFormat | Returns: the new PixelFormatthe new EGL_TRANSPARENT_TYPE value transparentType, int the new EGL_TRANSPARENT_RED_VALUE r, int the new EGL_TRANSPARENT_GREEN_VALUE g, int the new EGL_TRANSPARENT_BLUE_VALUE b)Returns a new PixelFormat with the specified EGL_TRANSPARENT_TYPE and the specified transparent RGB values. |
| config | back to summary |
|---|---|
| private final Map<PixelFormat. | |
| PixelFormat | back to summary |
|---|---|
| public PixelFormat() Creates a new PixelFormat with rgbSize = 8, alphaSize = 8 and depthSize = 16. | |
| PixelFormat | back to summary |
|---|---|
| public PixelFormat(int alphaSize, int depthSize, int stencilSize) Creates a new PixelFormat with rgbSize = 8 and the specified alphaSize, depthSize and stencilSize.
| |
| PixelFormat | back to summary |
|---|---|
| public PixelFormat(int alphaSize, int depthSize, int stencilSize, int samples) Creates a new PixelFormat with rgbSize = 8 and the specified alphaSize, depthSize, stencilSize and samples.
| |
| PixelFormat | back to summary |
|---|---|
| public PixelFormat(int rgbSize, int alphaSize, int luminanceSize, int depthSize, int stencilSize, int samples) Creates a new PixelFormat with the specified RGB sizes, EGL_ALPHA_SIZE, EGL_LUMINANCE_SIZE, EGL_DEPTH_SIZE, EGL_STENCIL_SIZE, EGL_SAMPLES. All values must be greater than or equal to 0. rgbSize and luminanceSize cannot both be greater than 0. depthSize greater than 24 and stencilSize greater than 8 are not recommended. The corresponding EGL_SAMPLE_BUFFERS value will become 0 if samples is 0, or 1 if samples is greater than 0.
| |
| PixelFormat | back to summary |
|---|---|
| private PixelFormat(final PixelFormat pf) Creates a new PixelFormat that is a copy of the specified PixelFormat.
| |
| getAttrib | back to summary |
|---|---|
| public int getAttrib(final PixelFormat. Returns the value of the specified attribute.
| |
| getAttribBuffer | back to summary |
|---|---|
| public IntBuffer getAttribBuffer(final EGLDisplay display, int surfaceType, final int[] lwjglAttribs) Returns an IntBuffer that can be used to get/choose EGLConfigs. The contents of the IntBuffer will be the sum of the source LWJGL attributes and the user-defined attributes from this PixelFormat's configuration. The source LWJGL attributes should not contain the EGL_SURFACE_TYPE attirube, or any attributes that are handled by PixelFormat. Attributes that correspond to EGL extensions will be checked against the extensions supported in the specified EGLDisplay. Attributes that correspond to unsupported extensions will not be included in the final EGLConfig query.
| |
| getBestMatch | back to summary |
|---|---|
| public EGLConfig getBestMatch(final EGLConfig[] configs) throws LWJGLException Returns the EGL config from the specified array that best matches this PixelFormat. | |
| matches | back to summary |
|---|---|
| private boolean matches(final PixelFormat. Returns true if the requested attribute matches the attribute in the specified EGL config.
| |
| matchesNonZero | back to summary |
|---|---|
| private boolean matchesNonZero(final PixelFormat. Returns true if the requested attribute matches the attribute in the specified EGL config. If the requested attribute is equal to 1, then it will match with any EGL config attribute that is greater than 0.
| |
| maxValue | back to summary |
|---|---|
| private static int maxValue(final int bits) | |
| setAttrib | back to summary |
|---|---|
| private void setAttrib(final PixelFormat. Sets the value of an attribute to the current configuration. If the value matches the default attribute value, the attribute will be removed from the configuration.
| |
| setSurfaceAttrib | back to summary |
|---|---|
| private void setSurfaceAttrib(final EGLSurface surface, final PixelFormat. | |
| setSurfaceAttribs | back to summary |
|---|---|
| public void setSurfaceAttribs(final EGLSurface surface) throws LWJGLException Applies this PixelFormat's surface attributes to the specified EGL surface.
| |
| withAlphaSize | back to summary |
|---|---|
| public PixelFormat withAlphaSize(final int alphaSize) Returns a new PixelFormat with the specified EGL_ALPHA_SIZE. The alphaSize value must be greater than or equal to 0.
| |
| withCoverageSamplesNV | back to summary |
|---|---|
| public PixelFormat withCoverageSamplesNV(final int samples) Returns a new PixelFormat with the specified number of EGL_COVERAGE_SAMPLES_NV. The samples value must be greater than or equal to 0. The related EGL_COVERAGE_BUFFERS_NV value will become 0 if samples is 0, or 1 if samples is greater than 0.
| |
| withDepthEncodingNonlinearNV | back to summary |
|---|---|
| public PixelFormat withDepthEncodingNonlinearNV(final int depthEncoding) Returns a new PixelFormat with the specified EGL_DEPTH_ENCODING_NONLINEAR_NV. Valid values for depthEncoding are EGL_DONT_CARE, EGL_DEPTH_ENCODING_NONE_NV and EGL_DEPTH_ENCODING_NONLINEAR_NV.
| |
| withDepthSize | back to summary |
|---|---|
| public PixelFormat withDepthSize(final int depthSize) Returns a new PixelFormat with the specified EGL_DEPTH_SIZE. The depthSize value must be greater than or equal to 0. Values greater than 24 are not recommended.
| |
| withLuminanceSize | back to summary |
|---|---|
| public PixelFormat withLuminanceSize(final int luminanceSize) Returns a new PixelFormat with the specified EGL_LUMINANCE_SIZE. The luminanceSize value must be greater than or equal to 0. If luminanceSize is greater than 0, the RGB sizes will be set to 0.
| |
| withMaxSwapInterval | back to summary |
|---|---|
| public PixelFormat withMaxSwapInterval(final int maxSwapInterval) Returns a new PixelFormat with the specified EGL_MAX_SWAP_INTERVAL. The maxSwapInterval value must be greater than or equal to this PixelFormat's EGL_MIN_SWAP_INTERVAL.
| |
| withMinSwapInterval | back to summary |
|---|---|
| public PixelFormat withMinSwapInterval(final int minSwapInterval) Returns a new PixelFormat with the specified EGL_MIN_SWAP_INTERVAL. The minSwapInterval value must be between 0 and this PixelFormat's EGL_MAX_SWAP_INTERVAL.
| |
| withMultisampleResolve | back to summary |
|---|---|
| public PixelFormat withMultisampleResolve(final int multisampleResolve) Returns a new PixelFormat with the specified EGL_MULTISAMPLE_RESOLVE value. Valid values for multisampleResolve are EGL_MULTISAMPLE_RESOLVE_DEFAULT and EGL_MULTISAMPLE_RESOLVE_BOX. An IllegalStateException will be thrown if EGL_SAMPLES has not been previously defined to be greater than or equal to 2.
| |
| withRGBSize | back to summary |
|---|---|
| public PixelFormat withRGBSize(final int rgb) Returns a new PixelFormat with the specified RGB sizes.
| |
| withRGBSize | back to summary |
|---|---|
| public PixelFormat withRGBSize(final int r, final int g, final int b) Returns a new PixelFormat with the specified EGL_RED_SIZE, EGL_GREEN_SIZE and EGL_BLUE_SIZE. All 3 values must be greater than or equal to 0. If any of the 3 values is greater than 0, the luminanceSize will be set to 0.
| |
| withSamples | back to summary |
|---|---|
| public PixelFormat withSamples(final int samples) Returns a new PixelFormat with the specified number of EGL_SAMPLES. The samples value must be either 0 or greater than or equal to 2. The related EGL_SAMPLE_BUFFERS value will become 0 if samples is 0, or 1 if samples is greater than or equal to 2.
| |
| withStencilSize | back to summary |
|---|---|
| public PixelFormat withStencilSize(final int stencilSize) Returns a new PixelFormat with the specified EGL_STENCIL_SIZE. The stencilSize value must be greater than or equal to 0. Values greater than 8 are not recommended.
| |
| withSwapBehavior | back to summary |
|---|---|
| public PixelFormat withSwapBehavior(final int swapBehavior) Returns a new PixelFormat with the specified EGL_SWAP_BEHAVIOR value. Valid values for swapBehavior are EGL_DONT_CARE, EGL_BUFFER_PRESERVED and EGL_BUFFER_DESTROYED.
| |
| withTransparentType | back to summary |
|---|---|
| public PixelFormat withTransparentType(final int transparentType, int r, int g, int b) Returns a new PixelFormat with the specified EGL_TRANSPARENT_TYPE and the specified transparent RGB values. The transparentType must be either EGL_NONE or EGL_TRANSPARENT_RGB. When it is EGL_NONE, the RGB values are set to zero and ignored. When it is EGL_TRANSPARENT_RGB, the RGB values must be between 0 and 2^rgbSize - 1.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| private final int | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| private final int | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| private final boolean | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. | |
| public static final PixelFormat. |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | Returns: the EGL attribute tokenReturns the EGL token that corresponds to this attribute. |
| public boolean | |
| public static PixelFormat. | |
| public static PixelFormat. |
| ALPHA_SIZE | back to summary |
|---|---|
| public static final PixelFormat. | |
| BLUE_SIZE | back to summary |
|---|---|
| public static final PixelFormat. | |
| COVERAGE_BUFFERS_NV | back to summary |
|---|---|
| public static final PixelFormat. | |
| COVERAGE_SAMPLES_NV | back to summary |
|---|---|
| public static final PixelFormat. | |
| defaultValue | back to summary |
|---|---|
| private final int defaultValue | |
| DEPTH_ENCODING_NONLINEAR_NV | back to summary |
|---|---|
| public static final PixelFormat. | |
| DEPTH_SIZE | back to summary |
|---|---|
| public static final PixelFormat. | |
| eglAttrib | back to summary |
|---|---|
| private final int eglAttrib | |
| GREEN_SIZE | back to summary |
|---|---|
| public static final PixelFormat. | |
| LUMINANCE_SIZE | back to summary |
|---|---|
| public static final PixelFormat. | |
| MAX_SWAP_INTERVAL | back to summary |
|---|---|
| public static final PixelFormat. | |
| MIN_SWAP_INTERVAL | back to summary |
|---|---|
| public static final PixelFormat. | |
| MULTISAMPLE_RESOLVE | back to summary |
|---|---|
| public static final PixelFormat. | |
| RED_SIZE | back to summary |
|---|---|
| public static final PixelFormat. | |
| SAMPLE_BUFFERS | back to summary |
|---|---|
| public static final PixelFormat. | |
| SAMPLES | back to summary |
|---|---|
| public static final PixelFormat. | |
| STENCIL_SIZE | back to summary |
|---|---|
| public static final PixelFormat. | |
| surfaceAttrib | back to summary |
|---|---|
| private final boolean surfaceAttrib | |
| SWAP_BEHAVIOR | back to summary |
|---|---|
| public static final PixelFormat. | |
| TRANSPARENT_BLUE_VALUE | back to summary |
|---|---|
| public static final PixelFormat. | |
| TRANSPARENT_GREEN_VALUE | back to summary |
|---|---|
| public static final PixelFormat. | |
| TRANSPARENT_RED_VALUE | back to summary |
|---|---|
| public static final PixelFormat. | |
| TRANSPARENT_TYPE | back to summary |
|---|---|
| public static final PixelFormat. | |
| Attrib | back to summary |
|---|---|
| private Attrib(final int eglAttrib, final int defaultValue) | |
| Attrib | back to summary |
|---|---|
| private Attrib(final int eglAttrib, final int defaultValue, final boolean surfaceAttrib) | |
| getDefaultValue | back to summary |
|---|---|
| public int getDefaultValue() Returns the default value of this attribute. Attributes with default values will be ignored when choosing the EGLConfig.
| |
| getEGLAttrib | back to summary |
|---|---|
| public int getEGLAttrib() Returns the EGL token that corresponds to this attribute.
| |
| isSurfaceAttrib | back to summary |
|---|---|
| public boolean isSurfaceAttrib() | |
| valueOf | back to summary |
|---|---|
| public static PixelFormat. | |
| values | back to summary |
|---|---|
| public static PixelFormat. | |