Пример #1
0
        /// <summary>
        /// Dispose method to clean up the VAO releases the OpenGL Buffer
        /// </summary>
        public void Dispose()
        {
            if (!disposed)
            {
                ibo?.Dispose();
                vbo?.Dispose();

                GL.DeleteVertexArray(handle);
                GC.SuppressFinalize(this);
                disposed = true;
            }
        }
Пример #2
0
        /// <summary>
        /// Adds a VBO object to the VAO needs to have one to draw, if a second is added it will replace the first and the first will be disposed of
        /// </summary>
        /// <param name="VBO">The VBO object to be added</param>
        public void SetVBO(VertexBufferObject VBO)
        {
            if (vbo != null)
            {
                UnBind();
                vbo.Dispose();
                Bind();
            }

            vbo = VBO;
            vbo.Bind();
            vbo.BufferData();
        }