Ejemplo n.º 1
0
 public IModel Start()
 {
     GlHelper.VaoBinder(vao);
     GL.EnableVertexAttribArray(0);
     GL.EnableVertexAttribArray(2);
     return(this);
 }
Ejemplo n.º 2
0
 public TestModel()
 {
     vao = GlHelper.VaoCreator();
     GlHelper.VaoBinder(vao);
     indicesVbo  = GlHelper.LoadIndices(indices);
     verticesVbo = GlHelper.LoadVbo(0, 3, vertices);
     GlHelper.VaoBinder(0);
 }
Ejemplo n.º 3
0
        private void LoadAtlas(string atlasProperties)
        {
            var data       = atlasProperties.Split();
            var id         = int.Parse(data[0]);
            var width      = int.Parse(data[2]);
            var height     = int.Parse(data[3]);
            var elemWidth  = int.Parse(data[4]);
            var elemHeight = int.Parse(data[5]);
            var glId       = GlHelper.LoadTexture(Path.Combine(directory, data[1]));

            atlases.Add(id, new Atlas(glId, width, height, elemWidth, elemHeight));
        }
Ejemplo n.º 4
0
        private void LoadToVideoCard()
        {
            if (vao == -1)
            {
                vao = GlHelper.VaoCreator();
            }

            GlHelper.VaoBinder(vao);
            GlHelper.DeleteVbos(verticesVbo, indicesVbo, textureVbo);
            indicesVbo  = GlHelper.LoadIndices(indices.ToArray());
            verticesVbo = GlHelper.LoadVbo(0, 3, vertices.ToArray());
            textureVbo  = GlHelper.LoadVbo(2, 2, textureCoords.ToArray());
        }
Ejemplo n.º 5
0
        public IModel Start()
        {
            if (shouldLoadToGl)
            {
                LoadToVideoCard();
                shouldLoadToGl = false;
            }

            GlHelper.VaoBinder(vao);
            GL.EnableVertexAttribArray(0);
            GL.EnableVertexAttribArray(2);
            GL.BindTexture(TextureTarget.Texture2D, storage[1].AtlasGlId);
            return(this);
        }
Ejemplo n.º 6
0
 private void ReleaseUnmanagedResources()
 {
     GlHelper.VaoRemover(atlases.Values.Select(a => a.GlAtlasId).ToArray());
 }