@@ -129,6 +129,7 @@ public interface SelectionListener {
129129 private JComboBox <String > colorDepthCombo = null ;
130130 private JComboBox <String > displayFreqCombo = null ;
131131 private JComboBox <String > antialiasCombo = null ;
132+ private JComboBox <String > rendererCombo = null ;
132133 private JLabel icon = null ;
133134 private int selection = 0 ;
134135 private SelectionListener selectionListener = null ;
@@ -463,6 +464,8 @@ public void keyPressed(KeyEvent e) {
463464 displayFreqCombo .addKeyListener (aListener );
464465 antialiasCombo = new JComboBox <>();
465466 antialiasCombo .addKeyListener (aListener );
467+ rendererCombo = setUpRendererChooser ();
468+ rendererCombo .addKeyListener (aListener );
466469 fullscreenBox = new JCheckBox (resourceBundle .getString ("checkbox.fullscreen" ));
467470 fullscreenBox .setSelected (source .isFullscreen ());
468471 fullscreenBox .addActionListener (new ActionListener () {
@@ -549,6 +552,20 @@ public void actionPerformed(ActionEvent e) {
549552 gbc .anchor = GridBagConstraints .WEST ;
550553 mainPanel .add (antialiasCombo , gbc );
551554
555+ gbc = new GridBagConstraints ();
556+ gbc .insets = new Insets (4 , 4 , 4 , 4 );
557+ gbc .gridx = 0 ;
558+ gbc .gridy = 4 ;
559+ gbc .anchor = GridBagConstraints .EAST ;
560+ gbc .weightx = 0.5 ;
561+ mainPanel .add (new JLabel (resourceBundle .getString ("label.renderer" )), gbc );
562+ gbc = new GridBagConstraints ();
563+ gbc .gridx = 1 ;
564+ gbc .gridy = 4 ;
565+ gbc .gridwidth = 3 ;
566+ gbc .anchor = GridBagConstraints .WEST ;
567+ mainPanel .add (rendererCombo , gbc );
568+
552569 // Set the button action listeners. Cancel disposes without saving, OK
553570 // saves.
554571 ok .addActionListener (new ActionListener () {
@@ -583,14 +600,14 @@ public void actionPerformed(ActionEvent e) {
583600 gbc = new GridBagConstraints ();
584601 gbc .gridx = 0 ;
585602 gbc .gridwidth = 2 ;
586- gbc .gridy = 4 ;
603+ gbc .gridy = 5 ;
587604 gbc .anchor = GridBagConstraints .EAST ;
588605 mainPanel .add (ok , gbc );
589606 gbc = new GridBagConstraints ();
590607 gbc .insets = new Insets (4 , 16 , 4 , 4 );
591608 gbc .gridx = 2 ;
592609 gbc .gridwidth = 2 ;
593- gbc .gridy = 4 ;
610+ gbc .gridy = 5 ;
594611 gbc .anchor = GridBagConstraints .WEST ;
595612 mainPanel .add (cancel , gbc );
596613
@@ -662,6 +679,7 @@ private boolean verifyAndSaveCurrentSelection() {
662679 boolean fullscreen = fullscreenBox .isSelected ();
663680 boolean vsync = vsyncBox .isSelected ();
664681 boolean gamma = gammaBox .isSelected ();
682+ String renderer = (String ) rendererCombo .getSelectedItem ();
665683
666684 String [] parts = display .split (" x " );
667685 int width = Integer .parseInt (parts [0 ]);
@@ -721,7 +739,7 @@ private boolean verifyAndSaveCurrentSelection() {
721739 source .setFullscreen (fullscreen );
722740 source .setVSync (vsync );
723741 source .setGammaCorrection (gamma );
724- // source.setRenderer(renderer);
742+ source .setRenderer (renderer );
725743 source .setSamples (multisample );
726744
727745 String appTitle = source .getTitle ();
@@ -762,6 +780,30 @@ public void actionPerformed(ActionEvent e) {
762780 return resolutionBox ;
763781 }
764782
783+ private JComboBox <String > setUpRendererChooser () {
784+ JComboBox <String > rendererBox = new JComboBox <>();
785+ Set <String > renderers = new LinkedHashSet <>(Arrays .asList (
786+ AppSettings .ANGLE_GLES3 ,
787+ AppSettings .LWJGL_OPENGL32 ,
788+ AppSettings .LWJGL_OPENGL33 ,
789+ AppSettings .LWJGL_OPENGL40 ,
790+ AppSettings .LWJGL_OPENGL41 ,
791+ AppSettings .LWJGL_OPENGL42 ,
792+ AppSettings .LWJGL_OPENGL43 ,
793+ AppSettings .LWJGL_OPENGL44 ,
794+ AppSettings .LWJGL_OPENGL45
795+ ));
796+ String currentRenderer = source .getRenderer ();
797+ if (currentRenderer != null ) {
798+ renderers .add (currentRenderer );
799+ }
800+ for (String renderer : renderers ) {
801+ rendererBox .addItem (renderer );
802+ }
803+ rendererBox .setSelectedItem (currentRenderer );
804+ return rendererBox ;
805+ }
806+
765807 /**
766808 * <code>updateDisplayChoices</code> updates the available color depth and
767809 * display frequency options to match the currently selected resolution.
0 commit comments