private void generateLevel()
	{
		ArrayList<Vertex> vertices = new ArrayList<Vertex>();
		ArrayList<Integer> indices = new ArrayList<Integer>();
		
		for(int i = 0; i < level.getWidth(); i++)
		{
			for(int j = 0; j < level.getHeight(); j++)
			{
				if((level.getPixel(i,j) & 0xFFFFFF) == 0)
					continue;
				
				float[] texCoords = calcTexCoords((level.getPixel(i,j) & 0x00FF00) >> 8);

                addSpecial(level.getPixel(i,j) & 0x0000FF, i, j);

				//Generate Floor
				addFace(indices, vertices.size(), true);
				addVertices(vertices, i, j, 0, true, false, true, texCoords);
				
				//Generate Ceiling
				addFace(indices, vertices.size(), false);
				addVertices(vertices, i, j, 1, true, false, true, texCoords);
			
				//Generate Walls
				texCoords = calcTexCoords((level.getPixel(i,j) & 0xFF0000) >> 16);
				
				if((level.getPixel(i,j - 1) & 0xFFFFFF) == 0)
				{
                    colPosStart.add(new Vector2f(i * SPOT_WIDTH, j * SPOT_LENGTH));
                    colPosEnd.add(new Vector2f((i + 1) * SPOT_WIDTH, j * SPOT_LENGTH));
					addFace(indices, vertices.size(), false);
					addVertices(vertices, i, 0, j, true, true, false, texCoords);
				}
				if((level.getPixel(i,j + 1) & 0xFFFFFF) == 0)
				{
                    colPosStart.add(new Vector2f(i * SPOT_WIDTH, (j + 1) * SPOT_LENGTH));
                    colPosEnd.add(new Vector2f((i + 1) * SPOT_WIDTH, (j + 1) * SPOT_LENGTH));
					addFace(indices, vertices.size(), true);
					addVertices(vertices, i, 0, (j + 1), true, true, false, texCoords);
				}
				if((level.getPixel(i - 1,j) & 0xFFFFFF) == 0)
				{
                    colPosStart.add(new Vector2f(i * SPOT_WIDTH, j * SPOT_LENGTH));
                    colPosEnd.add(new Vector2f(i * SPOT_WIDTH, (j + 1) * SPOT_LENGTH));
					addFace(indices, vertices.size(), true);
					addVertices(vertices, 0, j, i, false, true, true, texCoords);
				}
				if((level.getPixel(i + 1,j) & 0xFFFFFF) == 0)
				{
                    colPosStart.add(new Vector2f((i + 1) * SPOT_WIDTH, j * SPOT_LENGTH));
                    colPosEnd.add(new Vector2f((i + 1) * SPOT_WIDTH, (j + 1) * SPOT_LENGTH));
					addFace(indices, vertices.size(), false);
					addVertices(vertices, 0, j, (i + 1), false, true, true, texCoords);
				}
			}
		}
		
		Vertex[] vertArray = new Vertex[vertices.size()];
		Integer[] intArray = new Integer[indices.size()];
		
		vertices.toArray(vertArray);
		indices.toArray(intArray);
		
		mesh = new Mesh(vertArray, Util.toIntArray(intArray));
	}