Skip to content

Instantly share code, notes, and snippets.

@zzuegg
Created January 4, 2015 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zzuegg/41fc84e5a15119beba6d to your computer and use it in GitHub Desktop.
Save zzuegg/41fc84e5a15119beba6d to your computer and use it in GitHub Desktop.
package gg.zue.rse.modules.graphics.managers;
import com.jogamp.newt.MonitorDevice;
import com.jogamp.newt.NewtFactory;
import com.jogamp.newt.Screen;
import com.jogamp.newt.opengl.GLWindow;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
/**
* Created by michael on 04.01.15.
*/
public class RSDisplayManagerJogl {
public void getAvailableMonitorDevices() {
Screen screen = NewtFactory.createScreen(NewtFactory.createDisplay(null), 0);
screen.addReference();
MonitorDevice monitorDevice = screen.getMonitorDevices().get(0);
MonitorDevice monitorDevice2 = screen.getMonitorDevices().get(1);
GLWindow window = GLWindow.create(monitorDevice.getScreen(), new GLCapabilities(GLProfile.getDefault()));
GLWindow window2 = GLWindow.create(monitorDevice2.getScreen(), new GLCapabilities(GLProfile.getDefault()));
window.setVisible(true);
window2.setVisible(true);
}
public static void main(String[] args) {
new RSDisplayManagerJogl().getAvailableMonitorDevices();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment