Skip to content

Instantly share code, notes, and snippets.

View xranby's full-sized avatar
🧘
guru meditation

Xerxes Rånby xranby

🧘
guru meditation
View GitHub Profile
@xranby
xranby / JOGLQuadES1.java
Last active September 23, 2015 15:23
This program displays a simple 3D rendering of a polygon using JOGL. Please note though that this code is a demonstration of the use of JOGL and as such makes use of immediate mode drawing commands; this serves to show how the conventional C style API is used through JOGL, but it is strongly recommended to make use of modern OpenGL techniques.
import com.jogamp.opengl.*;
import com.jogamp.opengl.fixedfunc.*;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.ImmModeSink;
import com.jogamp.newt.opengl.GLWindow;
/**
* Self-contained example (within a single class only to keep it simple)
* displaying a rotating quad
*/
public class JOGLQuadES1 implements GLEventListener {
@xranby
xranby / gldemo.rb
Last active August 29, 2015 14:27
Initialized fine now
Dir.glob('*.jar').each {|jar| require jar }
java_import 'com.jogamp.opengl.GLCapabilities',
'com.jogamp.opengl.GLDrawableFactory',
'com.jogamp.opengl.GLProfile',
'com.jogamp.opengl.GL4',
'com.jogamp.nativewindow.util.Rectangle',
'com.jogamp.newt.opengl.GLWindow',
'com.jogamp.opengl.util.FPSAnimator',
'com.jogamp.opengl.GLEventListener',
wget http://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z
7z x jogamp-all-platforms.7z
wget https://gist.github.com/xranby/42ffcd1d4298356dd177/raw/aca00bd10252496a3c772914ede5a54cad0ed2f7/TextRendering.java
javac -cp ./jogamp-all-platforms/jar/gluegen-rt.jar:./jogamp-all-platforms/jar/jogl-all.jar:. TextRendering.java
java -cp ./jogamp-all-platforms/jar/gluegen-rt.jar:./jogamp-all-platforms/jar/jogl-all.jar:. TextRendering
/**
* Copyright 2012 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list