|
@@ -438,6 +438,9 @@ public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContex
|
|
|
* This is called:
|
|
|
* 1) When the context thread starts
|
|
|
* 2) Any time the canvas becomes displayable again.
|
|
|
+ * In the first call of this method, OpenGL context is not ready yet. Therefore, OpenCL context cannot be created.
|
|
|
+ * The second call of this method is done after "simpleInitApp" is called. Therefore, OpenCL won't be available in "simpleInitApp" if Canvas/Swing is used.
|
|
|
+ * To use OpenCL with Canvas/Swing, you need to use OpenCL in the rendering loop "simpleUpdate" and check for "context.getOpenCLContext()!=null".
|
|
|
*/
|
|
|
@Override
|
|
|
protected void createContext(AppSettings settings) {
|
|
@@ -477,7 +480,10 @@ public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContex
|
|
|
}else{
|
|
|
Display.create(acquirePixelFormat(false));
|
|
|
}
|
|
|
-
|
|
|
+ if (settings.isOpenCLSupport()) {
|
|
|
+ initOpenCL();
|
|
|
+ }
|
|
|
+
|
|
|
renderer.invalidateState();
|
|
|
}else{
|
|
|
// First create the pbuffer, if it is needed.
|