Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to convert the following code to Java:

glVertexPointer( 3, GL_FLOAT, 0, &(mesh.m_PositionBuffer[0]) );

Where mesh::mPositionBuffer is std::vector<glm::vec3>;

How would I make a similar call to glVertexPointer with a first index to the position buffer?

share|improve this question
Which Java OpenGL API are you using? – Josh Petrie Jan 26 '12 at 16:20
I'm using LWJGL – Gerstmann Jan 26 '12 at 16:30
Am I taking crazy pills or is that code C++? EDIT: Oh. Porting tag. – Byte56 Jan 26 '12 at 17:54

You should look at the overload set in the documentation. Probably the candidate you're interested in would be the glVertexPointer overload that takes a FloatBuffer, which you'd fill with the components of the mesh's position vertices.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.