1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| public void display(GLAutoDrawable drawable) {
[...]
if (starting) {
if(ssAnimator == null) {
ssAnimator = PropertySetter.createAnimator(6000, this, "position", 1.0f, 0.0f);
ssAnimator.addTarget(new TimingTargetAdapter() {
public void end() {
starting = false;
}
});
ssAnimator.start();
}
gl.glMatrixMode(GL.GL_PROJECTION);
Texture t = TextureIO.newTexture(screenshot, false);
TextureCoords tc = t.getImageTexCoords();
float tx1 = tc.left();
float ty1 = tc.top();
float tx2 = tc.right();
float ty2 = tc.bottom();
t.enable();
t.bind();
gl.glLoadIdentity();
gl.glBegin(GL.GL_QUADS);
gl.glTexCoord2f(tx1, ty1); gl.glVertex2f(-position, position);
gl.glTexCoord2f(tx2, ty1); gl.glVertex2f(position, position);
gl.glTexCoord2f(tx2, ty2); gl.glVertex2f(position, -position);
gl.glTexCoord2f(tx1, ty2); gl.glVertex2f(-position, -position);
gl.glEnd();
} |
Partager