Hi everybody,

I'm trying to port libMini terrain rendering engine to an embedded system with OpenGL ES 1.1. I'm having some trouble converting the code below to work with ES. I would really appreciate it if someone could help me with this...

Code :
extern int fancnt,vtxcnt;
 
void beginfans()
   {
   fancnt=vtxcnt=0;
   }
 
inline void beginfan()
   {
   if (fancnt++>0) glEnd();
   glBegin(GL_TRIANGLE_FAN);
   }
 
inline void normal(const float dx,const float dy,const float dz)
   {
   glNormal3f(dx,dy,dz);
   }
 
inline void texcoord(const float s,const float t,const float r)
   {
   glTexCoord(s,t,r);
   }
 
inline void fanvertex(const float x,const float y,const float z)
   {
   glVertex3f(x,y,z);
   vtxcnt++;
   }
 
void endfans()
   {
   if (fancnt>0) glEnd();
   }
 
inline void renderline(const float x1,const float y1,const float z1,const float x2,const float y2,const float z2)
   {
   glBegin(GL_LINES);
   glVertex3f(x1,y1,z1);
   glVertex3f(x2,y2,z2);
   glEnd();
   }
 
inline void renderpoint(const float x,const float y,const float z)
   {
   glBegin(GL_POINTS);
   glVertex3f(x,y,z);
   glEnd();
   }
 
}


Thank you in advance,
Peter