samples/infinicity.c
/**
 * create the roads object with textures
 * 
 */
create the roads object with textures
create the roads object with textures
void init_geometryRoads(){
	kuhl_geometry_new(&roads, program, 4, GL_TRIANGLES);
	GLfloat vertexPositions[] = {
		0, 0, 0,
		10, 0, 0,
		10, 0, 10,
		0, 0, 10
	};
	kuhl_geometry_attrib(&roads, vertexPositions, 3, "in_Position", KG_WARN);
	GLuint indexData[] = { 
		0, 1, 2,  
		0, 2, 3
	};
	kuhl_geometry_indices(&roads, indexData, 6);
	GLfloat colorData[] = {
		1, 1, 1,
		1, 1, 1,
		1, 1, 1,
		1, 1, 1
	};
	kuhl_geometry_attrib(&roads, colorData, 3, "in_Color", KG_WARN);
	GLfloat texcoordData[] = {
		0, 0,
		10, 0,
		10, 10,
		0, 10
	};
	kuhl_geometry_attrib(&roads, texcoordData, 2, "in_TexCoord", KG_WARN);
	GLuint texId = 0;
	kuhl_read_texture_file_wrap("../images/road.png", &texId, GL_REPEAT, GL_REPEAT);
	kuhl_geometry_texture(&roads, texId, "tex", KG_WARN);
}
void init_geometryRoads ( ) { kuhl_geometry_new ( & roads , program , 4 , GL_TRIANGLES ) ; GLfloat vertexPositions [ ] = { 0 , 0 , 0 , 10 , 0 , 0 , 10 , 0 , 10 , 0 , 0 , 10 } ; kuhl_geometry_attrib ( & roads , vertexPositions , 3 , " " , KG_WARN ) ; GLuint indexData [ ] = { 0 , 1 , 2 , 0 , 2 , 3 } ; kuhl_geometry_indices ( & roads , indexData , 6 ) ; GLfloat colorData [ ] = { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 } ; kuhl_geometry_attrib ( & roads , colorData , 3 , " " , KG_WARN ) ; GLfloat texcoordData [ ] = { 0 , 0 , 10 , 0 , 10 , 10 , 0 , 10 } ; kuhl_geometry_attrib ( & roads , texcoordData , 2 , " " , KG_WARN ) ; GLuint texId = 0 ; kuhl_read_texture_file_wrap ( " " , & texId , GL_REPEAT , GL_REPEAT ) ; kuhl_geometry_texture ( & roads , texId , " " , KG_WARN ) ; }
create the roads object with textures
create the roads object with textures