   Terrain rendering...
  I'm loading a grayscale, .bmp, heightmap file into verticies and rendering using  vertex arrays (I don't think my gfx card supports VBOs so ignore that code :( ).  It's rendering alright but it seems I'm only loading some of it or it's streaching the terrain out cause I'm getting a rectangle.  Could it be I'm not loading enough or it doesn't want to render so much?Here's a screenshot:http://img70.imageshack.us/img70/7839/terrainrect8gn.jpgHere's the code Loading part ( I don't use VBOs so m_useVBO is false):bool CTerrain::LoadTerrain(const char *filePath){SDL_Surface *imageInfo = 0;GLubyte *heightmap = 0;int counter = 0;//Load SDL_Surface with img dataimageInfo = IMG_Load(filePath);m_width = imageInfo->w;m_height = imageInfo->h;//Allocate heightfieldheightmap = new GLubyte[m_width * m_height];SDL_LockSurface(imageInfo);memcpy(heightmap, imageInfo->pixels, m_width * m_height);SDL_UnlockSurface(imageInfo);SDL_FreeSurface(imageInfo);//Allocate vertex buffer tempVertBuffer = new GLfloat[m_width * m_height * 12];for( int z = 0; z < m_height; z++){for(int x = 0; x < m_width  ; x++){static int counter = 0;float scaledHeight_1 = (float)heightmap[z * m_width + x] / 100;float scaledHeight_2 = (float)heightmap[(z + 1)* m_width + x] / 100;float scaledHeight_3 = (float)heightmap[(z + 1)* m_width + (x+1)] / 100;float scaledHeight_4 = (float)heightmap[z * m_width + (x+1)] / 100;tempVertBuffer[counter++] = static_cast<GLfloat>(x - m_width);tempVertBuffer[counter++] =  scaledHeight_1 * m_yscale;tempVertBuffer[counter++] =  static_cast<GLfloat>(z - m_height) ;tempVertBuffer[counter++] = static_cast<GLfloat>(x - m_width) ;tempVertBuffer[counter++] =  scaledHeight_2 * m_yscale;tempVertBuffer[counter++] = static_cast<GLfloat>(z + 1 - m_height);tempVertBuffer[counter++] = static_cast<GLfloat>(x + 1 - m_width) ;tempVertBuffer[counter++] =  scaledHeight_3 * m_yscale;tempVertBuffer[counter++] = static_cast<GLfloat>(z + 1 - m_height);tempVertBuffer[counter++] = static_cast<GLfloat>(x + 1 - m_width);tempVertBuffer[counter++] =  scaledHeight_4 * m_yscale;tempVertBuffer[counter++] = static_cast<GLfloat>(z - m_height);}}delete [] heightmap;heightmap = 0;if(GLEE_ARB_vertex_buffer_object && m_useVBO){glGenBuffers(1,&m_vertexBufferID);glBindBuffer(GL_ARRAY_BUFFER,m_vertexBufferID);glBufferData(GL_ARRAY_BUFFER,m_height * m_width * 3 * sizeof(GLfloat), tempVertBuffer,GL_STATIC_DRAW);delete [] tempVertBuffer;tempVertBuffer = 0;m_VBOused = true;printf("VBOs used for tarrain.\n");}else{if(tempVertBuffer){glVertexPointer(3,GL_FLOAT,0,tempVertBuffer);printf("Vertex arrays used for tarrain.\n%d many vertices\n", m_width * m_height * 12);}}return true;}Here's the rendering part:glDrawArrays(GL_QUADS,0,m_width * m_height);
  i am not sure, but i think it you have to set the size of data to render to the size in bytes, not elements   ;  No the count param in glDrawArrays is the number of vertices so it actually should be width * height * 4 which works.  Thanks for the hint!   