Can you post more data? Does your quad draw if you use the same vertices in immediate mode? Is the colour correct when you call glDrawArrays? Is the orientation correct, etc? Like I say, it would be helpful if you post more of your rendering code (like the whole drawing function).
Hi,
There is more to this than meets the eye from this mornings experimenting, it is likly not a problem with the drawing of the vertex data but tha actual reading of the vertex data.
I have written a function to read in data from a text file and store that data in an array. This function is below:
void OpenMapAndParse ()
{
ifstream fin; //FILE POINTER TO MAP FILE
float rectangles[MAX_SIZE];
float triangles[MAX_SIZE];
int i;
fin.open(“map1.map”); //OPEN THE FILE
//GET WORLD DATA
fin >> worldWidth;
fin >> worldDepth;
fin >> numberRectangles;
fin >> numberTriangles;
//READ RECTANGLE VERTEX DATA
for(i = 0; i < (12 * numberRectangles); i++)
fin >> rectangles[i];
//READ TRIANGLE VERTEX DATA
for(i = 0; i < (9 * numberTriangles); i++)
fin >> triangles[i];
fin.close(); //CLOSE THE FILE
}
(not sure that looks, box is too small), and the data file is:
Hi,
Sorry to waste your time, i made a hell of a stupid mistake, i had declared the variable rectangles in the function and as a global, once commenting this line out, it worked. Sorry again. This has been bugging me since friday, god i feel a fool.