Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualShawn619

Posted 30 June 2013 - 01:39 PM

Geforce gtx 650 + i7 3770 (3.4ghz)

 

I'm actually using display lists for everything I draw. Are display lists deprecated? This is how I draw my terrain(inside a display list):

//draw terrain
for(int i=0;i<faces.size();i++){
     glBegin(GL_TRIANGLES);
         glColor4f(colors[faces[i]->colorNum-1]->r,colors[faces[i]->colorNum-1]->g,colors[faces[i]->colorNum-1]->b,1.0);
 
         glNormal3f(normals[faces[i]->faces[1]-1]->x,normals[faces[i]->faces[1]-1]->y,normals[faces[i]->faces[1]-1]->z);
         glVertex3f(vertex[faces[i]->faces[0]-1]->x,vertex[faces[i]->faces[0]-1]->y,vertex[faces[i]->faces[0]-1]->z);
 
         glNormal3f(normals[faces[i]->faces[3]-1]->x,normals[faces[i]->faces[3]-1]->y,normals[faces[i]->faces[3]-1]->z);
         glVertex3f(vertex[faces[i]->faces[2]-1]->x,vertex[faces[i]->faces[2]-1]->y,vertex[faces[i]->faces[2]-1]->z);
 
         glNormal3f(normals[faces[i]->faces[5]-1]->x,normals[faces[i]->faces[5]-1]->y,normals[faces[i]->faces[5]-1]->z);
         glVertex3f(vertex[faces[i]->faces[4]-1]->x,vertex[faces[i]->faces[4]-1]->y,vertex[faces[i]->faces[4]-1]->z);
    glEnd();
}

How would I transform these draw calls into a VBO/FBO?


#1Shawn619

Posted 30 June 2013 - 01:26 PM

Geforce gtx 650 + i7 3770 (3.4ghz)

 

I'm actually using the now deprecated way of drawing(gL_triangles & glvertex3f):

 

//draw terrain
for(int i=0;i<faces.size();i++){
     glBegin(GL_TRIANGLES);
         glColor4f(colors[faces[i]->colorNum-1]->r,colors[faces[i]->colorNum-1]->g,colors[faces[i]->colorNum-1]->b,1.0);
 
         glNormal3f(normals[faces[i]->faces[1]-1]->x,normals[faces[i]->faces[1]-1]->y,normals[faces[i]->faces[1]-1]->z);
         glVertex3f(vertex[faces[i]->faces[0]-1]->x,vertex[faces[i]->faces[0]-1]->y,vertex[faces[i]->faces[0]-1]->z);
 
         glNormal3f(normals[faces[i]->faces[3]-1]->x,normals[faces[i]->faces[3]-1]->y,normals[faces[i]->faces[3]-1]->z);
         glVertex3f(vertex[faces[i]->faces[2]-1]->x,vertex[faces[i]->faces[2]-1]->y,vertex[faces[i]->faces[2]-1]->z);
 
         glNormal3f(normals[faces[i]->faces[5]-1]->x,normals[faces[i]->faces[5]-1]->y,normals[faces[i]->faces[5]-1]->z);
         glVertex3f(vertex[faces[i]->faces[4]-1]->x,vertex[faces[i]->faces[4]-1]->y,vertex[faces[i]->faces[4]-1]->z);
    glEnd();
}

 

How would I transform these draw calls into a VBO/FBO?


PARTNERS