public IModel Start() { GlHelper.VaoBinder(vao); GL.EnableVertexAttribArray(0); GL.EnableVertexAttribArray(2); return(this); }
public TestModel() { vao = GlHelper.VaoCreator(); GlHelper.VaoBinder(vao); indicesVbo = GlHelper.LoadIndices(indices); verticesVbo = GlHelper.LoadVbo(0, 3, vertices); GlHelper.VaoBinder(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)); }
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()); }
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); }
private void ReleaseUnmanagedResources() { GlHelper.VaoRemover(atlases.Values.Select(a => a.GlAtlasId).ToArray()); }