/// <summary>
        /// Initializes a new instance of the <see cref="GlSpriteBatch"/> class.
        /// </summary>
        /// <param name="atlasFullPath"></param>
        /// <param name="glProgramId"></param>
        public GlSpriteBatch(string atlasFullPath, uint glProgramId)
        {
            Atlas       = GlUtil.LoadAtlas(atlasFullPath);
            GlProgramId = glProgramId;

            GlCanvasResolutionUniformId = GL.GetUniformLocation(
                GlProgramId,
                "CanvasResolution"
                );

            GlUvMapResolutionUniformId = GL.GetUniformLocation(
                GlProgramId,
                "UvMapResolution"
                );

            VertexCount     = 0;
            VboDrawContents = new List <float>();
            VboUvContents   = new List <float>();
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GlSpriteBatch"/> class.
        /// </summary>
        /// <param name="atlasFullPath">
        /// The atlas to use when drawing sprites.
        /// </param>
        /// <param name="glProgramId">
        /// The ID of the OpenGL Shader Program to use.
        /// </param>
        public GlSpriteBatch(GlSpriteAtlas atlas, uint glProgramId)
        {
            Atlas       = atlas;
            GlProgramId = glProgramId;

            GlCanvasResolutionUniformId = GL.GetUniformLocation(
                GlProgramId,
                "CanvasResolution"
                );

            GlUvMapResolutionUniformId = GL.GetUniformLocation(
                GlProgramId,
                "UvMapResolution"
                );

            VertexCount     = 0;
            VboDrawContents = new List <float>();
            VboUvContents   = new List <float>();
        }