From owner-freebsd-java@freebsd.org Mon May 16 13:19:27 2016 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AAEFB3D325 for ; Mon, 16 May 2016 13:19:27 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4FC919F7 for ; Mon, 16 May 2016 13:19:26 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: by mail-wm0-x230.google.com with SMTP id e201so100666291wme.0 for ; Mon, 16 May 2016 06:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bris-ac-uk.20150623.gappssmtp.com; s=20150623; h=date:from:message-id:to:subject:reply-to; bh=xrb3NTRt4ngKu00eC9Zola7xYAaGRxvqq3eB2ErfZfU=; b=ooBvbQAlTr2UBgsTvu15CKutuFR5KmRP1CiwumQJI66ArIdBotSsc+ivtA9clR6mHO /sfKx7/8YvuZ0hWKp2JdH7jzveLcDkrOsE8JspH44/crZbj3G/L4FzNu6TBoYX8cLuEC 97H7bIZ90tvqD50uh/u8oh9R7GpGdvYO1e0rDrAuvdFybK3aZxlC7Zra6/RX/bB1vrq4 A1Jr+oTz2BteSWxahbdqUv2EYyJFmAQsQWGgwoIZN4FJxpuCKLVewZLtxmilq0Lkcvnk S1pGc/tA81fR4CYHlDsPgXE2lHkn0eBV24hYrfLwxfCqk4gyecORNoROeJpVET6xd+Ld P5VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:message-id:to:subject:reply-to; bh=xrb3NTRt4ngKu00eC9Zola7xYAaGRxvqq3eB2ErfZfU=; b=PYH26RvUgzQ9sEUO0ndcd807cXUJ8xgZvbo06Gi+lYZTA704ZxyGnafRQtgAe0l0wa sRCJcN/UYbQm/psYdtj4v546uiYqMTp+3j/f/1CK1IJc/OXZOJkbQwjJ90SFHt3wrtty jBV7H31Xg1WsDBvpXrCfPTeSZi5MToyD0nlPiTsfvlZzoBqCs95ZHl96CrArPJR9FUei 2wLzcGqo59XCWQnti7BS/0m0+yUV4ZFLY0b5Y2McoL0bZWVjmtDCGlFfMPAs6yCUdrjv weWjYbFSOeD7kuZjIFwChoITBdgRSNv4sW4TUX5aywJ15mza9fuNCitdDc53hw+L95C2 LImA== X-Gm-Message-State: AOPr4FVlR8fWAt3iofUOt2+UbQ3YEBUkfgxpCCTG0GITxNigXzj6gt0H4eMJoIs90FMtGcbL X-Received: by 10.28.29.147 with SMTP id d141mr18062209wmd.91.1463404765322; Mon, 16 May 2016 06:19:25 -0700 (PDT) Received: from mech-as222.men.bris.ac.uk (mech-as222.men.bris.ac.uk. [137.222.170.4]) by smtp.gmail.com with ESMTPSA id p129sm18286782wmd.13.2016.05.16.06.19.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 May 2016 06:19:24 -0700 (PDT) Received: from mech-as222.men.bris.ac.uk (localhost [127.0.0.1]) by mech-as222.men.bris.ac.uk (8.15.2/8.15.2) with ESMTP id u4GDJN8d019166 for ; Mon, 16 May 2016 14:19:23 +0100 (BST) (envelope-from mexas@mech-as222.men.bris.ac.uk) Received: (from mexas@localhost) by mech-as222.men.bris.ac.uk (8.15.2/8.15.2/Submit) id u4GDJNkM019165 for freebsd-java@freebsd.org; Mon, 16 May 2016 14:19:23 +0100 (BST) (envelope-from mexas) Date: Mon, 16 May 2016 14:19:23 +0100 (BST) From: Anton Shterenlikht Message-Id: <201605161319.u4GDJNkM019165@mech-as222.men.bris.ac.uk> To: freebsd-java@freebsd.org Subject: help fix JOGL errors/warnings Reply-To: mexas@bris.ac.uk X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 13:19:27 -0000 Hi I'm trying to follow this JOGL tutorial: https://sites.google.com/site/justinscsstuff/jogl-tutorial-2 I can successfully create an empty window with AWT, although I get a warning: $ echo $CLASSPATH /usr/local/share/java/classes/jogl2.jar:/usr/local/share/java/classes/gluegen2.jar:/usr/local/share/java/classes/gluegen2-rt.jar:. $ cat SimpleScene.java import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.media.opengl.*; import javax.media.opengl.awt.GLCanvas; public class SimpleScene { public static void main(String[] args) { GLProfile glp = GLProfile.getDefault(); GLCapabilities caps = new GLCapabilities(glp); GLCanvas canvas = new GLCanvas(caps); Frame frame = new Frame("AWT Window Test"); frame.setSize(300, 300); frame.add(canvas); frame.setVisible(true); // by default, an AWT Frame doesn't do anything when you click // the close button; this bit of code will terminate the program when // the window is asked to close frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } } $ $ javac SimpleScene.java warning: Supported source version 'RELEASE_6' from annotation processor 'com.jogamp.gluegen.structgen.CStructAnnotationProcessor' less than -source '1.8' 1 warning $ What is this warning about? Is the example not conforming with my JOGL version? $ pkg info -xo jogl jogamp-jogl-2.2.4 graphics/jogamp-jogl Anyway, when I then run $ java SimpleScene I get an empty window. However, when I try to create a window with NEWT: (lower down on the same page: https://sites.google.com/site/justinscsstuff/jogl-tutorial-2 ) I get: $ cat SimpleScene.java import javax.media.opengl.*; import com.jogamp.newt.event.WindowAdapter; import com.jogamp.newt.event.WindowEvent; import com.jogamp.newt.opengl.GLWindow; public class SimpleScene { public static void main(String[] args) { GLProfile glp = GLProfile.getDefault(); GLCapabilities caps = new GLCapabilities(glp); GLWindow window = GLWindow.create(caps); window.setSize(300, 300); window.setVisible(true); window.setTitle("NEWT Window Test"); window.addWindowListener(new WindowAdapter() { public void windowDestroyNotify(WindowEvent arg0) { System.exit(0); }; }); } } $ javac SimpleScene.java warning: Supported source version 'RELEASE_6' from annotation processor 'com.jogamp.gluegen.structgen.CStructAnnotationProcessor' less than -source '1.8' 1 warning $ java SimpleScene X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 2/2, reusable (open, marked uncloseable): 0, pending (open in creation order): 2) X11Util: Open X11 Display Connections: 2 X11Util: Open[0]: NamedX11Display[:0.0, 0x8d6e22000, refCount 1, unCloseable false] X11Util: Open[1]: NamedX11Display[:0.0, 0x8d6e23400, refCount 1, unCloseable false] $ The window opens momentarity and then shuts down automatically. Is this an expected behaviour? I then try to run a moving triangle example, bottom of this page: https://sites.google.com/site/justinscsstuff/jogl-tutorial-3 I get this error: SimpleScene.java:34: error: incompatible types: FPSAnimator cannot be converted to Animator Animator animator = new FPSAnimator(canvas, 60); ^ 1 error Again, perhaps the example is out of date, or the other way round - the JOGL version installed is out of date? Thanks Anton