Help for a lost one...

I try to make this sample piece of code work… (init ommited)
Am I doing something wrong…

    int[] i = { 800,500,900,500 };
    
    gl.glBegin (GL.GL_POINTS );
        gl.glVertex2iv ( i );            
    gl.glEnd ();

It can’t figure out what the hell is wrong in it…

Should i stop trying or …

I don’t see any colour being set, are you sure you’re not drawing black points on a black background? Equally, are you sure that your camera is set up so that those points are actually visible on screen (I find drawing a set of axies is simple with a few GL_LINE calls and helps when debugging camera setups).

Setting huge point sizes can also cause graphics cards to break silently as well, try only using a point size of 1 if you’re not already.

Well I think i have all the camera, color and projections well since the following code works fine …

    gl.glBegin (GL.GL_POINTS );                
        gl.glVertex2i ( 800,500 );
        gl.glVertex2i ( 900,500 );
    gl.glEnd ();

May i misuse the array?

Thanks for help, in every case! I trully miss a tutorial but this forum is a great help!

Tsk, I should have spotted that, I blame not using the gl*v methods because they’re all a bit crap really.

glVertex2iv specifies a single vertex with (as the name suggests) two integer values in an array. Passing it an array of length 4 doesn’t change things, it’ll only use the first two values.

Your second method with two glVertex calls is the proper way to do it. If you actually do want to bung all your vertex data in an array (or better yet an IntBuffer or FloatBuffer) then look into vertex arrays (using glVertexPointer and glDrawArrays/glDrawElements).

Edit: New section in the wiki on vertex arrays - http://wiki.java.net/bin/view/Games/VertexArrays

I thought i could do it the easy way wy gl*v but i’ll do it with the vertex arrays and all the buffer things…

Thanks again!