Quote Originally Posted by chronozphere
Thanks for your reply.

Yeah. I understand your first method. I have a piece of code that does exactly that. The problem was that I needed to load it as an indexed mesh. Rendering itsself is not really a problem.

My goal was to load the obj file while still having it indexed, so that the same vertex is not sent to the GPU twice. I've decided to drop this, and just load the geometry as a simple list of triangles, each having unique vertex- and uv coordinates. This makes my life a bit easier. It's not really optimal, but for small meshes, you wouldn't notice any difference.
Personally, I hate the .obj format. I mostly store everything in binary form, as most of stuff is not meant to be edited by a human directly (nobody goes directly editing the .obj files, rather they load it in a 3d editor).

As for your goal, there is a problem. The problem with OBJ is that there are separate indices for vertices and uv coords and this is not how OpenGL works (there is only one set of indices for everything). It actually is an indexed mesh, just not the way you or I want it. I did not understand your first post well, but now I know what you mean. To get an indexed mesh, you'll probably have to do something like what User137 said.