/// <summary>
    /// Creates a new square texture atlas.
    /// </summary>
    /// <param name="size">The size of one side of the square texture.</param>
    /// <returns></returns>
    private int CreateAtlas()
    {
        TextureAtlas atlas = new TextureAtlas(atlasSize);

        int newIndex = 0;
        while (atlases.ContainsKey(newIndex))
        {
            ++newIndex;
        }

        atlases.Add(newIndex, atlas);

        return newIndex;
    }