Vertex Arrays

This is a discussion on Vertex Arrays within the Game Programming forums, part of the General Programming Boards category; I was reading through the Redbook today, I want to implement vertex arrays into my program, but the problem is, ...

  1. #1
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964

    Vertex Arrays

    I was reading through the Redbook today, I want to implement vertex arrays into my program, but the problem is, the Vertex array implementation in the Redbook uses static arrays...

    This is no good!

    How can I use vertex arrays in my program but keep them dynamic by using an STL container or something similar?

    Code:
    glColorPointer (3, GL_FLOAT, 0, colors);
    glVertexPointer (2, GL_INT, 0, vertices);
    colors and vertices are the names of the static arrays, do I just simply put the name of the vector in for colors and vertices?
    Last edited by Shamino; 01-07-2006 at 11:17 PM.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Why can't you use static arrays for the objects?

  3. #3
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964
    I'd have to create a static array for every model I want to add to my scene.. Then fill it up according to each model...

    with a vector it can automatically size itself to whatever the models size is..

    But I just realized I don't need to put the stuff in vectors, that would be taking an extra step..

    I can just access the data directly with a pointer to the model.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error help making no sense
    By tunerfreak in forum C++ Programming
    Replies: 5
    Last Post: 04-17-2007, 08:55 PM
  2. Implemented vertex arrays, prob. rendering
    By BobMcGee123 in forum Game Programming
    Replies: 8
    Last Post: 07-22-2006, 09:00 PM
  3. Vertex Arrays
    By Shamino in forum Game Programming
    Replies: 3
    Last Post: 11-05-2005, 01:04 AM
  4. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM
  5. Pixel Shaders.
    By Cheeze-It in forum Game Programming
    Replies: 1
    Last Post: 05-21-2002, 02:16 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21