GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


Arrays by KooriTora
1
 
    GLfloat Vertices[5][3] ={{-5.0, -5.0, 5.0},
                            {5.0, -5.0, -5.0},
                            {0.0, 5.0, 0.0},
                            {-5.0, -5.0, -5.0},
                            {5.0, -5.0, 5.0}
                            };

    GLfloat Colors[5][3] =    {{0.0, 0.0, 0.0},
                            {0.0, 0.0, 0.3},
                            {0.0, 0.0, 0.0},
                            {0.0, 0.0, 0.0},
                            {0.0, 0.0, 0.3},
                            };

    glVertexPointer(3,
                    GL_FLOAT,                    0,        
                    Vertices
                    ); 

    GLuint Indices[12] = {0, 1, 2, 3 ,1 ,2, 1, 3, 2, 4, 1, 2};  

    glDrawElements(    GL_TRIANGLES,        
                    12,                    GL_UNSIGNED_INT,
                    Indices    
                    );