3
\$\begingroup\$

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?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Which Java OpenGL API are you using? \$\endgroup\$ Commented Jan 26, 2012 at 16:20
  • \$\begingroup\$ I'm using LWJGL \$\endgroup\$ Commented Jan 26, 2012 at 16:30
  • \$\begingroup\$ Am I taking crazy pills or is that code C++? EDIT: Oh. Porting tag. \$\endgroup\$ Commented Jan 26, 2012 at 17:54

1 Answer 1

3
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.