Results 1 to 3 of 3

Thread: to many glvertex3f statements

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005

    to many glvertex3f statements

    i have 10 pages of code with nothing but glvertex3f statements. it was 40 pages i reduced it by creating a list and using glcalllist. what would be a way to decrease the code even more.

    once i can get some images for it its suppose to look like a race track.

  2. #2
    Senior Member Frequent Contributor ehsan2004's Avatar
    Join Date
    Jun 2004

    Re: to many glvertex3f statements

    Yes. You can reduce the code-Less then one page-and read the data from a text file. Most of the NeHe articles use from this manner:

  3. #3
    Senior Member Regular Contributor
    Join Date
    May 2004

    Re: to many glvertex3f statements

    You might wanna look at glDrawElements and glMultiDrawElements.
    They use an array of indices to pick vertices from an vertex array.
    This way you can use a vertex multiple times.

Similar Threads

  1. Not understanding switch statements
    By calvarado777 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-02-2012, 10:56 AM
  2. Too Many If Statements in Fragment Code?
    By Steven Walker in forum OpenGL: GLSL
    Replies: 5
    Last Post: 12-11-2005, 01:35 PM
  3. for/while statements
    By Aeluned in forum OpenGL: GLSL
    Replies: 11
    Last Post: 05-19-2004, 12:50 PM
  4. if/then/else and for statements
    By divide in forum OpenGL: GLSL
    Replies: 10
    Last Post: 03-26-2004, 06:16 AM
  5. Interpretation of statements
    By dummy in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-28-2000, 12:42 PM

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