converting code from from Jogl to lwjgl

Started by amitzo, April 18, 2006, 08:03:39

Previous topic - Next topic

amitzo

I have working Jogl code that I need to convert to lwjgl.

I couldn't find gl.GL_BGRA or gl.GL_UNSIGNED_INT_8_8_8_8_REV in lwjgl.
(pixelData is an int[] containing image data)

What's the equivalent code in lwjgl?  Help please?



Jogl version:

public void init(GLDrawable drawable) {
 GL gl = drawable.getGL();
 gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
 gl.glShadeModel(GL.GL_FLAT);
 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
}

public void display(GLDrawable drawable) {
 GL gl = drawable.getGL();
 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);
 gl.glDrawPixels(WIDTH, HEIGHT, gl.GL_BGRA, gl.GL_UNSIGNED_INT_8_8_8_8_REV, pixelData);
}

public void reshape(GLDrawable drawable, int i, int x, int width, int height) {
 GL gl = drawable.getGL();
 GLU glu = drawable.getGLU();
 gl.glViewport(0, 0, WIDTH, HEIGHT);
 gl.glMatrixMode(GL.GL_PROJECTION);
 gl.glLoadIdentity();
 glu.gluOrtho2D(0.0, (double) WIDTH, 0.0, (double) HEIGHT);
 gl.glMatrixMode(GL.GL_MODELVIEW);
 gl.glLoadIdentity();
}

WiESi

GL12.GL_BGRA

GL12.GL_UNSIGNED_INT_8_8_8_8_REV


WiESi