From b635e6de0c36f0bc7a4ed4131b3c0b0a4aa762cf Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Mon, 3 Feb 2014 22:28:28 +0100 Subject: Adds some documentation into existing JOGL canvases and windows --- .../framework/jogl/JoglAwtInitializerRunnable.java | 41 ++++++++++++++++++++++ .../framework/jogl/JoglInitializerRunnable.java | 41 ---------------------- 2 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtInitializerRunnable.java delete mode 100644 ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglInitializerRunnable.java (limited to 'ardor3d-jogl/src/main') diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtInitializerRunnable.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtInitializerRunnable.java new file mode 100644 index 0000000..8e621f7 --- /dev/null +++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtInitializerRunnable.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2008-2010 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at . + */ + +package com.ardor3d.framework.jogl; + +import com.ardor3d.framework.DisplaySettings; + +public class JoglInitializerRunnable implements Runnable { + + private final JoglAwtCanvas _joglAwtCanvas; + + private final DisplaySettings _settings; + + public JoglInitializerRunnable(final JoglAwtCanvas joglAwtCanvas, final DisplaySettings settings) { + _joglAwtCanvas = joglAwtCanvas; + _settings = settings; + } + + @Override + public void run() { + // Make the window visible to realize the OpenGL surface. + _joglAwtCanvas.setVisible(true); + // Force the realization + _joglAwtCanvas.display(); + if (_joglAwtCanvas.getDelegatedDrawable().isRealized()) { + // Request the focus here as it cannot work when the window is not visible + _joglAwtCanvas.requestFocus(); + // The OpenGL context has been created after the realization of the surface + _joglAwtCanvas.getCanvasRenderer().setContext(_joglAwtCanvas.getContext()); + // As the canvas renderer knows the OpenGL context, it can be initialized + _joglAwtCanvas.getCanvasRenderer().init(_settings, true); + } + } +} \ No newline at end of file diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglInitializerRunnable.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglInitializerRunnable.java deleted file mode 100644 index 8e621f7..0000000 --- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglInitializerRunnable.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2008-2010 Ardor Labs, Inc. - * - * This file is part of Ardor3D. - * - * Ardor3D is free software: you can redistribute it and/or modify it - * under the terms of its license which may be found in the accompanying - * LICENSE file or at . - */ - -package com.ardor3d.framework.jogl; - -import com.ardor3d.framework.DisplaySettings; - -public class JoglInitializerRunnable implements Runnable { - - private final JoglAwtCanvas _joglAwtCanvas; - - private final DisplaySettings _settings; - - public JoglInitializerRunnable(final JoglAwtCanvas joglAwtCanvas, final DisplaySettings settings) { - _joglAwtCanvas = joglAwtCanvas; - _settings = settings; - } - - @Override - public void run() { - // Make the window visible to realize the OpenGL surface. - _joglAwtCanvas.setVisible(true); - // Force the realization - _joglAwtCanvas.display(); - if (_joglAwtCanvas.getDelegatedDrawable().isRealized()) { - // Request the focus here as it cannot work when the window is not visible - _joglAwtCanvas.requestFocus(); - // The OpenGL context has been created after the realization of the surface - _joglAwtCanvas.getCanvasRenderer().setContext(_joglAwtCanvas.getContext()); - // As the canvas renderer knows the OpenGL context, it can be initialized - _joglAwtCanvas.getCanvasRenderer().init(_settings, true); - } - } -} \ No newline at end of file -- cgit v1.2.3