
#include <stdio.h>

// All headers are automatically included from "iglu.h"
#include "iglu.h"

// IGLU classes and constants are all inside the iglu namespace.
using namespace iglu;

// Create a file parser
IGLUFileParser::Ptr fileParser;

int main(int argc, char** argv)
{
	// Create a parser
	fileParser = new IGLUFileParser( "testFile.txt" );
	
	// Print some description to the user...
	printf("*** Beginning to parse file: %s\n", fileParser->GetFileName() );

	// Loop through the non-blank, non-comment lines in the file
	char *linePtr = 0;
	while ( linePtr = fileParser->ReadNextLine() )
	{
		printf("Read line %d: %s", fileParser->GetLineNumber(), fileParser->GetCurrentLinePointer() );

		// Read the first token on the line
		char token[64];
		fileParser->GetToken( token );  // Not entirely safe: Could overrun the buffer
		if ( !strcmp( "vec3", token ) )
		{
			vec3 myVec = fileParser->GetVec3();
			printf("    Found a vec3! [ %f | %f | %f ] \n", myVec.X(), myVec.Y(), myVec.Z() );
		}
	}


	return 0;
}
