Results 1 to 3 of 3

Thread: passing vertices and indices to opengl

  1. #1
    Newbie Newbie
    Join Date
    Jan 2015
    Posts
    2

    passing vertices and indices to opengl

    Hi. I'm kinda new to OpenGL and I was wondering how I can draw cube indices from a vector instead of an array. I've already written a Wavefront obj loader, now I just need to pass the vertices, normals, etc. to OpenGL. If anyone could help me out that would be appreciated, thanks!

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,654
    Quote Originally Posted by Siddy1 View Post
    I was wondering how I can draw cube indices from a vector instead of an array.
    What do you mean vector and array? Are you talking about a std::vector instead of a C/C++ array? If so, then just pass the address of the first element of the vector. Just like a C/C++ array, all the storage is contiguous in a vector so that works.

  3. #3
    Newbie Newbie
    Join Date
    Jan 2015
    Posts
    2
    Yes, I meant std:vector, and Thanks for the help!

Similar Threads

  1. Normals, Vertices, Indices, and Shaders
    By Septimra in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 04-16-2015, 05:49 PM
  2. Replies: 7
    Last Post: 03-01-2013, 09:57 AM
  3. Replies: 1
    Last Post: 02-13-2013, 08:55 AM
  4. Create vertices indices
    By MacPC in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 06-05-2009, 07:17 AM
  5. Replies: 13
    Last Post: 10-31-2005, 08:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean