@ -40,8 +40,11 @@ public class AndroidConfigChooser implements EGLConfigChooser {
* setEGLContextClientVersion ( 2 ) ; setEGLConfigChooser ( 5 , 6 , 5 , 0 , 16 ,
* setEGLContextClientVersion ( 2 ) ; setEGLConfigChooser ( 5 , 6 , 5 , 0 , 16 ,
* 0 ) ;
* 0 ) ;
* /
* /
LEGACY
LEGACY ,
}
/ * *
* RGB ? ? ? , 8 alpha , > = 16 depth , 0 stencil
* /
BEST_TRANSLUCENT , }
public AndroidConfigChooser ( ConfigType type ) {
public AndroidConfigChooser ( ConfigType type ) {
this . type = type ;
this . type = type ;
@ -65,27 +68,32 @@ public class AndroidConfigChooser implements EGLConfigChooser {
* @return true if successfull , false if no config was found
* @return true if successfull , false if no config was found
* /
* /
public boolean findConfig ( EGL10 egl , EGLDisplay display ) {
public boolean findConfig ( EGL10 egl , EGLDisplay display ) {
if ( type = = ConfigType . BEST ) {
ComponentSizeChooser compChooser = null ;
ComponentSizeChooser compChooser = new ComponentSizeChooser ( 8 , 8 , 8 , 8 , 32 , 0 ) ;
switch ( type ) {
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
case BEST :
if ( choosenConfig = = null ) {
compChooser = new ComponentSizeChooser ( 8 , 8 , 8 , 0 , 32 , 0 ) ;
compChooser = new ComponentSizeChooser ( 8 , 8 , 8 , 0 , 32 , 0 ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
if ( choosenConfig = = null ) {
compChooser = new ComponentSizeChooser ( 8 , 8 , 8 , 0 , 16 , 0 ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
}
logger . info ( "JME3 using best EGL configuration available here: " ) ;
break ;
case BEST_TRANSLUCENT :
compChooser = new ComponentSizeChooser ( 8 , 8 , 8 , 8 , 32 , 0 ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
if ( choosenConfig = = null ) {
if ( choosenConfig = = null ) {
compChooser = new ComponentSizeChooser ( 8 , 8 , 8 , 8 , 16 , 0 ) ;
compChooser = new ComponentSizeChooser ( 8 , 8 , 8 , 8 , 16 , 0 ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
if ( choosenConfig = = null ) {
compChooser = new ComponentSizeChooser ( 8 , 8 , 8 , 0 , 16 , 0 ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
}
}
}
}
logger . info ( "JME3 using best EGL configuration available here with translucent pixels: " ) ;
break ;
case FASTEST :
compChooser = new ComponentSizeChooser ( 5 , 6 , 5 , 0 , 16 , 0 ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
logger . info ( "JME3 using fastest EGL configuration available here: " ) ;
break ;
logger . info ( "JME3 using best EGL configuration available here: " ) ;
} else {
ComponentSizeChooser compChooser = new ComponentSizeChooser ( 5 , 6 , 5 , 0 , 16 , 0 ) ;
choosenConfig = compChooser . chooseConfig ( egl , display ) ;
logger . info ( "JME3 using fastest EGL configuration available here: " ) ;
}
}
if ( choosenConfig ! = null ) {
if ( choosenConfig ! = null ) {