public static void main(String[] args) {
//false for webstart compatibility
GLProfile.initSingleton(false);
final RenderingConfig config = RenderingConfig.create()
.setWidth(640).setHeight(480)
.setEnableShadow(1)
.setSuperSamplingSize(2)
.setActvateFastRendering(1)
.setMaxIterations(9)
.setEpsilon(0.003f * 0.75f)
.setLight(new float[] {5, 10, 15})
.setMu(new float[] {-0.2f, 0.4f, -0.4f, -0.4f});
config.getCamera().getOrig() .setX(1).setY(2).setZ(8);
config.getCamera().getTarget().setX(0).setY(0).setZ(0);
final Julia3d julia3d = new Julia3d(config);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Renderer renderer = new Renderer(julia3d);
CLDevice device = julia3d.getDevice();
JFrame frame = new JFrame("Java OpenCL - Julia3D "+device.getType()+" "+device.getName());
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
julia3d.release();
System.exit(0);
}
});
Canvas canvas = renderer.getCanvas();
canvas.setPreferredSize(new Dimension(config.getWidth(), config.getHeight()));
frame.add(canvas);
frame.pack();
frame.setVisible(true);
}