Re: Help with porting opengl java libraries (gluegen2 / libjogl2-java) to ppc64el
Hi Frédéric,
Le 2015-10-09 23:28, Gilles Filippini a écrit :
Le 2015-10-09 15:47, Gilles Filippini a écrit :
Le 2015-10-09 14:17, Frederic Bonnard a écrit :
Would you mind building from the source packages? I should have them
ready by this evening.
Sources are ok for me. This evening, I won't be next to the machine.
Will a remote X display be ok for the test ? Else I can test with a
real
display on Monday morning, if it's not too late for your needs.
In the meantime a new upstream release was uploaded to experimental.
I'd
better update update my patches to not waste your time.
The packages are now available in experimental. You'll need
libgluegen2-rt-java=2.3.2-1, libgluegen2-jni=2.3.2-1,
libgluegen2-build-java=2.3.2-1, libjogl2-java=2.3.2+dfsg-1,
libjogl2-jni=2.3.2+dfsg-1.
Then compile the attached java files with:
$ javac -cp /usr/share/java/gluegen2-rt.jar:/usr/share/java/jogl2.jar
OneTriangle*.java
And run with:
$ java -cp .:/usr/share/java/gluegen2-rt.jar:/usr/share/java/jogl2.jar
OneTriangleAWT
It should open a window with a colored triangle looking like this one:
<https://jogamp.org/wiki/index.php/File:JWS-cmdline-test.png>
Thanks!
_g.
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
import com.jogamp.opengl.glu.GLU;
public class OneTriangle {
protected static void setup( GL2 gl2, int width, int height ) {
gl2.glMatrixMode( GL2.GL_PROJECTION );
gl2.glLoadIdentity();
// coordinate system origin at lower left with width and height same as the window
GLU glu = new GLU();
glu.gluOrtho2D( 0.0f, width, 0.0f, height );
gl2.glMatrixMode( GL2.GL_MODELVIEW );
gl2.glLoadIdentity();
gl2.glViewport( 0, 0, width, height );
}
protected static void render( GL2 gl2, int width, int height ) {
gl2.glClear( GL.GL_COLOR_BUFFER_BIT );
// draw a triangle filling the window
gl2.glLoadIdentity();
gl2.glBegin( GL.GL_TRIANGLES );
gl2.glColor3f( 1, 0, 0 );
gl2.glVertex2f( 0, 0 );
gl2.glColor3f( 0, 1, 0 );
gl2.glVertex2f( width, 0 );
gl2.glColor3f( 0, 0, 1 );
gl2.glVertex2f( width / 2, height );
gl2.glEnd();
}
}
import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.awt.GLCanvas;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
* A minimal program that draws with JOGL in an AWT Frame.
*
* @author Wade Walker
*/
public class OneTriangleAWT {
public static void main( String [] args ) {
GLProfile glprofile = GLProfile.getDefault();
GLCapabilities glcapabilities = new GLCapabilities( glprofile );
final GLCanvas glcanvas = new GLCanvas( glcapabilities );
glcanvas.addGLEventListener( new GLEventListener() {
@Override
public void reshape( GLAutoDrawable glautodrawable, int x, int y, int width, int height ) {
OneTriangle.setup( glautodrawable.getGL().getGL2(), width, height );
}
@Override
public void init( GLAutoDrawable glautodrawable ) {
}
@Override
public void dispose( GLAutoDrawable glautodrawable ) {
}
@Override
public void display( GLAutoDrawable glautodrawable ) {
OneTriangle.render( glautodrawable.getGL().getGL2(), glautodrawable.getSurfaceWidth(), glautodrawable.getSurfaceHeight() );
}
});
final Frame frame = new Frame( "One Triangle AWT" );
frame.add( glcanvas );
frame.addWindowListener( new WindowAdapter() {
public void windowClosing( WindowEvent windowevent ) {
frame.remove( glcanvas );
frame.dispose();
System.exit( 0 );
}
});
frame.setSize( 640, 480 );
frame.setVisible( true );
}
}
Reply to: