|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lwjgl.opengles.PixelFormat
public final class PixelFormat
This class describes the configuration settings for an EGL surface. Instances of this class are used as arguments to Display.create(). The attributes specified in this class will be used to get EGLConfigs from an EGLDisplay. PixelFormat is not the best name for this class, but it matches the corresponding class in the official desktop LWJGL.
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.
Nested Class Summary | |
---|---|
static class |
PixelFormat.Attrib
|
Constructor Summary | |
---|---|
PixelFormat()
Creates a new PixelFormat with rgbSize = 8, alphaSize = 8 and depthSize = 16. |
|
PixelFormat(int alphaSize,
int depthSize,
int stencilSize)
Creates a new PixelFormat with rgbSize = 8 and the specified alphaSize, depthSize and stencilSize. |
|
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(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. |
Method Summary | |
---|---|
int |
getAttrib(PixelFormat.Attrib attrib)
Returns the value of the specified attribute. |
java.nio.IntBuffer |
getAttribBuffer(EGLDisplay display,
int surfaceType,
int[] lwjglAttribs)
Returns an IntBuffer that can be used to get/choose EGLConfigs. |
EGLConfig |
getBestMatch(EGLConfig[] configs)
Returns the EGL config from the specified array that best matches this PixelFormat. |
void |
setSurfaceAttribs(EGLSurface surface)
Applies this PixelFormat's surface attributes to the specified EGL surface. |
PixelFormat |
withAlphaSize(int alphaSize)
Returns a new PixelFormat with the specified EGL_ALPHA_SIZE. |
PixelFormat |
withCoverageSamplesNV(int samples)
Returns a new PixelFormat with the specified number of EGL_COVERAGE_SAMPLES_NV. |
PixelFormat |
withDepthEncodingNonlinearNV(int depthEncoding)
Returns a new PixelFormat with the specified EGL_DEPTH_ENCODING_NONLINEAR_NV. |
PixelFormat |
withDepthSize(int depthSize)
Returns a new PixelFormat with the specified EGL_DEPTH_SIZE. |
PixelFormat |
withLuminanceSize(int luminanceSize)
Returns a new PixelFormat with the specified EGL_LUMINANCE_SIZE. |
PixelFormat |
withMaxSwapInterval(int maxSwapInterval)
Returns a new PixelFormat with the specified EGL_MAX_SWAP_INTERVAL. |
PixelFormat |
withMinSwapInterval(int minSwapInterval)
Returns a new PixelFormat with the specified EGL_MIN_SWAP_INTERVAL. |
PixelFormat |
withMultisampleResolve(int multisampleResolve)
Returns a new PixelFormat with the specified EGL_MULTISAMPLE_RESOLVE value. |
PixelFormat |
withRGBSize(int rgb)
Returns a new PixelFormat with the specified RGB sizes. |
PixelFormat |
withRGBSize(int r,
int g,
int b)
Returns a new PixelFormat with the specified EGL_RED_SIZE, EGL_GREEN_SIZE and EGL_BLUE_SIZE. |
PixelFormat |
withSamples(int samples)
Returns a new PixelFormat with the specified number of EGL_SAMPLES. |
PixelFormat |
withStencilSize(int stencilSize)
Returns a new PixelFormat with the specified EGL_STENCIL_SIZE. |
PixelFormat |
withSwapBehavior(int swapBehavior)
Returns a new PixelFormat with the specified EGL_SWAP_BEHAVIOR value. |
PixelFormat |
withTransparentType(int transparentType,
int r,
int g,
int b)
Returns a new PixelFormat with the specified EGL_TRANSPARENT_TYPE and the specified transparent RGB values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PixelFormat()
PixelFormat(int, int, int, int, int, int)
public PixelFormat(int alphaSize, int depthSize, int stencilSize)
alphaSize
- the EGL_ALPHA_SIZE valuedepthSize
- the EGL_DEPTH_SIZE valuestencilSize
- the EGL_STENCIL_SIZE valuePixelFormat(int, int, int, int, int, int)
public PixelFormat(int alphaSize, int depthSize, int stencilSize, int samples)
alphaSize
- the EGL_ALPHA_SIZE valuedepthSize
- the EGL_DEPTH_SIZE valuestencilSize
- the EGL_STENCIL_SIZE valuesamples
- the EGL_SAMPLE_SIZE valuePixelFormat(int, int, int, int, int, int)
public PixelFormat(int rgbSize, int alphaSize, int luminanceSize, int depthSize, int stencilSize, int samples)
rgbSize
- the RGB sizesalphaSize
- the EGL_ALPHA_SIZE valueluminanceSize
- the EGL_LUMINANCE_SIZE valuedepthSize
- the EGL_DEPTH_SIZE valuestencilSize
- the EGL_STENCIL_SIZE valuesamples
- the EGL_SAMPLE_SIZE valueMethod Detail |
---|
public java.nio.IntBuffer getAttribBuffer(EGLDisplay display, int surfaceType, int[] lwjglAttribs)
display
- the EGL display from which the EGLConfig is going to be retrievedlwjglAttribs
- the LWJGL attributes
public EGLConfig getBestMatch(EGLConfig[] configs) throws LWJGLException
configs
- the EGL configs
LWJGLException
public void setSurfaceAttribs(EGLSurface surface) throws LWJGLException
surface
- the EGL surface
LWJGLException
public int getAttrib(PixelFormat.Attrib attrib)
attrib
- the attribute to retrieve
public PixelFormat withRGBSize(int rgb)
rgb
- the new EGL_RED_SIZE, EGL_GREEN_SIZE and EGL_BLUE_SIZE
withRGBSize(int, int, int)
public PixelFormat withRGBSize(int r, int g, int b)
r
- the new EGL_RED_SIZEg
- the new EGL_GREEN_SIZEb
- the new EGL_BLUE_SIZE
public PixelFormat withAlphaSize(int alphaSize)
alphaSize
- the new EGL_ALPHA_SIZE
public PixelFormat withLuminanceSize(int luminanceSize)
luminanceSize
- the new EGL_LUMINANCE_SIZE
public PixelFormat withDepthSize(int depthSize)
depthSize
- the new EGL_DEPTH_SIZE
public PixelFormat withStencilSize(int stencilSize)
stencilSize
- the new EGL_STENCIL_SIZE
public PixelFormat withMinSwapInterval(int minSwapInterval)
minSwapInterval
- the new EGL_MIN_SWAP_INTERVAL value
public PixelFormat withMaxSwapInterval(int maxSwapInterval)
maxSwapInterval
- the new EGL_MAX_SWAP_INTERVAL value
public PixelFormat withSamples(int samples)
samples
- the new EGL_SAMPLES value
public PixelFormat withTransparentType(int transparentType, int r, int g, int b)
transparentType
- the new EGL_TRANSPARENT_TYPE valuer
- the new EGL_TRANSPARENT_RED_VALUEg
- the new EGL_TRANSPARENT_GREEN_VALUEb
- the new EGL_TRANSPARENT_BLUE_VALUE
public PixelFormat withMultisampleResolve(int multisampleResolve)
multisampleResolve
- the new EGL_MULTISAMPLE_RESOLVE value
public PixelFormat withSwapBehavior(int swapBehavior)
swapBehavior
- the new EGL_SWAP_BEHAVIOR value
public PixelFormat withCoverageSamplesNV(int samples)
samples
- the new EGL_SAMPLES value
public PixelFormat withDepthEncodingNonlinearNV(int depthEncoding)
depthEncoding
- the new EGL_DEPTH_ENCODING_NONLINEAR_NV value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |