1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| public void display(GLAutoDrawable drawable)
{
int i, j ;
GL gl = drawable.getGL() ;
short[] titi = new short[image.getSize()] ;
ByteBuffer buffer = ByteBuffer.allocate(image.getSize()*2); // on multiplie par 2 car 1 short = 2 octets
ShortBuffer toto = buffer.asShortBuffer();
... // Je rempli TiTi avec les valeurs de mon image
toto.put(titi) ;
gl.glClear(GL.GL_COLOR_BUFFER_BIT) ; // clear window
gl.glPixelZoom((float)(TailleZoom/100.0), (float)(TailleZoom/100.0)) ;
gl.glDrawPixels(image.getWidth(),image.getHeight(), gl.GL_LUMINANCE16, gl.GL_UNSIGNED_SHORT, toto) ;
gl.glFlush() ; |